Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Created November 25, 2014 15:03
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 seyDoggy/904b214307da90bd8312 to your computer and use it in GitHub Desktop.
Save seyDoggy/904b214307da90bd8312 to your computer and use it in GitHub Desktop.
My ternary operator for mapping the tab key to the appropriate plugin.
" <tab> mapping
imap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#isExpandable() ? emmet#expandAbbrIntelligent("\<tab>") :
\ pumvisible() ? "\<C-n>" :
\ "\<TAB>"
smap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#isExpandable() ? emmet#expandAbbrIntelligent("\<tab>") :
\ "\<TAB>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment