Skip to content

Instantly share code, notes, and snippets.

@w0rp
Created July 13, 2017 13:09
Show Gist options
  • Save w0rp/d96a7f7eec7d17731c9c68f985beadc4 to your computer and use it in GitHub Desktop.
Save w0rp/d96a7f7eec7d17731c9c68f985beadc4 to your computer and use it in GitHub Desktop.
" Use Tab and Shift+Tab for either completion or SnipMate.
function! SmartTab() abort
if pumvisible()
return "\<C-n>"
endif
return snipMate#TriggerSnippet()
endfunction
function! SmartShiftTab() abort
if pumvisible()
return "\<C-p>"
endif
return snipMate#BackwardsSnippet()
endfunction
inoremap <silent> <Tab> <C-R>=SmartTab()<CR>
inoremap <silent> <S-Tab> <C-R>=SmartShiftTab()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment