Vim Ctrl-Space Omni & Keyword Completion
Ctrl-X Ctrl-O and even Ctrl-P are pretty awkward for me, so I use the following mapping:
" Ctrl-Space for completions. Heck Yeah!
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
This makes my fingers much happier.
Written by Ben Doerr
Related protips
2 Responses
SuperTab might be relevant to your interests http://www.vim.org/scripts/script.php?script_id=1643
over 1 year ago
·
Awesome, I'll take a look at it. Although <tab> for completion might be a bit for me to get used to. I come from a heavy IDE background so <C-Space> is where my muscle memory is at.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#