Skip to content

Instantly share code, notes, and snippets.

@thisfred
Created January 30, 2014 17:40
Show Gist options
  • Save thisfred/8714228 to your computer and use it in GitHub Desktop.
Save thisfred/8714228 to your computer and use it in GitHub Desktop.
set completeopt=longest
function! SuperCleverTab()
if strpart(getline('.'), 0, col('.') - 1) =~ '^\s*$'
return "\<tab>"
else
return "\<C-P>"
endif
endfunction
inoremap <Tab> <C-R>=SuperCleverTab()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment