Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim auto complete

Tags:

vim

macvim

So I know you can get Vim autocompletion with Ctrl-X, Ctrl-O but I'm wondering if you could rework it so it works with just pressing Tab (more like Textmate's snippets), or even just how I could remap it to something a bit shorter (even if I can't get fancy tab completion), as I find Ctrl-X, Ctrl-O a bit awkward.

like image 905
Jack Franklin Avatar asked Jul 02 '11 16:07

Jack Franklin


3 Answers

I realize this question has been already answered, but you might be interested in a plugin such as SuperTab, which provides auto-completion and uses more than one type of auto-completion depending on the context and what type of completion you have been using.

like image 59
lyallcooper Avatar answered Dec 18 '22 15:12

lyallcooper


Map Tab to Ctrl-X,Ctrl-O

:imap <tab> <c-x><c-o> 

See this page from vim-wiki for a smarter Tab completion

like image 32
c00kiemon5ter Avatar answered Dec 18 '22 14:12

c00kiemon5ter


The latest version of VIM includes auto complete Go to insert mode at specified line Ctrl-i then Press Ctrl-n while in the insert mode.

like image 43
enthusiasticgeek Avatar answered Dec 18 '22 13:12

enthusiasticgeek