Skip to content

Commit

Permalink
🐞fix: vsnip mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
utubo committed Nov 8, 2023
1 parent 7123652 commit 1be8706
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ g:textobj_multiblock_blocks = [
call textobj#user#plugin('nonwhitespace', {
'-': { 'pattern': '\S\+', 'select': ['a<Space>', 'i<Space>'], }
})
CmdEach inoremap,snoremap <expr> JJ vsnip#expandable() ? '<Plug>(vsnip-expand)' : 'JJ'
CmdEach inoremap,snoremap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
CmdEach imap,smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : pumvisible() ? '<C-n>' : '<Tab>'
CmdEach imap,smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : pumvisible() ? '<C-p>' : '<S-Tab>'
def J(a: string, b: list<string>, c: list<string>)
exe printf("asyncomplete#register_source(asyncomplete#sources#%s#get_source_options({ name: '%s', whitelist: %s, blacklist: %s, completor: asyncomplete#sources#%s#completor }))", a, a, b, c, a)
enddef
Expand All @@ -436,8 +436,6 @@ nn <Space>% <ScriptCmd>call hlpairs#ReturnCursor()<CR>
Each w,b,e,ge nnoremap {} <Plug>(smartword-{})
nn [c <Plug>(GitGutterPrevHunk)
nn ]c <Plug>(GitGutterNextHunk)
CmdEach imap,smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : pumvisible() ? '<C-n>' : '<Tab>'
CmdEach imap,smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : pumvisible() ? '<C-p>' : '<S-Tab>'
CmdEach nnoremap,xnoremap <Space>c <Plug>(caw:hatpos:toggle)
nn <Space>t <ScriptCmd>tabpopupmenu#popup()<CR>
nn <Space>T <ScriptCmd>tablist#Show()<CR>
Expand Down
6 changes: 2 additions & 4 deletions src/.vimrc.src.vim
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ call textobj#user#plugin('nonwhitespace', {
#}}}

# 補完 {{{
CmdEach inoremap,snoremap <expr> JJ vsnip#expandable() ? '<Plug>(vsnip-expand)' : 'JJ'
CmdEach inoremap,snoremap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
CmdEach imap,smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : pumvisible() ? '<C-n>' : '<Tab>'
CmdEach imap,smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : pumvisible() ? '<C-p>' : '<S-Tab>'
def RegisterAsyncompSource(name: string, white: list<string>, black: list<string>)
execute printf("asyncomplete#register_source(asyncomplete#sources#%s#get_source_options({ name: '%s', whitelist: %s, blacklist: %s, completor: asyncomplete#sources#%s#completor }))", name, name, white, black, name)
enddef
Expand All @@ -550,8 +550,6 @@ nnoremap <Space>% <ScriptCmd>call hlpairs#ReturnCursor()<CR>
Each w,b,e,ge nnoremap {} <Plug>(smartword-{})
nnoremap [c <Plug>(GitGutterPrevHunk)
nnoremap ]c <Plug>(GitGutterNextHunk)
CmdEach imap,smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : pumvisible() ? '<C-n>' : '<Tab>'
CmdEach imap,smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : pumvisible() ? '<C-p>' : '<S-Tab>'
CmdEach nnoremap,xnoremap <Space>c <Plug>(caw:hatpos:toggle)
# 🐶🍚
nnoremap <Space>t <ScriptCmd>tabpopupmenu#popup()<CR>
Expand Down

0 comments on commit 1be8706

Please sign in to comment.