Closed danielrehsmann closed 1 week ago
inoremap gk, and
That does not look like a mapping that could do anything useful. Something might be off with your formating.
If you want to close the pum before doing something else in your mapping, see :h i_CTRL-y
.
I edited the command accordingly. Basically i just want to navigate also in long lines that are wrapped graphically.
Basically, the Ycm configuration file was capturing the imaps: I had to comment out the following two lines of code in the ycm configuration file, /.local/share/nvim/plugged/YouCompleteMe/autoload/youcomplemete.vim
for key in g:ycm_key_list_select_completion
exe 'inoremap <expr>' . key . ' pumvisible() ? "\<C-n>" : "\' . key .'"'
endfor
for key in g:ycm_key_list_previous_completion
exe 'inoremap <expr>' . key . ' pumvisible() ? "\<C-p>" : "\' . key .'"'
endfor
you can check if ycm captures your keymaps with
verbose imap <up>
to locate the file.
Then I added the following two lines to my init.vim:
inoremap <expr> <up> pumvisible() ? '<c-p>' : '<c-\><c-o>gk'
inoremap <expr> <down> pumvisible() ? '<c-n>' : '<c-\><c-o>gj'
Issue Prelude
Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.
Issue Details
Normally I handle long lines with inoremap gk
inoremap gj
however, the keymaps set by the plugin persists, and :imap
gives i * pumvisible( ) ? "\" : "\"
which checks if the dropdown menu is open. Is there a way to remap the arrow keys in a way that includes long-line handling?