3 ms·
Vim tab auto-complete
Hey, 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
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<CR>
- graywh 19y agoI'm sure the best Vim users on HN could fill pages and pages with "favorite tips". Seems like I learn something new and/or cool about Vim every week.