Skip to content

Instantly share code, notes, and snippets.

@agile
Created January 4, 2011 16:07
Show Gist options
  • Save agile/764968 to your computer and use it in GitHub Desktop.
Save agile/764968 to your computer and use it in GitHub Desktop.
drop this in ~/.vim/plugins and you can complete in insert mode using the tab key
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment