Last active
August 29, 2015 14:12
-
-
Save willopez/c39ee9547866e4e02b48 to your computer and use it in GitHub Desktop.
Vim Snippets expand trigger functon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Neoj() | |
if pumvisible() == 1 | |
return "\<C-n>" | |
else | |
call UltiSnips#JumpForwards() | |
if g:ulti_jump_forwards_res == 0 | |
return "\<C-j>" | |
endif | |
return "" | |
endif | |
endfunction | |
function! Neok() | |
if pumvisible() == 1 | |
return "\<C-p>" | |
else | |
call UltiSnips#JumpBackwards() | |
if g:ulti_jump_backwards_res == 0 | |
return "\<C-k>" | |
endif | |
return "" | |
endif | |
endfunction | |
let g:UltiSnipsJumpForwardTrigger = "<nop>" | |
let g:UltiSnipsJumpBackwardTrigger = "<nop>" | |
inoremap <silent> <C-j> <C-R>=Neoj()<CR> | |
snoremap <silent> <C-j> <Esc>:call UltiSnips#JumpForwards()<CR> | |
inoremap <silent> <C-k> <C-R>=Neok()<CR> | |
snoremap <silent> <C-k> <Esc>:call UltiSnips#JumpBackwards()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment