Regenerate nvim config
This commit is contained in:
@ -0,0 +1,176 @@
|
||||
scriptencoding utf-8
|
||||
if !exists('s:local_recipes')
|
||||
let s:local_recipes = [
|
||||
\ {'__filetype__': 'tex', 'buns': ['“', '”'], 'nesting': 1, 'input': [ 'u"' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ['„', '“'], 'nesting': 1, 'input': [ 'U"', 'ug', 'u,' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ['«', '»'], 'nesting': 1, 'input': [ 'u<', 'uf' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ["`", "'"], 'nesting': 1, 'input': [ "l'", "l`" ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ["``", "''"], 'nesting': 1, 'input': [ 'l"' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ['"`', "\"'"], 'nesting': 1, 'input': [ 'L"' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': [",,", "``"], 'nesting': 1, 'input': [ 'l,' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ['<<', '>>'], 'nesting': 1, 'input': [ 'l<' ]},
|
||||
\ {'__filetype__': 'tex', 'buns': ['$', '$'], 'nesting': 0},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\(', '\)'], 'nesting': 1, 'input': [ '\(' ], 'indentkeys-': '{,},0{,0}'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\{', '\}'], 'nesting': 1, 'input': [ '\{' ], 'indentkeys-': '{,},0{,0}'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\[', '\]'], 'nesting': 1, 'input': [ '\[' ], 'indentkeys-': '{,},0{,0}'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\left(', '\right)'], 'nesting': 1, 'input': [ 'm(' ], 'action': ['add'], 'indentkeys-': '(,)'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\left[', '\right]'], 'nesting': 1, 'input': [ 'm[' ], 'action': ['add'], 'indentkeys-': '[,]'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\left|', '\right|'], 'nesting': 1, 'input': [ 'm|' ], 'action': ['add']},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\left\{', '\right\}'], 'nesting': 1, 'input': [ 'm{' ], 'action': ['add'], 'indentkeys-': '{,},0{,0}'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\left\langle ', '\right\rangle '], 'nesting': 1, 'input': [ 'm<' ], 'action': ['add']},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\bigl(', '\bigr)'], 'nesting': 1, 'input': [ 'M(' ], 'action': ['add'], 'indentkeys-': '(,)'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\bigl[', '\bigr]'], 'nesting': 1, 'input': [ 'M[' ], 'action': ['add'], 'indentkeys-': '[,]'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\bigl|', '\bigr|'], 'nesting': 1, 'input': [ 'M|' ], 'action': ['add']},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\bigl\{', '\bigr\}'], 'nesting': 1, 'input': [ 'M{' ], 'action': ['add'], 'indentkeys-': '{,},0{,0}'},
|
||||
\ {'__filetype__': 'tex', 'buns': ['\bigl\langle ', '\bigr\rangle '], 'nesting': 1, 'input': [ 'M<' ], 'action': ['add']},
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : ['\begingroup', '\endgroup'],
|
||||
\ 'nesting' : 1,
|
||||
\ 'input': ['gr', '\gr'],
|
||||
\ 'linewise': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : ['\toprule', '\bottomrule'],
|
||||
\ 'nesting' : 1,
|
||||
\ 'input': ['tr', '\tr', 'br', '\br'],
|
||||
\ 'linewise': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : 'sandwich#filetype#tex#CmdInput()',
|
||||
\ 'kind' : ['add', 'replace'],
|
||||
\ 'action' : ['add'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'nesting' : 1,
|
||||
\ 'input' : ['c'],
|
||||
\ 'indentkeys-' : '{,},0{,0}',
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : 'sandwich#filetype#tex#EnvInput()',
|
||||
\ 'kind' : ['add', 'replace'],
|
||||
\ 'action' : ['add'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'nesting' : 1,
|
||||
\ 'linewise' : 1,
|
||||
\ 'input' : ['e'],
|
||||
\ 'indentkeys-' : '{,},0{,0}',
|
||||
\ 'autoindent' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : ['\\\a\+\*\?{', '}'],
|
||||
\ 'kind' : ['delete', 'replace', 'auto', 'query'],
|
||||
\ 'regex' : 1,
|
||||
\ 'nesting' : 1,
|
||||
\ 'input' : ['c'],
|
||||
\ 'indentkeys-' : '{,},0{,0}',
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'buns' : ['\\begin{[^}]*}\%(\[.*\]\)\?', '\\end{[^}]*}'],
|
||||
\ 'kind' : ['delete', 'replace', 'auto', 'query'],
|
||||
\ 'regex' : 1,
|
||||
\ 'nesting' : 1,
|
||||
\ 'linewise' : 1,
|
||||
\ 'input' : ['e'],
|
||||
\ 'indentkeys-' : '{,},0{,0}',
|
||||
\ 'autoindent' : 0,
|
||||
\ },
|
||||
\ {
|
||||
\ '__filetype__': 'tex',
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-filetype-tex-marks-i)", "\<Plug>(textobj-sandwich-filetype-tex-marks-a)"],
|
||||
\ 'kind' : ['delete', 'replace', 'auto', 'query'],
|
||||
\ 'noremap' : 0,
|
||||
\ 'input' : ['ma'],
|
||||
\ 'indentkeys': '{,},0{,0}',
|
||||
\ 'autoindent': 0,
|
||||
\ },
|
||||
\ ]
|
||||
|
||||
xnoremap <silent><expr> <Plug>(textobj-sandwich-filetype-tex-marks-i) textobj#sandwich#auto('x', 'i', {'synchro': 0}, b:sandwich_tex_marks_recipes)
|
||||
xnoremap <silent><expr> <Plug>(textobj-sandwich-filetype-tex-marks-a) textobj#sandwich#auto('x', 'a', {'synchro': 0}, b:sandwich_tex_marks_recipes)
|
||||
let s:marks_recipes = []
|
||||
let s:marks_recipes += [
|
||||
\ {
|
||||
\ 'buns': ['\%([[(]\|\\{\)', '\%([])]\|\\}\)'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['|', '|'],
|
||||
\ 'nesting': 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?l|', '\m\C\\[Bb]igg\?r|'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\\%(langle\|lVert\|lvert\|lceil\|lfloor\)', '\m\C\\\%(rangle\|rVert\|rvert\|rceil\|rfloor\)'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\left\%([[(|.]\|\\{\|\\langle\|\\lVert\|\\lvert\|\\lceil\|\\lfloor\)', '\m\C\\right\%([])|.]\|\\}\|\\rangle\|\\rVert\|\\rvert\|\\rceil\|\\rfloor\)'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ ]
|
||||
" NOTE: It is not reasonable to set 'nesting' on when former and latter surrounds are same.
|
||||
let s:marks_recipes += [
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?|', '\m\C\\[Bb]igg\?|'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 0,
|
||||
\ },
|
||||
\ ]
|
||||
" NOTE: The existence of '\big.' makes the situation tricky.
|
||||
" Try to search those two cases independently and adopt the nearest item.
|
||||
" \big. foo \big)
|
||||
" \big( foo \big.
|
||||
" This roundabout enables the following:
|
||||
" \big( foo \big. bar \big. baz \big)
|
||||
" When the cursor is on;
|
||||
" foo -> \big( and \big.
|
||||
" bar -> nothing
|
||||
" foo -> \big. and \big)
|
||||
" were deleted by the input 'sdma'.
|
||||
let s:marks_recipes += [
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?l\?\%([[(]\|\\{\|\\langle\|\\lVert\|\\lvert\|\\lceil\|\\lfloor\)', '\m\C\\[Bb]igg\?r\?\%([]).]\|\\}\|\\rangle\|\\rVert\|\\rvert\|\\rceil\|\\rfloor\)'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?l\?\%([[(.]\|\\{\|\\langle\|\\lVert\|\\lvert\|\\lceil\|\\lfloor\)', '\m\C\\[Bb]igg\?r\?\%([])]\|\\}\|\\rangle\|\\rVert\|\\rvert\|\\rceil\|\\rfloor\)'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?|', '\m\C\\[Bb]igg\?.'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?.', '\m\C\\[Bb]igg\?|'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 0,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?l|', '\m\C\\[Bb]igg\?r[|.]'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ {
|
||||
\ 'buns': ['\m\C\\[Bb]igg\?l[|.]', '\m\C\\[Bb]igg\?r|'],
|
||||
\ 'regex': 1,
|
||||
\ 'nesting': 1,
|
||||
\ },
|
||||
\ ]
|
||||
endif
|
||||
call sandwich#util#insertlocal(s:local_recipes)
|
||||
let b:sandwich_tex_marks_recipes = deepcopy(s:marks_recipes)
|
||||
|
||||
@ -0,0 +1,200 @@
|
||||
let g:sandwich_no_default_key_mappings = 1
|
||||
let g:operator_sandwich_no_default_key_mappings = 1
|
||||
let g:textobj_sandwich_no_default_key_mappings = 1
|
||||
|
||||
nmap ys <Plug>(sandwich-add)
|
||||
onoremap <SID>line :normal! ^vg_<CR>
|
||||
nmap <silent> yss <Plug>(sandwich-add)<SID>line
|
||||
onoremap <SID>gul g_
|
||||
nmap <silent> yS <Plug>(sandwich-add)<SID>gul
|
||||
|
||||
nmap ds <Plug>(sandwich-delete)
|
||||
nmap dss <Plug>(sandwich-delete-auto)
|
||||
nmap cs <Plug>(sandwich-replace)
|
||||
nmap css <Plug>(sandwich-replace-auto)
|
||||
|
||||
xmap S <Plug>(sandwich-add)
|
||||
|
||||
runtime autoload/repeat.vim
|
||||
if hasmapto('<Plug>(RepeatDot)')
|
||||
nmap . <Plug>(operator-sandwich-predot)<Plug>(RepeatDot)
|
||||
else
|
||||
nmap . <Plug>(operator-sandwich-dot)
|
||||
endif
|
||||
|
||||
" Default recipes
|
||||
let g:sandwich#recipes = [
|
||||
\ {
|
||||
\ 'buns': ['\s\+', '\s\+'],
|
||||
\ 'regex': 1,
|
||||
\ 'kind': ['delete', 'replace', 'query'],
|
||||
\ 'input': [' ']
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['', ''],
|
||||
\ 'action': ['add'],
|
||||
\ 'motionwise': ['line'],
|
||||
\ 'linewise': 1,
|
||||
\ 'input': ["\<CR>"]
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['^$', '^$'],
|
||||
\ 'regex': 1,
|
||||
\ 'linewise': 1,
|
||||
\ 'input': ["\<CR>"]
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['<', '>'],
|
||||
\ 'expand_range': 0,
|
||||
\ 'input': ['>', 'a'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['`', '`'],
|
||||
\ 'quoteescape': 1,
|
||||
\ 'expand_range': 0,
|
||||
\ 'nesting': 0,
|
||||
\ 'linewise': 0,
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['"', '"'],
|
||||
\ 'quoteescape': 1,
|
||||
\ 'expand_range': 0,
|
||||
\ 'nesting': 0,
|
||||
\ 'linewise': 0,
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ["'", "'"],
|
||||
\ 'quoteescape': 1,
|
||||
\ 'expand_range': 0,
|
||||
\ 'nesting': 0,
|
||||
\ 'linewise': 0,
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['{', '}'],
|
||||
\ 'nesting': 1,
|
||||
\ 'skip_break': 1,
|
||||
\ 'input': ['{', '}', 'B'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['[', ']'],
|
||||
\ 'nesting': 1,
|
||||
\ 'input': ['[', ']', 'r'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['(', ')'],
|
||||
\ 'nesting': 1,
|
||||
\ 'input': ['(', ')', 'b'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#t#tag()',
|
||||
\ 'listexpr': 1,
|
||||
\ 'kind': ['add'],
|
||||
\ 'action': ['add'],
|
||||
\ 'input': ['t', 'T'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#t#tag()',
|
||||
\ 'listexpr': 1,
|
||||
\ 'kind': ['replace'],
|
||||
\ 'action': ['add'],
|
||||
\ 'input': ['T', '<'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#t#tagname()',
|
||||
\ 'listexpr': 1,
|
||||
\ 'kind': ['replace'],
|
||||
\ 'action': ['add'],
|
||||
\ 'input': ['t'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-tag-i)", "\<Plug>(textobj-sandwich-tag-a)"],
|
||||
\ 'noremap': 0,
|
||||
\ 'kind': ['delete', 'textobj'],
|
||||
\ 'expr_filter': ['operator#sandwich#kind() !=# "replace"'],
|
||||
\ 'linewise': 1,
|
||||
\ 'input': ['t', 'T', '<'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-tag-i)", "\<Plug>(textobj-sandwich-tag-a)"],
|
||||
\ 'noremap': 0,
|
||||
\ 'kind': ['replace', 'query'],
|
||||
\ 'expr_filter': ['operator#sandwich#kind() ==# "replace"'],
|
||||
\ 'input': ['T', '<'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-tagname-i)", "\<Plug>(textobj-sandwich-tagname-a)"],
|
||||
\ 'noremap': 0,
|
||||
\ 'kind': ['replace', 'textobj'],
|
||||
\ 'expr_filter': ['operator#sandwich#kind() ==# "replace"'],
|
||||
\ 'input': ['t'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': ['sandwich#magicchar#f#fname()', '")"'],
|
||||
\ 'kind': ['add', 'replace'],
|
||||
\ 'action': ['add'],
|
||||
\ 'expr': 1,
|
||||
\ 'input': ['f']
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-function-ip)", "\<Plug>(textobj-sandwich-function-i)"],
|
||||
\ 'noremap': 0,
|
||||
\ 'kind': ['delete', 'replace', 'query'],
|
||||
\ 'input': ['f']
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'external': ["\<Plug>(textobj-sandwich-function-ap)", "\<Plug>(textobj-sandwich-function-a)"],
|
||||
\ 'noremap': 0,
|
||||
\ 'kind': ['delete', 'replace', 'query'],
|
||||
\ 'input': ['F']
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#i#input("operator")',
|
||||
\ 'kind': ['add', 'replace'],
|
||||
\ 'action': ['add'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'input': ['i'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#i#input("textobj", 1)',
|
||||
\ 'kind': ['delete', 'replace', 'query'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'regex': 1,
|
||||
\ 'input': ['i'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#i#lastinput("operator", 1)',
|
||||
\ 'kind': ['add', 'replace'],
|
||||
\ 'action': ['add'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'input': ['I'],
|
||||
\ },
|
||||
\
|
||||
\ {
|
||||
\ 'buns': 'sandwich#magicchar#i#lastinput("textobj")',
|
||||
\ 'kind': ['delete', 'replace', 'query'],
|
||||
\ 'listexpr': 1,
|
||||
\ 'regex': 1,
|
||||
\ 'input': ['I'],
|
||||
\ },
|
||||
\ ]
|
||||
Reference in New Issue
Block a user