" 別ファイルに置いてた設定たち " .config/nvim/plugins/airline.vim {{{ " let g:airline_theme = 'gruvbox' " let g:airline_theme = 'dracula' let g:airline_theme = 'sol' let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#show_tabs = 0 let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#buffer_idx_format = { \ '0': '0:', \ '1': '1:', \ '2': '2:', \ '3': '3:', \ '4': '4:', \ '5': '5:', \ '6': '6:', \ '7': '7:', \ '8': '8:', \ '9': '9:' \} nmap sp AirlineSelectPrevTab nmap sn AirlineSelectNextTab " 謎のエラーが出る " nmap s "AirlineSelectTab" . v:count nmap 1s AirlineSelectTab1 nmap 2s AirlineSelectTab2 nmap 3s AirlineSelectTab3 nmap 4s AirlineSelectTab4 nmap 5s AirlineSelectTab5 nmap 6s AirlineSelectTab6 nmap 7s AirlineSelectTab7 nmap 8s AirlineSelectTab8 nmap 9s AirlineSelectTab9 " let g:airline#extensions#whitespace#mixed_indent_algo = 1 " let g:airline#extensions#tabline#buffer_nr_show = 1 " }}} " .config/nvim/plugins/coc-settings.vim {{{ nmap gd (coc-definition) nmap gi (coc-implementation) nmap gy (coc-type-definition) nmap gr (coc-references) nmap r (coc-rename) nmap K :call CocAction('doHover') " nmap p :CocList -A --normal yank nmap j :call CocAction('diagnosticNext') nmap k :call CocAction('diagnosticPrevious') inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction let g:airline_section_error = '%{airline#util#wrap(airline#extensions#coc#get_error(),0)}' let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' " let g:LanguageClient_serverCommands = { "\ 'julia': ['/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia']} augroup rc_coc autocmd! autocmd Filetype java nnoremap i :CocCommand java.action.organizeImports augroup END " Use for jump to next placeholder, it's default of coc.nvim let g:coc_snippet_next = '' " Use for jump to previous placeholder, it's default of coc.nvim let g:coc_snippet_prev = '' imap (coc-snippets-expand) " }}} " .config/nvim/plugins/de_file_xpl.vim {{{ " もし作成してなかったら ~/.defxsessions を作成する " そして defx を開く際にセッションファイルを指定する " let g:defx_sessions_file = $HOME . '/.defxsessions' let g:defx_ignored_files = '.git,__pycache__,.mypy_cache' " floating window の設定 let s:denite_win_width_percent = 0.7 let s:denite_win_height_percent = 0.7 " Change denite default options function! ResizeDefxFloatingWindow() call defx#custom#option('_', { \ 'split': 'floating', \ 'winwidth': float2nr(&columns * s:denite_win_width_percent), \ 'wincol': float2nr((&columns - (&columns * s:denite_win_width_percent)) / 2), \ 'winheight': float2nr(&lines * s:denite_win_height_percent), \ 'winrow': float2nr((&lines - (&lines * s:denite_win_height_percent)) / 2), \ }) endfunction call ResizeDefxFloatingWindow() call defx#custom#column('filename', { \ 'min_width': float2nr(&columns * s:denite_win_width_percent - 30), \ 'max_width': float2nr(&columns * s:denite_win_width_percent - 30), \ }) nnoremap sz ":Defx " . "-columns=git:indent:icons:filename " \ . "-buffer-name=leftw " \ . "-session-file=" . g:defx_sessions_file . " " \ . "-ignored-files=" . g:defx_ignored_files . " " \ . "-resume " \ . "-toggle -split=vertical -winwidth=30 -direction=topleft" nnoremap sf ":Defx " . "-columns=git:indent:icons:filename:type:size:time " \ . "-buffer-name=float " \ . "-session-file=" . g:defx_sessions_file . " " \ . "-ignored-files=" . g:defx_ignored_files . " " \ . "-resume " \ . "-toggle " if getftype(g:defx_sessions_file) != "file" call writefile(["{}"], g:defx_sessions_file) echo "Created .defxsessions file to home directory." endif augroup rc_defx autocmd! autocmd FileType defx call s:defx_my_settings() autocmd FileType defx set nonumber autocmd FileType defx set signcolumn=no augroup END function! s:defx_my_settings() abort let bufkind = strpart(bufname(""), 7, 5) if (bufkind == "float") nnoremap \ defx#is_directory()? defx#do_action('drop') : \ defx#do_action('multi', ['drop', 'quit']) nnoremap l \ defx#is_directory()? defx#do_action('drop') : \ defx#do_action('multi', ['drop', 'quit']) else nnoremap \ defx#do_action('drop') nnoremap l \ defx#do_action('drop') endif " Define mappings nnoremap cc \ defx#do_action('copy') nnoremap m \ defx#do_action('move') nnoremap p \ defx#do_action('paste') nnoremap t \ defx#do_action('open_or_close_tree') nnoremap T \ defx#do_action('open_tree_recursive') nnoremap w \ defx#do_action('add_session') nnoremap E \ defx#do_action('open', 'vsplit') nnoremap P \ defx#do_action('open', 'pedit') nnoremap K \ defx#do_action('new_directory') nnoremap o \ defx#do_action('new_file') nnoremap M \ defx#do_action('new_multiple_files') nnoremap C \ defx#do_action('toggle_columns', \ 'mark:filename:type:size:time') nnoremap S \ defx#do_action('toggle_sort', 'time') nnoremap dd \ defx#do_action('remove') nnoremap r \ defx#do_action('rename') nnoremap ! \ defx#do_action('execute_command') nnoremap x \ defx#do_action('execute_system') nnoremap yy \ defx#do_action('yank_path') nnoremap . \ defx#do_action('toggle_ignored_files') nnoremap ; \ defx#do_action('repeat') nnoremap h \ defx#do_action('cd', ['..']) nnoremap ~ \ defx#do_action('cd') nnoremap q \ defx#do_action('quit') nnoremap \ defx#do_action('toggle_select') . 'j' nnoremap * \ defx#do_action('toggle_select_all') nnoremap j \ line('.') == line('$') ? 'gg' : 'j' nnoremap k \ line('.') == 1 ? 'G' : 'k' nnoremap \ defx#do_action('redraw') nnoremap \ defx#do_action('print') nnoremap cd \ defx#do_action('change_vim_cwd') nnoremap f :DefxLineSearch nnoremap F :DefxLineBackSearch endfunction call defx#custom#column('mark', { \ 'readonly_icon': '✗', \ 'selected_icon': '✓', \ }) command! -nargs=1 DefxLineSearch let @m=escape(, '/\') | call search('\v^✹?\s*\S (\*|\|){1,2}\V\zs'. @m) command! -nargs=1 DefxLineBackSearch let @m=escape(, '/\') | call search('\v^✹?\s*\S (\*|\|){1,2}\V\zs'. @m, 'b') " }}} " .config/nvim/plugins/dein-firenvim.vim {{{ " vim:fdm=marker: " Required: " set runtimepath+=$HOME/.cache/dein/repos/github.com/Shougo/dein.vim " https://qiita.com/kawaz/items/ee725f6214f91337b42b " dein自体の自動インストール let s:cache_home = empty($XDG_CACHE_HOME) ? expand('~/.cache') : $XDG_CACHE_HOME let s:dein_dir = s:cache_home . '/dein' let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim' if !isdirectory(s:dein_repo_dir) call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir)) endif let &runtimepath = s:dein_repo_dir .",". &runtimepath " プラグイン読み込み&キャッシュ作成 " Required: if dein#load_state('$HOME/.cache/dein') call dein#begin('$HOME/.cache/dein') " disable plugins call dein#disable('vim-airline/vim-airline') call dein#disable('vim-airline/vim-airline-themes') call dein#disable('monaqa/smooth-scroll') call dein#disable('thinca/vim-splash') call dein#disable('gruvbox-community/gruvbox') call dein#disable('rhysd/rust-doc.vim') call dein#disable('thinca/vim-quickrun') call dein#disable('Shougo/vimproc.vim') call dein#disable('previm/previm') call dein#disable('lambdalisue/gina.vim') call dein#disable('xolox/vim-session') call dein#disable('xolox/vim-misc') call dein#disable('tpope/vim-rhubarb') call dein#disable('syusui-s/scrapbox-vim') call dein#disable('wsdjeg/dein-ui.vim') call dein#disable('raghur/vim-ghost') " Let dein manage dein " Required: call dein#add('$HOME/.cache/dein/repos/github.com/Shougo/dein.vim') " firenvim " call dein#add('glacambre/firenvim', "\ { "\ 'hook_post_update': { _ -> firenvim#install(0) }, "\ 'hook_add': 'source ~/.config/nvim/plugins/firenvim.vim', "\ 'merged': 0 "\ }) " プラグインリストを収めた TOML ファイル " 予め TOML ファイル(後述)を用意しておく let g:rc_dir = expand('~/.config/nvim/plugins/rc') let s:toml = g:rc_dir . '/dein.toml' let s:lazy_toml = g:rc_dir . '/dein_lazy.toml' " TOML を読み込み、キャッシュしておく call dein#load_toml(s:toml, {'lazy': 0}) call dein#load_toml(s:lazy_toml, {'lazy': 1}) " Required: call dein#end() call dein#save_state() endif " Required だけど init.vim でやってるから別にいい " filetype plugin indent on " syntax enable " If you want to install not installed plugins on startup. if dein#check_install() call dein#install() endif " }}} " .config/nvim/plugins/dein.vim {{{ " Required: " set runtimepath+=$HOME/.cache/dein/repos/github.com/Shougo/dein.vim " https://qiita.com/kawaz/items/ee725f6214f91337b42b " dein自体の自動インストール let s:cache_home = empty($XDG_CACHE_HOME) ? expand('~/.cache') : $XDG_CACHE_HOME let s:dein_dir = s:cache_home . '/dein' let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim' if !isdirectory(s:dein_repo_dir) call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir)) endif let &runtimepath = s:dein_repo_dir .",". &runtimepath " プラグイン読み込み&キャッシュ作成 " Required: if dein#load_state('$HOME/.cache/dein') call dein#begin('$HOME/.cache/dein') " Let dein manage dein " Required: call dein#add('$HOME/.cache/dein/repos/github.com/Shougo/dein.vim') " プラグインリストを収めた TOML ファイル " 予め TOML ファイル(後述)を用意しておく let g:rc_dir = expand('~/.config/nvim/plugins/rc') let s:toml = g:rc_dir . '/dein.toml' let s:lazy_toml = g:rc_dir . '/dein_lazy.toml' " TOML を読み込み、キャッシュしておく call dein#load_toml(s:toml, {'lazy': 0}) call dein#load_toml(s:lazy_toml, {'lazy': 1}) " Required: call dein#end() call dein#save_state() endif " Required だけど init.vim でやってるから別にいい " filetype plugin indent on " syntax enable " If you want to install not installed plugins on startup. if dein#check_install() call dein#install() endif " }}} " .config/nvim/plugins/denite.vim {{{ nnoremap sb :Denite buffer -sorters=sorter/word nnoremap sg :Denite grep -buffer-name=search-buffer-denite nnoremap sG :Denite -resume -buffer-name=search-buffer-denite nnoremap s] :Denite -resume -buffer-name=search-buffer-denite -select=+1 -immediately nnoremap s[ :Denite -resume -buffer-name=search-buffer-denite -select=-1 -immediately nnoremap so :Denite file/rec -buffer-name=search-file-denite nnoremap sO :Denite file/rec -resume -buffer-name=search-file-denite autocmd FileType rust nnoremap d :Denite rust/doc " floating window の設定 let s:denite_win_width_percent = 0.85 let s:denite_win_height_percent = 0.7 function! ResizeDeniteFloatingWindow() call denite#custom#option('_', { \ 'split': 'floating', \ 'winwidth': float2nr(&columns * s:denite_win_width_percent), \ 'wincol': float2nr((&columns - (&columns * s:denite_win_width_percent)) / 2), \ 'winheight': float2nr(&lines * s:denite_win_height_percent), \ 'winrow': float2nr((&lines - (&lines * s:denite_win_height_percent)) / 2), \ 'prompt': "❯" \ }) endfunction call ResizeDeniteFloatingWindow() let s:ignore_globs = [ '.git/', '.ropeproject/', '__pycache__/', \ 'venv/', 'images/', '*.min.*', 'img/', 'fonts/', \ '*.aux', '*.bbl', '*.blg', '*.dvi', '*.fdb_latexmk', '*.fls', '*.synctex.gz', '*.toc', \ '*.out', '*.snm', '*.nav', \ '*.pdf', '*.eps', '*.svg', \ '*.png', '*.jpg', '*.jpeg', '*.bmp', \ 'searchindex.js', \ '*.ipynb', \ ] " そもそも ag のレベルで検索対象からはずす call denite#custom#var('file/rec', 'command', [ \ 'pt', \ '--follow', \ ] + map(deepcopy(s:ignore_globs), { k, v -> '--ignore=' . v }) + [ \ '--nocolor', \ '--nogroup', \ '--hidden', \ '-g', \ '' \ ]) " call denite#custom#var('buffer', 'exclude_unlisted', '0') call denite#custom#var('grep', 'command', ['pt']) call denite#custom#var('grep', 'default_opts', \ ['-i', '--nogroup', '--nocolor', '--smart-case', '--hidden']) call denite#custom#var('grep', 'recursive_opts', []) call denite#custom#var('grep', 'pattern_opt', []) call denite#custom#var('grep', 'separator', ['--']) call denite#custom#var('grep', 'final_opts', []) " matcher/ignore_globs 以外のお好みの matcher を指定する call denite#custom#source('file/rec', 'matchers', ['matcher/substring']) " 他のソース向けに ignore_globs 自体は初期化 call denite#custom#filter('matcher/ignore_globs', 'ignore_globs', s:ignore_globs) call denite#custom#source('grep', \ 'matchers', ['converter/abbr_word', 'matcher_fuzzy', 'matcher/ignore_globs'], \ ) call denite#custom#source('file/rec', \ 'matchers', ['matcher_fuzzy', 'matcher/ignore_globs']) call denite#custom#var('buffer', 'date_format', '') call denite#custom#source('buffer', 'matchers', ['converter/abbr_word', 'matcher/substring']) augroup rc_denite autocmd! autocmd FileType denite call s:denite_my_settings() augroup END function! s:denite_my_settings() abort nnoremap \ denite#do_map('do_action') nnoremap d \ denite#do_map('do_action', 'delete') nnoremap p \ denite#do_map('do_action', 'preview') nnoremap q \ denite#do_map('quit') nnoremap i \ denite#do_map('open_filter_buffer') nnoremap t \ denite#do_map('toggle_select') nnoremap \ denite#do_map('toggle_select') . "j" nnoremap yy \ denite#do_map('do_action', 'yank') endfunction " }}} " .config/nvim/plugins/fern.vim {{{ let g:fern#disable_default_mappings = 1 let g:fern#default_hidden = 1 nnoremap sf :Fern . -drawer -toggle augroup rc_fern autocmd! autocmd FileType fern set nonumber autocmd FileType fern set signcolumn=no autocmd FileType fern set foldcolumn=0 autocmd FileType fern call s:fern_settings() augroup END function s:fern_settings() " move cwd, open file nmap l (fern-action-enter) nmap (fern-action-leave) nmap (fern-action-open) nmap e (fern-action-open) nmap (fern-action-leave) " expand/collapse tree nmap t (fern-action-expand) nmap T (fern-action-collapse) " move, remove, copy... nmap dd (fern-action-trash) endfunction " }}} " .config/nvim/plugins/firenvim.vim {{{ let g:firenvim_config = { \ 'globalSettings': { \ 'alt': 'all', \ }, \ 'localSettings': { \ '.*': { \ 'cmdline': 'neovim', \ 'priority': 0, \ 'selector': 'textarea', \ 'takeover': 'never', \ }, \ } \ } augroup Firenvim autocmd! autocmd BufEnter play.golang.org_*.txt set filetype=go autocmd BufEnter play.rust-lang.org_*.txt set filetype=rust autocmd BufEnter github.com_*.txt set filetype=markdown autocmd BufEnter localhost_notebooks*.txt set filetype=python autocmd BufEnter localhost_notebooks*.txt let b:coc_diagnostic_disable = 1 augroup END " }}} " .config/nvim/plugins/fugitive.vim {{{ nnoremap g :G let g:nremap = {'s': ''} augroup rc_fugitive autocmd! autocmd FileType fugitive call s:fugitive_my_settings() augroup END function! s:fugitive_my_settings() abort nmap u - endfunction " }}} " .config/nvim/plugins/gina.vim {{{ nnoremap g :Gina status -s --opener=split " }}} " .config/nvim/plugins/go.vim {{{ let g:go_fmt_autosave = 0 let g:go_fmt_command = "goimports" let g:go_fmt_fail_silently = 1 let g:go_highlight_types = 1 let g:go_doc_popup_window = 1 " let g:go_auto_type_info = 1 " let g:go_auto_sameids = 1 augroup rc_go autocmd! autocmd FileType go call s:go_my_settings() augroup END function! s:go_my_settings() abort noremap s] :cnext noremap s[ :cprev nmap b :call build_go_files() noremap r :GoRun noremap t :GoTest noremap f :GoTestFunc noremap g :GoFmt noremap i :GoImports nmap c (go-coverage-toggle):set list! " nnoremap d :Denite decls nnoremap d :GoDebugStart endfunction " run :GoBuild or :GoTestCompile based on the go file function! s:build_go_files() let l:file = expand('%') if l:file =~# '^\f\+_test\.go$' call go#test#Test(0, 1) elseif l:file =~# '^\f\+\.go$' call go#cmd#Build(0) endif endfunction " }}} " .config/nvim/plugins/lexima.vim {{{ call lexima#add_rule({'at': '\%#[-0-9a-zA-Z_]', 'char': '{', 'input': '{'}) call lexima#add_rule({'at': '\%#\\', 'char': '{', 'input': '{', 'filetype': ['latex', 'tex']}) call lexima#add_rule({'char': '$', 'input_after': '$', 'filetype': ['latex', 'tex']}) call lexima#add_rule({'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': ['latex', 'tex']}) call lexima#add_rule({'char': '', 'at': '\$\%#\$', 'delete': 1, 'filetype': ['latex', 'tex']}) " call lexima#add_rule({'char': '\{', 'input_after': '\}', 'filetype': ['latex', 'tex']}) " call lexima#add_rule({'char': '}', 'at': '\\\%#}', 'leave': 1, 'filetype': ['latex', 'tex']}) " call lexima#add_rule({'char': '', 'at': '\\\{\%#\\\}', 'input': '', 'filetype': ['latex', 'tex']}) call lexima#add_rule({'char': "'", 'input': "'", 'filetype': ['latex', 'tex', 'satysfi']}) " call lexima#add_rule({'input_after': '>', 'char': '<', 'filetype': ['satysfi']}) " call lexima#add_rule({'char': '<', 'at': '\\\%#', 'filetype': ['satysfi']}) " call lexima#add_rule({'char': '>', 'leave': 1, 'at': '\%#>', 'filetype': ['satysfi']}) " call lexima#add_rule({'char': '', 'at': '<\%#>', 'delete': 1, 'filetype': ['satysfi']}) call lexima#add_rule({'char': '``', 'input_after': '``', 'filetype': ['rst']}) " call lexima#add_rule({'char': "(", 'input_after': ")"}) " call lexima#add_rule({'char': ")", 'at': "\%#)", 'leave': 1}) " call lexima#add_rule({'char': '', 'at': '(\%#)', 'delete': 1}) " }}} " .config/nvim/plugins/quickrun.vim {{{ let g:quickrun_config = get(g:, 'quickrun_config', {}) let g:quickrun_config._ = { \ 'runner': 'vimproc', \ 'runner/vimproc/updatetime': 40, \ 'outputter': 'error', \ 'outputter/error/success': 'buffer', \ 'outputter/error/error': 'quickfix', \ 'hook/close_quickfix/enable_exit': 1 \ } let quickrun_config['jupytext'] = { \ 'command': 'jupytext', \ 'exec': '%c %o %a', \ 'cmdopt': '--update --to notebook', \ 'outputter/error/success': 'null', \ 'outputter/error/error': 'buffer', \ } let quickrun_config['satysfi'] = { \ 'command': 'satysfi', \ 'exec': '%c %a', \ 'outputter/error/success': 'null', \ 'outputter/error/error': 'buffer', \ } let quickrun_config['satysfi-debug'] = { \ 'command': 'satysfi', \ 'exec': '%c %a %o', \ 'cmdopt': '--debug-show-bbox --debug-show-space --debug-show-block-bbox --debug-show-block-space', \ 'outputter/error/success': 'null', \ 'outputter/error/error': 'buffer', \ } " example; :QuickRun rsync -args /Users/mogami/work/path-of-project remote:work/sync-mac let g:quickrun_config['rsync'] = { \ 'command': 'rsync', \ 'cmdopt': '-C --filter=":- .gitignore" --exclude ".git" -acvz --delete -e ssh', \ 'exec': '%c %o %a', \ 'outputter/error/success': 'null', \ } augroup rc_quickrun autocmd! autocmd BufRead,BufNewFile *.saty nnoremap q :QuickRun satysfi -args %{expand("%")} autocmd BufRead,BufNewFile *.saty nnoremap Q :QuickRun satysfi-debug -args %{expand("%")} autocmd FileType python nnoremap q :QuickRun jupytext -args %{expand("%")} augroup END " }}} " .config/nvim/plugins/sandwich.vim {{{ " 従来のキーマッピングを保存 nmap ds (operator-sandwich-delete)(operator-sandwich-release-count)(textobj-sandwich-query-a) nmap dsb (operator-sandwich-delete)(operator-sandwich-release-count)(textobj-sandwich-auto-a) nmap cs (operator-sandwich-replace)(operator-sandwich-release-count)(textobj-sandwich-query-a) nmap csb (operator-sandwich-replace)(operator-sandwich-release-count)(textobj-sandwich-auto-a) let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes) " runtime macros/sandwich/keymap/surround.vim " 開きカッコを指定したときの挙動を自分好みに let g:sandwich#recipes += [ \ {'buns': [' {', '} '], 'nesting': 1, 'match_syntax': 1, \ 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['{']}, \ \ {'buns': [' [', '] '], 'nesting': 1, 'match_syntax': 1, \ 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['[']}, \ \ {'buns': [' (', ') '], 'nesting': 1, 'match_syntax': 1, \ 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['(']}, \ \ {'buns': ['\s*{', '}\s*'], 'nesting': 1, 'regex': 1, \ 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], \ 'action': ['delete'], 'input': ['{']}, \ \ {'buns': ['\s*\[', '\]\s*'], 'nesting': 1, 'regex': 1, \ 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], \ 'action': ['delete'], 'input': ['[']}, \ \ {'buns': ['\s*(', ')\s*'], 'nesting': 1, 'regex': 1, \ 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], \ 'action': ['delete'], 'input': ['(']}, \ ] " 日本語のカッコ let g:sandwich#recipes += [ \ {'buns': ['(', ')'], 'nesting': 1, 'input': ['j(', 'j)', 'jp']}, \ {'buns': ['「', '」'], 'nesting': 1, 'input': ['j[', 'j]', 'jb']}, \ {'buns': ['『', '』'], 'nesting': 1, 'input': ['j{', 'j}', 'jB']}, \ {'buns': ['【', '】'], 'nesting': 1, 'input': ['j<', 'j>', 'jk']}, \ ] " Escaped parens let g:sandwich#recipes += [ \ {'buns': ['\{', '\}'], 'nesting': 1, 'input': ['\{', '\}']}, \ {'buns': ['\(', '\)'], 'nesting': 1, 'input': ['\(', '\)']}, \ {'buns': ['\[', '\]'], 'nesting': 1, 'input': ['\[', '\]']}, \ ] let g:sandwich#recipes += [ \ {'buns': ['`', ' <>`_'], 'nesting': 0, 'input': ['l'], 'filetype': ['rst']}, \ {'buns': ['` <', '>`_'], 'nesting': 0, 'input': ['L'], 'filetype': ['rst']}, \ ] " }}} " .config/nvim/plugins/vim-textobj-user.vim {{{ call textobj#user#plugin('line', { \ '-': { \ 'select-a-function': 'CurrentLineA', \ 'select-a': 'al', \ 'select-i-function': 'CurrentLineI', \ 'select-i': 'il', \ }, \ }) function! CurrentLineA() normal! 0 let head_pos = getpos('.') normal! $ let tail_pos = getpos('.') return ['v', head_pos, tail_pos] endfunction function! CurrentLineI() normal! ^ let head_pos = getpos('.') normal! g_ let tail_pos = getpos('.') let non_blank_char_exists_p = getline('.')[head_pos[2] - 1] !~# '\s' return \ non_blank_char_exists_p \ ? ['v', head_pos, tail_pos] \ : 0 endfunction call textobj#user#plugin('jbraces', { \ 'parens': { \ 'pattern': ['(', ')'], \ 'select-a': 'aj)', 'select-i': 'ij)' \ }, \ 'braces': { \ 'pattern': ['「', '」'], \ 'select-a': 'aj[', 'select-i': 'ij]' \ }, \ 'double-braces': { \ 'pattern': ['『', '』'], \ 'select-a': 'aj{', 'select-i': 'ij}' \ }, \ 'lenticular-bracket': { \ 'pattern': ['【', '】'], \ 'select-a': 'aj<', 'select-i': 'ij>' \ }, \}) augroup rc_textobj_user autocmd! autocmd filetype tex call textobj#user#plugin('texquote', { \ 'signle': { \ 'pattern': ['`', "'"], \ 'select-a': 'aq', 'select-i': 'iq' \ }, \ 'double': { \ 'pattern': ['``', "''"], \ 'select-a': 'aQ', 'select-i': 'iQ' \ }, \ }) augroup END " }}}