Comments (7)
Ok, actually after trying it with gvim -u NONE -U NONE
, it seems that pressing <CR>
in completion menu does insert a newline.
I'm using the mappings from http://vim.wikia.com/wiki/Improve_completion_popup_menu , esp. inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
I'm using Windows btw so pressing Enter
to choose a completion item is the standard shortcut. But it is a bit hard to add the behaviour I want to the mapping set by the plugin, since the mapping is added by an autocommand thus it is hard to override it.
from bullets.vim.
Hi @char101,
Thanks for reaching out.
Can you please provide a minimal vimrc for reproducing the problem you are experiencing?
Are you using some plugin or special mappings for navigating and selecting a completion result?
I just tested what happens when a completion menu comes up at the end of the line and seems like <CR>
should work just fine. (I am using deoplete). See GIF below:
from bullets.vim.
Hi,
From the GIF, when selecting hello_ary
and pressing <CR>
, it should only insert the completion without adding a newline, otherwise if I am selecting a completion mid sentence, I will have to press backspace to go back to the previous line.
from bullets.vim.
Seems like this is a setup specific to your .vimrc so I'm closing this issue.
If you want to open a PR that will set the mapping in any other way that is more easily override-able I'll be open to that.
from bullets.vim.
I just noticed this issue myself, also on Windows if that matters.
I have
let g:bullets_enabled_file_types = [ \ 'markdown', \ 'text', \ 'gitcommit', \ 'scratch' \]
and when I type some stuff in a text file to trigger the omnicompletion popup, hitting enter fails to insert the selected item from the popup. When i removed the plugin the problem went away.
Maybe changing this line:
call s:add_local_mapping('inoremap', '<cr>', '<C-]><C-R>=<SID>insert_new_bullet()<cr>')
...to this (untested) could fix it?:
call s:add_local_mapping('inoremap', '<cr>', 'pumvisible() ? "<cr>" : "<C-]><C-R>=<SID>insert_new_bullet()<cr>"')
from bullets.vim.
@FocusedWolf I don't think this will work in the first scenario in my gif above. Can you produce a minimal .vimrc that I can use to reproduce the issue and come up with a better solution?
Example minimal vimrc
syntax on
call plug#begin('~/.vim/bundle')
Plug 'dkarter/bullets.vim'
Plug 'some-other/plugin'
call plug#end()
Save it to a file and then nvim -u .debug-vimrc test.md
to make sure you can still generate the error.
from bullets.vim.
I am having the same issue. The issue is that both Coc and Bullets.vim use <CR>
in insert mode.
call plug#begin(stdpath('data') . '/plugged')
Plug 'neoclide/coc.nvim',
Plug 'dkarter/bullets.vim',
call plug#end()
filetype plugin indent on
syntax enable
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
As @FocusedWolf commented, I can see a pumvisible check like call s:add_local_mapping('inoremap', '<cr>', 'pumvisible() ? "<cr>" : "<C-]><C-R>=<SID>insert_new_bullet()<cr>"')
to work , though I could not get this exact code to work.
Changing this behavior completely may not be preferred for everyone, but I would appreciate if you could set up a parameter to enable the pumvisible check. If that's not possible, a param to disable only the <CR>
mapping would be pretty helpful.
Thank you.
from bullets.vim.
Related Issues (20)
- [Feature Request] Add support for O to insert a new bullet item on the line above the cursor HOT 2
- SelectBullet command doesn't actually exist?
- [Feature Request] Add support for changing bullet types with a key-combination
- Bullet align doesn't work for `o` HOT 5
- Bullet type does not update if incrementing/decrementing with insert-mode <C-t>/<C-d> HOT 2
- Numbered Lists not Working HOT 2
- Auto Indent List after Colon HOT 1
- Still that wrap indent problem HOT 1
- Markdown output HOT 2
- Looking for help with Bullets.vim HOT 2
- [Feature Request]: Improve customization of the key mapping HOT 2
- Number wrapping stops working with mixed lists
- Multilevel numbered lists
- [Bug] Breaks repetition of >> by . HOT 1
- [FR] How to create a new or toggle a list
- [Feature Request] Add bullet on line split
- RestructuredText support is missing HOT 3
- Command for (temporarily?) disabling bullet insertion or whole plugin
- Zero padding to lists
- [Bug] Disabling default mappings not working Neovim HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bullets.vim.