Skip to content

Instantly share code, notes, and snippets.

@daqing
Created February 14, 2009 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daqing/64409 to your computer and use it in GitHub Desktop.
Save daqing/64409 to your computer and use it in GitHub Desktop.
" clever tab completion
function! CleverTab()
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-N>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment