Vim tab auto-complete
https://news.ycombinator.com/item?id=137301Hey, for the vimmers out there, this is such a great customization that I thought I'd pass it along for anyone who is interested. Add the following to your vimrc and you can use tab to auto-complete words while still preserving it as a tab insert where most appropriate (whenever your cursor is not over a word).
Anyone care to share their favorite vim tips?
function InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunctioninoremap <tab> <c-r>=InsertTabWrapper()<CR>