Created
June 30, 2021 12:02
-
-
Save mogita/07fcadf0e2d829312c8e976f9c25bc68 to your computer and use it in GitHub Desktop.
Vim Simple Auto Complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => Auto Complete | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Navigate the complete menu item like CTRL+n / CTRL+p would | |
inoremap <expr> <Down> pumvisible() ? "<C-n>" : "<Down>" | |
inoremap <expr> <Tab> pumvisible() ? "<C-n>" : "<Tab>" | |
inoremap <expr> <Up> pumvisible() ? "<C-p>" : "<Up>" | |
" Select the complete menu item like CTRL+y would | |
inoremap <expr> <CR> pumvisible() ? "<C-y>" : "<CR>" | |
" Cancel the complete menu item like CTRL+e would | |
inoremap <expr> <Left> pumvisible() ? "<C-e><Left>" : "<Left>" | |
inoremap <expr> <Right> pumvisible() ? "<C-e><Right>" : "<Right>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use the key mapping, install this plugin first:
https://github.com/vim-scripts/AutoComplPop