# based on http://qiita.com/kawaz/items/ee725f6214f91337b42b [[plugins]] repo = 'Shougo/dein.vim' merged = 0 hook_add = ''' " dein fixed setting in vimrc " if try branch, manual `git switch` needed " setting for dein " process let g:dein#install_max_processes = g:user.system.cpunum " coefficient if g:user.system.windows " windows x4 " io heavy & process heavy -> stay wait queue let g:dein#install_max_processes = g:dein#install_max_processes * 4 else " non windows x2 let g:dein#install_max_processes = g:dein#install_max_processes * 2 endif ''' hook_post_source = ''' " dein no depend trick(need vim-pass) if dein#is_sourced('vim-pass') function! s:dein_token_set() abort let g:dein#install_github_api_token = pass#get('Develop/Github') endfunction call timer_start(0, { -> s:dein_token_set() }) command! DeinUpdateStart call dein#check_update(v:true) else command! DeinUpdateStart call dein#update() endif ''' [plugins.ftplugin] toml = ''' " dein toml settings function! s:dein_toml_setting() abort let Filepath = g:V.import('System.Filepath') let fname = Filepath.realpath(expand("%:p")) " dein toml for toml in keys(g:dein.file.toml) + keys(g:dein.file.toml_nouse) let toml_fname = Filepath.realpath(Filepath.abspath(toml)) if fname ==? toml_fname call dein#toml#syntax() return endif endfor endfunction call s:dein_toml_setting() ''' # ToC # Core / Library # Terminal # Motion # Action # Filer # Utils # Command # Display # Colorscheme support # Quick Fix # Session # Folding # Split/Join # File Header ## textobj & operator # textobj # operator # Startup # Doc & File & Web # CtrlP # QuickRun # Git # Edit operation # Core & Util ## vital lig -> vital.toml ## denops lib and plugins -> denops.toml [[plugins]] repo = 'Shougo/vimproc.vim' merged = 0 hook_post_update = ''' if g:user.system.windows if !g:user.system.cygwin " let s:cmd = 'tools\\update-dll-mingw' let s:cmd = 'tools\\update-dll-msvc' else let s:cmd = 'make -f make_cygwin.mak' endif elseif g:user.function.executable('gmake') let s:cmd = 'gmake' else let s:cmd = 'make' endif let g:dein#plugin.build = s:cmd unlet s:cmd ''' [[plugins]] repo = 'prabirshrestha/async.vim' [[plugins]] repo = 'mattn/vimtweak' merged = 0 # 'vimtweak' depends windows only [[plugins]] repo = 'tsuyoshicho/transparency.vim' depends = ['vimtweak'] hook_add = ''' let g:transparency_config = { \ 'active' : 90, \ 'inactive' : 60 \ } let g:transparency_ctermbg_none = 1 ''' hook_post_source = ''' if get(g:, 'transparency_activate', 0) " nmap --- (TransparencyOn) " nmap --- (TransparencyOff) nmap (TransparencyToggle) endif ''' [[plugins]] repo = 'liuchengxu/vim-which-key' hook_add = ''' let g:which_key_fallback_to_native_key=1 " dynamic mapping function! s:whichkey_map(mapkey, data) abort if v:t_dict ==# type(a:data) if has_key(a:data, 'rawkey') let rawkey = a:data['rawkey'] if has_key(a:data, 'desc') let desc = a:data['desc'] call which_key#register(rawkey, desc) endif let cmdstr = printf('nnoremap %s :WhichKey "%s"', a:mapkey, escape(rawkey, '<>')) call execute(cmdstr) endif endif endfunction function! g:user.plugin.info.whichkey.enter() abort let self.laststatus = &laststatus let self.showmode = &showmode let self.ruler = &ruler " echomsg 'enter:' self " echomsg 'enter:' &laststatus &showmode &ruler set laststatus=0 set noshowmode set noruler autocmd BufLeave * :call g:user.plugin.info.whichkey.leave() endfunction function! g:user.plugin.info.whichkey.leave() abort let &laststatus = self.laststatus let &showmode = self.showmode let &ruler = self.ruler " echomsg 'leave:' self " echomsg 'leave:' &laststatus &showmode &ruler endfunction augroup vimrc_init_which_key autocmd! " mapping whitch key autocmd VimEnter * nested :call map(copy(g:user.plugin.info.whichkey.mapkey), { k, v -> s:whichkey_map(k, v) }) " set & unset opt " autocmd FileType which_key :call g:user.plugin.info.whichkey.enter() " not work yet TODO:fix augroup END ''' [[plugins]] repo = 'kana/vim-submode' hook_add = ''' " submode option " show submode " show lightline status let g:submode_always_show_submode = 0 " rel 'showmode' status " leave submode keytype not ignore let g:submode_keep_leaving_key = 1 " submode timeout? " let g:submode_timeout = 1 " rel 'timeout' status " submode timeout len let g:submode_timeoutlen = 1000 * 3 " 3sec (unit:msec) ''' hook_post_source = ''' " global and basic vim bind setting " undo/redo call submode#enter_with('undo/redo', 'n', '', 'g-', 'g-') call submode#enter_with('undo/redo', 'n', '', 'g+', 'g+') call submode#leave_with('undo/redo', 'n', '', '') call submode#map('undo/redo', 'n', '', '-', 'g-') call submode#map('undo/redo', 'n', '', 'p', 'g-') call submode#map('undo/redo', 'n', '', '+', 'g+') call submode#map('undo/redo', 'n', '', 'n', 'g+') " tab move call submode#enter_with('tabmove', 'n', '', 'gt', 'gt') call submode#enter_with('tabmove', 'n', '', 'gT', 'gT') call submode#enter_with('tabmove', 'n', '', '', ':tabmove -1') call submode#enter_with('tabmove', 'n', '', '', ':tabmove +1') call submode#map('tabmove', 'n', '', 't', 'gt') call submode#map('tabmove', 'n', '', 'n', 'gt') call submode#map('tabmove', 'n', '', 'T', 'gT') call submode#map('tabmove', 'n', '', 'p', 'gT') call submode#map('tabmove', 'n', '', '', ':tabmove -1') call submode#map('tabmove', 'n', '', 'k', ':tabmove -1') call submode#map('tabmove', 'n', '', '', ':tabmove +1') call submode#map('tabmove', 'n', '', 'j', ':tabmove +1') ''' # Terminal ############## # ref lambdalisue/guise.vim with denops # This plugin deprecated, without denops fallback [[plugins]] repo = 'lambdalisue/edita.vim' if = '!g:user.function.executable("deno")' merged = 0 [[plugins]] repo = 'tyru/empty-prompt.vim' depends = ['vital.vim'] hook_post_source = ''' " : works as : autocmd vimrc_init_core VimEnter * call empty_prompt#map(#{lhs: ':', rhs: ':'}) " works as N autocmd vimrc_init_core VimEnter * call empty_prompt#map(#{lhs: '', rhs: 'N'}) " works as w autocmd vimrc_init_core VimEnter * call empty_prompt#map(#{lhs: '', rhs: 'w'}) let s:prompt = {} let s:prompt['cmd'] = '>' let s:prompt['nix'] = '$' let s:starship = {} let s:starship_config = expand(g:user.dir.config_home . '/starship.toml') if filereadable(s:starship_config) let s:TOML = g:V.import('Text.TOML') try let s:starship = s:TOML.parse_file(s:starship_config) catch finally unlet s:TOML endtry endif if has_key(s:starship,'character') let s:pat = '^.*\zs.\ze\].*$' let s:prompt['starship_success'] = matchlist( \ get(s:starship.character, 'success_symbol', '❯]'), \ '^.*\zs.\ze\].*$' \)[0] let s:prompt['starship_error'] = matchlist( \ get(s:starship.character, 'error_symbol', '❯]'), \ '^.*\zs.\ze\].*$' \)[0] unlet s:pat endif let g:empty_prompt#pattern = '\(' . escape(join(values(s:prompt), '|'), '\|$') . '\)\s*$' let s:prompt_search_map = 'autocmd TerminalOpen * nested nnoremap ?\(' . escape(join(values(s:prompt), '|'), '\|$') . '\)n' augroup vimrc_init_empty_prompt autocmd! call execute(escape(s:prompt_search_map, '|')) augroup END unlet s:prompt s:starship s:starship_config s:prompt_search_map ''' [[plugins]] repo = 'tyru/sync-term-cwd.vim' hook_post_source = ''' " Setup " Add below to your .bashrc / .zshrc. " source (this repository)/macros/synctermcwd.sh " See vim help (:help synctermcwd) for more configuration. " " like editerm let $SYNCTERMCWD_SRC_PATH = expand(g:dein#plugin.rtp . '/macros/synctermcwd.sh') ''' [[plugins]] repo = 'rbtnn/vim-pterm' # [[plugins]] # repo = 'terryma/vim-multiple-cursors' # hook_add = ''' # let g:multi_cursor_use_default_mapping = 0 # # " Default mapping # let g:multi_cursor_start_word_key = '' # let g:multi_cursor_select_all_word_key = '' # let g:multi_cursor_start_key = 'g' # let g:multi_cursor_select_all_key = 'g' # let g:multi_cursor_next_key = 'm' # let g:multi_cursor_prev_key = 'm' # let g:multi_cursor_skip_key = '' # let g:multi_cursor_quit_key = 'g' # ''' [[plugins]] repo = 'KosukeMizuno/vim-cursorholdmark' # Motion ############## [[plugins]] repo = 'machakann/vim-swap' hook_add = ''' omap i,, (swap-textobject-i) xmap i,, (swap-textobject-i) omap a,, (swap-textobject-a) xmap a,, (swap-textobject-a) ''' # [[plugins]] # repo = 'yuttie/comfortable-motion.vim' # hook_add = ''' # " overwrite j/k motion # let g:comfortable_motion_scroll_down_key = "j" # let g:comfortable_motion_scroll_up_key = "k" # # " Friction & Air Resistance # " default # " let g:comfortable_motion_interval = 1000.0 / 60 # " let g:comfortable_motion_friction = 80.0 # " let g:comfortable_motion_air_drag = 2.0 # # " see https://liginc.co.jp/469142 # " let g:comfortable_motion_interval = 2400.0 / 60 # " let g:comfortable_motion_friction = 100.0 # " let g:comfortable_motion_air_drag = 3.0 # ''' # hook_post_source = ''' # noremap :call comfortable_motion#flick(40) # noremap :call comfortable_motion#flick(-40) # ''' [[plugins]] repo = 'thinca/vim-poslist' hook_post_source = ''' nmap (poslist-prev-pos) nmap (poslist-next-pos) ''' # Action ############## [[plugins]] repo = 'psliwka/vim-smoothie' [[plugins]] repo = 'rhysd/accelerated-jk' hook_post_source = ''' nmap j (accelerated_jk_gj) nmap k (accelerated_jk_gk) " nmap j (accelerated_jk_gj_position) " nmap k (accelerated_jk_gk_position) ''' # Filer ############## [[plugins]] repo = 'lambdalisue/fern.vim' # depends = ['memolist.vim', 'junkfile.vim'] hook_add = ''' " let g:fern#loglevel = g:fern#DEBUG ''' hook_post_source = ''' " thanks lambdalisue function! s:smart_path() abort if !empty(&buftype) || bufname('%') =~# '^[^:]\+://' return fnamemodify('.', ':p') endif return fnamemodify(expand('%'), ':p:h') endfunction " keymap info let g:user.plugin.info.whichkey.desc.leader['F'] = { \ 'name' : '+fern', \ } " conflict workaround : prefix F as Fern nnoremap Fb :Fern bookmark:/// nnoremap Fe :Fern =smart_path() -reveal=% nnoremap Ff :Fern . -drawer -toggle -reveal=% nnoremap Ft :Fern . -opener=tabedit -reveal=% if exists('g:memolist_path') nnoremap Fm :Fern =expand(g:memolist_path) -drawer -toggle -reveal=% endif if exists('g:junkfile#directory') nnoremap Fj :Fern =expand(g:junkfile#directory) -drawer -toggle -reveal=% endif ''' [plugins.ftplugin] fern = ''' " fern setup setlocal nonumber setlocal norelativenumber setlocal foldcolumn=0 setlocal signcolumn=yes " mapping " from https://github.com/kyoh86/dotfiles/blob/main/nvim/etc/fern.vim nmap ! (fern-action-hidden:toggle) nmap / (fern-action-include) nmap > (fern-action-expand:in) nmap < (fern-action-collapse) " from https://github.com/koutarn/dotfile/blob/b4f11451f1547cedab051ca547b2f1cc208e0a06/.vim/_config/117-fern.vim nmap E (fern-action-open:system) " nmap h (fern-action-collapse) " nmap l (fern-action-open-or-expand) " define autocmd for buffer " currently not work(side effect error) " autocmd BufEnter call feedkeys("\(fern-action-tcd:root)") ''' [[plugins]] # repo = 'lambdalisue/fern-renderer-devicons.vim' repo = 'lambdalisue/fern-renderer-nerdfont.vim' # depends = ['fern.vim', 'vim-devicons'] depends = ['fern.vim', 'nerdfont.vim'] hook_add = ''' " let g:fern#renderer = 'devicons' let g:fern#renderer = "nerdfont" ''' [[plugins]] repo = 'lambdalisue/fern-hijack.vim' depends = ['fern.vim'] [[plugins]] repo = 'yuki-yano/fern-preview.vim' depends = ['fern.vim'] [plugins.ftplugin] fern = ''' " fern setup " Map to your custom function. nmap (fern-action-preview:toggle) nmap (fern-action-preview:auto:toggle) nmap (fern-action-preview:scroll:down:half) nmap (fern-action-preview:scroll:up:half) nmap (fern-quit-or-close-preview) \ fern_preview#smart_preview("\(fern-action-preview:close)", ":q\") nmap q (fern-quit-or-close-preview) ''' [[plugins]] repo = 'lambdalisue/fern-comparator-lexical.vim' depends = ['fern.vim'] hook_add = ''' let g:fern#comparator = 'lexical' ''' [[plugins]] repo = 'lambdalisue/fern-bookmark.vim' depends = ['fern.vim'] hook_add = ''' let g:fern#scheme#bookmark#store#file = expand(g:user.dir.vim . '/bookmark.json') ''' [[plugins]] repo = 'hrsh7th/fern-mapping-call-function.vim' depends = ['fern.vim'] hook_post_source = ''' " Add your custom function to mapping. " function! s:fern_project_top(helper) abort " let l:node = a:helper.sync.get_current_node() " let l:proj = s:detect_project_root(l:node._path) " execute printf('Fern %s', fnameescape(l:proj)) " endfunction " :w " call fern#mapping#call_function#add('project_top', function('s:fern_project_top')) ''' [plugins.ftplugin] fern = ''' " fern setup " Map to your custom function. " nmap (fern-action-call-function:project_top) ''' [[plugins]] repo = 'hrsh7th/fern-mapping-collapse-or-leave.vim' depends = ['fern.vim'] hook_add = ''' let g:fern#mapping#collapse_or_leave#disable_default_mappings = 1 ''' [plugins.ftplugin] fern = ''' " fern setup nmap h \ (fern-action-collapse-or-leave) \ (fern-wait) \ (fern-action-tcd:root) ''' [[plugins]] repo = 'lambdalisue/fern-mapping-project-top.vim' depends = ['fern.vim'] [plugins.ftplugin] fern = ''' " fern setup nmap ^ (fern-action-project-top) ''' [[plugins]] repo = 'lambdalisue/fern-mapping-mark-children.vim' depends = ['fern.vim'] [[plugins]] repo = 'lambdalisue/fern-mapping-quickfix.vim' depends = ['fern.vim'] [[plugins]] repo = 'lambdalisue/fern-mapping-git.vim' depends = ['fern.vim'] [[plugins]] repo = 'lambdalisue/fern-git-status.vim' depends = ['fern.vim'] hook_add = ''' " Disable listing ignored files/directories let g:fern_git_status#disable_ignored = 1 " Disable listing untracked files let g:fern_git_status#disable_untracked = 1 " Disable listing status of submodules " let g:fern_git_status#disable_submodules = 1 " Disable listing status of directories " let g:fern_git_status#disable_directories = 1 ''' [[plugins]] repo = 'lambdalisue/vim-protocol' # repo = 'tsuyoshicho/vim-protocol' # rev = 'develop' # [[plugins]] # repo = 'justinmk/vim-dirvish' # hook_add = ''' # nmap (nomap-dirvish_up) (dirvish_up) # # " need git support for 0 # let g:dirvish_relative_paths = 1 # # augroup vimrc_init_dirvish # autocmd! # # " re-map only dirvish # autocmd FileType dirvish nmap # \ - (dirvish_up) # # " Map `t` to open in new tab. # autocmd FileType dirvish # \ nnoremap t :call dirvish#open('tabedit', 0) # \ |xnoremap t :call dirvish#open('tabedit', 0) # # " Map `gr` to reload. # autocmd FileType dirvish nnoremap # \ gr :Dirvish % # # " Map `gh` to hide dot-prefixed files. Press `R` to "toggle" (reload). # autocmd FileType dirvish nnoremap # \ gh :silent keeppatterns g@\v/\.[^\/]+/?$@d _:setl cole=3 # augroup END # ''' # hook_post_source = ''' # if has('gui_running') # call dirvish#add_icon_fn({p -> p[-1:]=='/'?'📂':'📄'}) # endif # ''' # Utils ############## [[plugins]] repo = 'rbtnn/vimconsole.vim' # depends = ['vim-prettyprint'] # non-depend, but if already exist; use PrettyPrint [[plugins]] repo = 'thinca/vim-editvar' # depends = ['vim-prettyprint'] # non-depend, but if already exist; use PrettyPrint [[plugins]] repo = 'lambdalisue/mr.vim' [[plugins]] repo = 'lambdalisue/mr-quickfix.vim' depends = ['vim-altercmd', 'mr.vim'] hook_post_source = ''' AlterCommand mru Mrucopen AlterCommand mru Mrucopen AlterCommand mrw Mrwcopen AlterCommand mrw Mrwcopen ''' [[plugins]] repo = 'Bakudankun/BackAndForward.vim' [[plugins]] repo = 'c000/rapidfire.vim' hook_add = ''' let g:rapidfire#persistent_filename = expand(g:user.dir.cache_home . '/rapidfire_commands.json') " need custom setting " like nnoremap :Rapidfire F12 ''' [[plugins]] repo = 'tsuyoshicho/vim-pass' # rev = 'develop' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['pass'] if g:user.system.windows if !g:user.system.cygwin " Windows native not MSYS(cygwin) work " need native gpg (not /usr/bin/gpg) let s:gpg_32 = exepath('C:\Program Files (x86)\GnuPG\bin\gpg.exe') let s:gpg_native = exepath('C:\Program Files\GnuPG\bin\gpg.exe') if executable(s:gpg_32) let g:pass_gpg_path = s:gpg_32 elseif executable(s:gpg_native) let g:pass_gpg_path = s:gpg_native endif endif endif ''' [[plugins]] repo = 'mattn/vim-findroot' depends = ['vital.vim'] hook_add = ''' let g:findroot_not_for_subdir = 0 ''' hook_post_source = ''' let s:List = g:V.import('Data.List') let g:findroot_patterns = s:List.concat([ \ s:List.map(g:user.rootmarker.dirs, { v -> v . '/' }), \ g:user.rootmarker.files, \ g:user.rootmarker.fileglob]) unlet s:List augroup vimrc_init_findroot autocmd! autocmd User StartifyBufferOpened :FindRoot! augroup END ''' # なくてもちゃんと動きそうなので置いておく # [[plugins]] # repo = 'airblade/vim-rooter' # depends = ['vim-findroot'] # hook_add = ''' # " manual support only # let g:rooter_manual_only = 1 # # " same as findroot # let g:rooter_use_lcd = 1 # " manual only echo OK # " let g:rooter_silent_chdir = 1 # let g:rooter_change_directory_for_non_project_files = 'current' # ''' # hook_post_source = ''' # let g:rooter_patterns = g:findroot_patterns # ''' [[plugins]] repo = 'thinca/vim-localrc' # related terminal vim in vim fixing plugin # ref lambdalisue/guise.vim with denops # ref lambdalisue/edita.vim without denops,deprecated [[plugins]] repo = 'thinca/vim-singleton' hook_source = ''' " non-lazyのため、中でチェック if has('clientserver') " non-lazyでsource処理時はロード済みを活用する " singleton完了待ちリスト " git editmsg,rebase todo,rebase-xxx PRed " hub PRed let g:singleton#entrust_pattern['git'] = \ add(g:singleton#entrust_pattern['git'], \ '/\.git/EDIT_DESCRIPTION$') " singleton除外リスト " let g:singleton#ignore_pattern " singleton機能を有効に call singleton#enable() " debug " echom 'singleton enable' .' '. 'group:'.g:singleton#group .' '. 'servername:'.v:servername endif ''' # Command ############## [[plugins]] repo = 'mattn/vim-sl' [[plugins]] repo = 'thinca/vim-ambicmd' hook_post_source = ''' cnoremap ambicmd#expand("\") cnoremap ambicmd#expand("\") ''' [[plugins]] # neovim or vim with yarp/rpc repo = 'gelguy/wilder.nvim' hook_post_update = ''' " yarp is lib,do not use pipx if g:user.system.windows && g:user.function.executable('pip') let g:dein#plugin.build = 'pip install --upgrade yarp' elseif g:user.function.executable('pip3') let g:dein#plugin.build = 'pip3 install --user --upgrade yarp' endif ''' hook_post_source = ''' " from Shougo's config https://github.com/Shougo/shougo-s-github/blob/3e4dea0e5c933a0b3d4f2f625d3f4aead727efbc/vim/rc/deinlazy.toml#L555-L585 " thanks Shougo & suggest ycino " enable silent! call wilder#enable_cmdline_enter() cnoremap wilder#in_context() ? wilder#next() : "\" cnoremap wilder#in_context() ? wilder#previous() : "\" " only / and ? are enabled by default call wilder#set_option('modes', ['/', '?', ':']) " : is conflicted to wildmenu option longest:full,full " When the cmdline is empty, provide suggestions based on the cmdline history call wilder#set_option('pipeline', [ \ wilder#branch( \ [ \ wilder#check({_, x -> empty(x)}), \ wilder#history(), \ ], \ wilder#cmdline_pipeline(), \ wilder#search_pipeline(), \ ), \]) " popupmenu completion call wilder#set_option('renderer', wilder#popupmenu_renderer({ \ 'highlighter': wilder#basic_highlighter(), \})) ''' # search [[plugins]] repo = 'osyo-manga/vim-over' depends = ['vim-search-pulse'] hook_add = ''' " currently search hl keep let g:over_enable_auto_nohlsearch = 0 " first item jump let g:over#command_line#search#enable_move_cursor = 1 let g:over_command_line_prompt = "Over> " let g:over#command_line#enable_Digraphs = 0 " vim-search-pulse cr re-map and re-map stop let g:over_command_line_key_mappings = { \ "\" : { \ "key" : "\", \ "noremap" : 1, \ } \} ''' hook_post_source = ''' augroup vimrc_init_over autocmd! " Pulses the first match after hitting the enter key autocmd User OverCmdLineExecute nested :call search_pulse#Pulse() augroup END nnoremap S :OverCommandLine ''' [[plugins]] repo = 'inside/vim-search-pulse' hook_add = ''' let g:vim_search_pulse_disable_auto_mappings = 1 ''' hook_post_source = ''' " color / termguicolors precheck need if has('gui_running') || (has('termguicolors') && (&termguicolors == 1)) let g:vim_search_pulse_color_list = ['#005f00', '#008700', '#00af00', '#00d700', '#00ff00'] else let g:vim_search_pulse_color_list = [22, 28, 34, 40, 46] endif " setup move to is.vim ''' [[plugins]] repo = 'lambdalisue/reword.vim' depends = ['vim-altercmd'] hook_post_source = ''' AlterCommand rewo[rd] Reword AlterCommand rewo[rd] Reword ''' [[plugins]] repo = 'haya14busa/vim-asterisk' hook_add = ''' let g:asterisk#keeppos = 1 ''' hook_post_source = ''' " setup move to is.vim ''' [[plugins]] repo = 'osyo-manga/vim-anzu' hook_post_source = ''' " setup move to is.vim " update status augroup vimrc_init_anzu autocmd! autocmd CursorMoved,WinEnter * AnzuUpdateSearchStatus augroup END ''' [[plugins]] # https://rcmdnk.com/blog/2017/11/12/computer-vim/ repo = 'haya14busa/is.vim' # repo = 'tsuyoshicho/is.vim' # rev = 'develop' depends = ['vim-asterisk', 'vim-anzu', 'vim-search-pulse'] hook_add = ''' let g:is#do_default_mappings = 0 ''' hook_post_source = ''' " keymap : auto " based on https://postd.cc/vim-galore-4/ " nを前方へ、Nを後方へと固定 " integraton anzu nmap n v:searchforward \ ? "\(is-nohl)\(anzu-n-with-echo)\Pulse" \ : "\(is-nohl)\(anzu-N-with-echo)\Pulse" nmap N v:searchforward \ ? "\(is-nohl)\(anzu-N-with-echo)\Pulse" \ : "\(is-nohl)\(anzu-n-with-echo)\Pulse" " integration asterisk " stay only nmap * (asterisk-z*)(is-nohl-1)Pulse xmap * (asterisk-z*)(is-nohl-1) omap * (asterisk-z*)(is-nohl-1) nmap g* (asterisk-gz*)(is-nohl-1)Pulse xmap g* (asterisk-gz*)(is-nohl-1) omap g* (asterisk-gz*)(is-nohl-1) nmap # (asterisk-z#)(is-nohl-1)Pulse xmap # (asterisk-z#)(is-nohl-1) omap # (asterisk-z#)(is-nohl-1) nmap g# (asterisk-gz#)(is-nohl-1)Pulse xmap g# (asterisk-gz#)(is-nohl-1) omap g# (asterisk-gz#)(is-nohl-1) augroup vimrc_init_is autocmd! " Pulses the first match after hitting the enter key autocmd User IncSearchExecute nested :call search_pulse#Pulse() augroup END " Pulses cursor line on first match " when doing search with / or ? cmap search_pulse#PulseFirst() " conflict vim-over / mapping tuning in vim-over ''' [[plugins]] # repo = 'tyru/vim-altercmd' repo = 'tsuyoshicho/vim-altercmd' rev = 'develop' # TODO : I send Fix PR. When merged it then to restore original # [[plugins]] # repo = 'c000/rapidfire.vim' # Display ############## [[plugins]] repo = 'cohama/vim-insert-linenr' [[plugins]] repo = 'machakann/vim-highlightedyank' [[plugins]] repo = 'paroxayte/vwm.vim' [[plugins]] repo = 'blueyed/vim-diminactive' hook_add = ''' " if need update " let g:diminactive_buftype_blacklist = ['nofile', 'nowrite', 'acwrite', 'quickfix', 'help'] " let g:diminactive_filetype_blacklist = ['startify'] " Whitelist, overriding blacklist. " let g:diminactive_buftype_whitelist = [] " let g:diminactive_filetype_whitelist = ['dirvish'] " work with focus let g:diminactive_enable_focus = 1 ''' [[plugins]] repo = 'kshenoy/vim-signature' hook_add = ''' ''' [[plugins]] repo = 'delphinus/vim-auto-cursorline' [[plugins]] repo = 'itchyny/vim-cursorword' # Colortheme Util ############## [[plugins]] # color edit repo = 'rbtnn/vim-coloredit' [[plugins]] # カラースキーマ sample generator repo = 'cocopon/colorswatch.vim' [[plugins]] # カラースキーマ inspect repo = 'cocopon/inspecthi.vim' [[plugins]] # カラースキーマ template engine repo = 'cocopon/pgmnt.vim' depends = ['inspecthi.vim'] [[plugins]] repo = 'lifepillar/vim-colortemplate' [[plugins]] repo = 'lambdalisue/vim-findent' hook_post_source = ''' augroup vimrc_init_findent autocmd! " autocmd FileType c Findent --no-messages autocmd FileType css Findent --no-messages autocmd FileType html Findent --no-messages autocmd FileType javascript Findent --no-messages " autocmd FileType markdown Findent --no-messages augroup END ''' [[plugins]] repo = 'rickhowe/diffchar.vim' hook_add = ''' " disable external diff let g:DiffExpr = 0 ''' [[plugins]] repo = 'will133/vim-dirdiff' # [[plugins]] # yank hist # repo = 'LeafCage/yankround.vim' # depends = ['ctrlp.vim', 'vital.vim'] # hook_add = ''' # let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) # \ + ['yankround'] # # let g:yankround_max_history = 40 " default 30 # let g:yankround_use_region_hl = 1 # # " auto create dir in plugin # let g:yankround_dir = expand(g:user.dir.cache_home . '/yankround') # call g:user.function.mkdir(expand(g:yankround_dir)) # ''' # hook_post_source = ''' # " keymap # nmap p (yankround-p) # xmap p (yankround-p) # nmap P (yankround-P) # nmap gp (yankround-gp) # xmap gp (yankround-gp) # nmap gP (yankround-gP) # # if get(g:, 'ctrlp_map', '') ==? '' # nmap yankround#is_active() ? "\(yankround-prev)" : "\(ctrlp)" # else # nmap (yankround-prev) # endif # nmap (yankround-next) # ''' [[plugins]] # yank hist repo = 'svermeulen/vim-yoink' hook_add = ''' let g:yoinkMaxItems = 20 ''' hook_post_source = ''' " keymap nmap p (YoinkPaste_p) nmap P (YoinkPaste_P) nmap [y (YoinkRotateBack) nmap ]y (YoinkRotateForward) if get(g:, 'ctrlp_map', '') ==? '' nmap yoink#canSwap() ? '(YoinkPostPasteSwapForward)' : '(ctrlp)' else nmap (YoinkPostPasteSwapForward) endif nmap (YoinkPostPasteSwapBack) nmap y (YoinkYankPreserveCursorPosition) xmap y (YoinkYankPreserveCursorPosition) ''' # [[plugins]] # repo = 'svermeulen/vim-cutlass' [[plugins]] repo = 'junegunn/vim-peekaboo' hook_add = ''' let g:peekaboo_window = 'botright vsplit new' " vert bo 30new | Command for creating Peekaboo window let g:peekaboo_delay = 0 " 0 (ms) | Delay opening of Peekaboo window let g:peekaboo_compact = 1 " 0 (boolean) | Compact display let g:peekaboo_prefix = '' " '' | Prefix for key mapping (e.g. ) let g:peekaboo_ins_prefix = '' " '' | Prefix for insert mode key mapping (e.g. ) ''' [[plugins]] repo = 'y0za/vim-reading-vimrc' # repo = 'tsuyoshicho/vim-reading-vimrc' # rev = 'develop' [[plugins]] repo = 'thinca/vim-showtime' # Quick Fix [[plugins]] repo = 'drmingdrmer/vim-toggle-quickfix' hook_post_source = ''' nmap window:quickfix:loop autocmd vimrc_init_core FileType qf nested nmap q window:quickfix:loop ''' # Session # 'tpope/vim-obsession' # 'dhruvasagar/vim-prosession' # 'gikmx/vim-ctrlposession' # Folding [[plugins]] # folding support repo = 'tyru/foldballoon.vim' hook_post_source = ''' " set global,default balloon expr / if specific use, override buffer local set ballooneval set balloonexpr=foldballoon#balloonexpr() ''' [[plugins]] # folding support repo = 'lambdalisue/vim-foldround' hook_post_source = ''' nmap zff (foldround-forward) nmap zfb (foldround-backward) ''' [[plugins]] # folding support repo = 'lambdalisue/readablefold.vim' hook_post_source = ''' autocmd vimrc_init_core FileType markdown nested setlocal foldtext=readablefold#foldtext() " generic folding setting start set foldcolumn=3 set foldlevel=2 " window local " set fillchars=vert:\| " highlight Folded gui=bold term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey29 guifg=Grey80 " highlight FoldColumn gui=bold term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue " generic folding setting end ''' # [[plugins]] # folding support # repo = 'LeafCage/foldCC.vim' # hook_post_source = ''' # " based on http://leafcage.hateblo.jp/entry/2013/04/24/053113 # let g:foldCCtext_enable_autofdc_adjuster = 1 # " add  nf-oct-unfold / f42d # let g:foldCCtext_head = 'nr2char(0xf42d)." ".v:folddashes." "' # # " need post_source for use defined function # set foldtext=FoldCCtext() # " overwrite markdown-ex foldtext function # autocmd vimrc_init_core FileType markdown nested setlocal foldtext=FoldCCtext() # # " generic folding setting start # set foldcolumn=3 # set foldlevel=2 # " window local # # " set fillchars=vert:\| # # " highlight Folded gui=bold term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey29 guifg=Grey80 # " highlight FoldColumn gui=bold term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue # # " generic folding setting end # ''' [[plugins]] # folding support repo = 'arecarn/vim-fold-cycle' # [[plugins]] # folding support # repo = 'pseewald/vim-anyfold' [[plugins]] repo = 'mattn/wwwrenderer-vim' depends = ['webapi-vim'] [[plugins]] repo = 'thinca/vim-prettyprint' hook_add = ''' let g:prettyprint_string = [ 'split', 'raw' ] let g:prettyprint_show_expression = 1 ''' [[plugins]] repo = 's417-lama/carbonpaper.vim' [[plugins]] repo = 'kristijanhusak/vim-carbon-now-sh' hook_post_source = ''' xnoremap :CarbonNowSh ''' [[plugins]] repo = 'vim-jp/autofmt' hook_add = ''' " based on https://github.com/vim-jp/vimdoc-ja-working/issues/54#issuecomment-395459077 " based on https://github.com/vim-jp/vimdoc-ja-working/wiki/Guide let g:autofmt_allow_over_tw=1 set formatexpr=autofmt#japanese#formatexpr() " formatoptions already configured in vimrc (after load vimrc work) " set formatoptions+=mM or mB " smartindent already enable (after load vimrc work) " set smartindent set colorcolumn=+1 " window local ''' [[plugins]] repo = 'mattn/emmet-vim' hook_add = ''' let g:user_emmet_mode = 'nv' " which key let g:user.plugin.info.whichkey.mapkey = extend(g:user.plugin.info.whichkey.mapkey, { \ '' : { 'rawkey' : "" }, \}) ''' [[plugins]] # repo = 'tpope/vim-repeat' repo = 'kana/vim-repeat' [[plugins]] repo = 'haya14busa/vim-metarepeat' hook_add = ''' let g:meterepeat#default_mapping = 0 ''' hook_post_source = ''' " default " map g. (metarepeat) " nmap go (metarepeat-preset-occurence) " apply nmap g. (metarepeat) xmap g. (metarepeat) nmap go (metarepeat-preset-occurence) ''' [[plugins]] repo = 'tpope/vim-unimpaired' depends = ['vim-repeat'] hook_add = ''' " keymap info let g:user.plugin.info.whichkey.desc['['] = {} let g:user.plugin.info.whichkey.desc[']'] = {} let g:user.plugin.info.whichkey.desc['[']['o'] = { \ 'name' : '+option', \ } let g:user.plugin.info.whichkey.desc[']']['o'] = { \ 'name' : '+option', \ } " which key let g:user.plugin.info.whichkey.mapkey = extend(g:user.plugin.info.whichkey.mapkey, { \ '[' : { 'rawkey' : "[", 'desc' : g:user.plugin.info.whichkey.desc['['] }, \ ']' : { 'rawkey' : "]", 'desc' : g:user.plugin.info.whichkey.desc[']'] }, \}) ''' hook_post_source = ''' " nmap < [ " nmap > ] " omap < [ " omap > ] " xmap < [ " xmap > ] ''' [[plugins]] repo = 'deton/jasentence.vim' hook_add = ''' " based on https://qiita.com/murashitas/items/f2be0dda2a4498cb7985 let g:jasentence_endpat = '[。.?!]\+' ''' [[plugins]] repo = 'deton/jasegment.vim' hook_add = ''' let g:jasegment_no_default_key_mappings = 1 let g:jasegment#mecab#cmd = 'mecab' let g:jasegment#cabocha#cmd = 'cabocha' let s:mecab_ok = 0 let s:cabocha_ok = 0 if g:user.system.windows let s:mecab_32 = exepath('C:\Program Files (x86)\MeCab\bin\mecab.exe') let s:mecab_native = exepath('C:\Program Files\MeCab\bin\mecab.exe') let s:mecab_cmd = '' if executable(s:mecab_32) let s:mecab_cmd = '"' . s:mecab_32 . '"' elseif executable(s:mecab_native) let s:mecab_cmd = '"' . s:mecab_native . '"' endif if !empty(s:mecab_cmd) let g:jasegment#mecab#cmd = s:mecab_cmd let s:mecab_ok = 1 " echomsg 'windows mecab ok' endif let g:jasegment#cabocha#enc = 'cp932' let s:cabocha_32 = exepath('C:\Program Files (x86)\CaboCha\bin\cabocha.exe') let s:cabocha_native = exepath('C:\Program Files\CaboCha\bin\cabocha.exe') let s:cabocha_cmd = '' if executable(s:cabocha_32) let s:cabocha_cmd = '"' . s:cabocha_32 . '"' elseif executable(s:mecab_native) let s:cabocha_cmd = '"' . s:cabocha_32 . '"' endif if !empty(s:cabocha_cmd) let g:jasegment#cabocha#cmd = s:cabocha_cmd let s:cabocha_ok = 1 " echomsg 'windows cabocha ok' endif else " non-windows " if MeCab exists, change model default to mecab let s:mecab_ok = executable(g:jasegment#mecab#cmd) " if CaboCha exists, change model default to cabocha let s:cabocha_ok = executable(g:jasegment#cabocha#cmd) endif " if MeCab exists, change model default to mecab if s:mecab_ok let g:jasegment#model = 'mecab' " if CaboCha exists, change model default to cabocha if s:cabocha_ok let g:jasegment#model = 'cabocha' endif let g:jasegment#model_word = g:jasegment#model " echomsg 'model :' . g:jasegment#model " echomsg 'model word:' . g:jasegment#model_word endif let g:jasegment#highlight = 1 ''' hook_post_source = ''' " temp off " nmap E JaSegmentMoveNE " nmap W JaSegmentMoveNW " nmap B JaSegmentMoveNB " omap E JaSegmentMoveOE " omap W JaSegmentMoveOW " omap B JaSegmentMoveOB " xmap E JaSegmentMoveVE " xmap W JaSegmentMoveVW " xmap B JaSegmentMoveVB omap aW JaSegmentTextObjA omap iW JaSegmentTextObjI xmap aW JaSegmentTextObjVA xmap iW JaSegmentTextObjVI ''' # Split/Join [[plugins]] repo = 'AndrewRadev/splitjoin.vim' depends = ['tabular'] hook_add = ''' let g:splitjoin_align = 1 let g:splitjoin_trailing_comma = 1 let g:splitjoin_ruby_trailing_comma = 1 let g:splitjoin_ruby_curly_braces = 0 let g:splitjoin_ruby_hanging_args = 0 ''' [[plugins]] repo = 'osyo-manga/vim-jplus' hook_add = ''' " J の挙動を jplus.vim で行う nmap J (jplus) xmap J (jplus) " getchar() を使用して挿入文字を入力します nmap J (jplus-getchar) xmap J (jplus-getchar) " inputで複数 nmap gJ (jplus-input) xmap gJ (jplus-input) " let g:jplus#config = {} let g:jplus#input_config = { \ '__DEFAULT__' : { \ 'delimiter_format' : '%d ', \ }, \ '__EMPTY__' : { \ 'delimiter' : ' ', \ 'delimiter_format' : '%d', \ }, \ '+' : { \ 'delimiter_format' : ' %d ' \ }, \ '.' : { \ 'delimiter_format' : '%d' \ }, \ '_' : { \ 'delimiter_format' : '%d' \ }, \ '->' : { \ 'delimiter_format' : '%d' \ }, \ '/' : { \ 'delimiter_format' : '%d' \ }, \ ':' : { \ 'delimiter_format' : '%d' \ }, \} ''' # File Header [[plugins]] repo = 'ahonn/vim-fileheader' hook_add = ''' " let g:fileheader_auto_add = 0 " Default value: 0 " let g:fileheader_auto_update = 1 " Default value: 1 " let g:fileheader_by_git_config = 1 " Default value: 1 let g:fileheader_author = g:user.git.name let g:fileheader_email = g:user.git.email let g:fileheader_date_format = '%Y-%m-%d %H:%M:%S' ''' hook_post_source = ''' " simple delay (git user/email async get in fileheader plugin) " restore back from git setting in fileheader plugin let g:user.git.name = g:fileheader_author let g:user.git.email = g:fileheader_email " set as default let g:fileheader_author = g:user.name let g:fileheader_email = g:user.email let s:c_style = { 'begin': '/**', 'char': ' * ', 'end': ' */' } let g:fileheader_delimiter_map = { \ 'c' : s:c_style, \ 'cpp' : s:c_style, \ 'java' : s:c_style, \} ''' [[plugins]] repo = 'alpertuna/vim-header' depends = ['vim-fileheader'] # use setting hook_add = ''' let g:header_auto_add_header = 0 ''' hook_post_source = ''' let g:header_alignment = 0 let g:header_max_size = 10 let g:header_field_filename = 1 " let g:header_field_filename_path = 0 " set as default let g:header_field_author = g:user.name let g:header_field_author_email = g:user.email " simple delay (git user/email async get in fileheader plugin) let g:header_field_timestamp_format = g:fileheader_date_format " let g:header_field_copyright = '' " let g:header_field_timestamp = 1 " let g:header_field_modified_timestamp = 1 " let g:header_field_modified_by = 1 " let g:header_field_timestamp_format = '...' " let g:header_field_license_id = '' " let g:header_cfg_comment_char = '#' ''' [[plugins]] # repo = 'syngan/vim-clurin' repo = 'uplus/vim-clurin' depends = ['vim-speeddating'] hook_add = ''' " original syngan use_default define top(all lang) " modified uplus use_default define per-lang " see https://bitbucket.org/hokorobi/vimfiles_pub/src " see https://github.com/syngan/vim-clurin function! s:ctrl_a_x(cnt) abort " normal op " if a:cnt >= 0 " execute 'normal!' a:cnt . "\" " else " execute 'normal!' (-a:cnt) . "\" " endif " " speeddaging " call speeddating#increment(a:cnt) " hokorobi san model if a:cnt < 0 call speeddating#increment(-v:count1) else call speeddating#increment(v:count1) endif endfunction let g:clurin = { \ '-': { \ 'use_default': 0, \ 'nomatch': function('s:ctrl_a_x'), \ 'def': [ \ ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], \ ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], \ ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], \ ['true', 'false'], \ ['True', 'False'], \ ['TRUE', 'FALSE'], \ ['on', 'off'], \ ['On', 'Off'], \ ['ON', 'OFF'], \ ['yes', 'no'], \ ['Yes', 'No'], \ ['YES', 'NO'], \ ['enable', 'disable'], \ ['Enable', 'Disable'], \ ['ENABLE', 'DISABLE'], \ ['left', 'right'], \ ['Left', 'Right'], \ ['LEFT', 'RIGHT'], \ ['min', 'max'], \ ['Min', 'Max'], \ ['MIN', 'MAX'], \ ['=', ' = '], \ ['+', ' + '], \ ['-', ' - '], \ ['*', ' * '], \ ['/', ' / '], \ ['%', ' % '], \ ['□', '■', '☑️', '☒'] , \ ['☆', '★'] , \ [ \ {'pattern': '月\(\%[曜日]\)', 'replace': '月\1'}, \ {'pattern': '火\(\%[曜日]\)', 'replace': '火\1'}, \ {'pattern': '水\(\%[曜日]\)', 'replace': '水\1'}, \ {'pattern': '木\(\%[曜日]\)', 'replace': '木\1'}, \ {'pattern': '金\(\%[曜日]\)', 'replace': '金\1'}, \ {'pattern': '土\(\%[曜日]\)', 'replace': '土\1'}, \ {'pattern': '日\(\%[曜日]\)', 'replace': '日\1'}, \ ], \ ] \ }, \ 'toml vim': { \ 'def': [ \ [ \ {'pattern': '"' . '\([^"]*\)' . '"' , 'replace': '"' . '\1' . '"'}, \ {'pattern': "'" . '\([^'']*\)' . "'" , 'replace': "'" . '\1' . "'"}, \ ] \ ] \ }, \ 'vim': { \ 'def': [ \ [ \ {'pattern': '\[''\(\k\+\)''\]', 'replace': '[''\1'']'}, \ {'pattern': '\["\(\k\+\)"\]' , 'replace': '["\1"]'}, \ {'pattern': '\.\(\k\+\)' , 'replace': '.\1'}, \ ] \ ] \ }, \ 'markdown': { \ 'def': [ \ ['[ ]', '[x]'], \ ] \ }, \ 'gitrebase': { \ 'def': [ \ ['pick', 'fixup', 'reword', 'edit', 'squash', 'drop', 'exec'], \ ] \ }, \ 'c cpp' : { \ 'def': [ \ [ '&&', '||' ], \ [ \ {'pattern': '\(\k\+\)\.', 'replace': '\1.'}, \ {'pattern': '\(\k\+\)->', 'replace': '\1->'}, \ ] \ ] \ } \} ''' hook_post_source = ''' nmap + (clurin-next) nmap - (clurin-prev) xmap + (clurin-next) xmap - (clurin-prev) ''' [[plugins]] repo = 'kamykn/spelunker.vim' # repo = 'tsuyoshicho/spelunker.vim' # rev = 'develop' depends = ['ctrlp.vim'] # if exists popup-menu.nvim, use it. hook_add = ''' " ctrlp ext let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['spelunker'] " Enable spelunker.vim. (default: 1) " 1: enable " 0: disable let g:enable_spelunker_vim = 1 " Enable spelunker.vim on readonly files or buffer. (default: 0) " 1: enable " 0: disable " let g:enable_spelunker_vim_on_readonly = 0 " Check spelling for words longer than set characters. (default: 4) " let g:spelunker_target_min_char_len = 4 " Option to disable word checking. " Disable URI checking. (default: 0) " let g:spelunker_disable_uri_checking = 1 " Disable email-like words checking. (default: 0) " let g:spelunker_disable_email_checking = 1 " Disable account name checking, e.g. @foobar, foobar@. (default: 0) " NOTE: Spell checking is also disabled for JAVA annotations. " let g:spelunker_disable_account_name_checking = 1 " Disable acronym checking. (default: 0) " let g:spelunker_disable_acronym_checking = 1 " Disable checking words in backtick/backquote. (default: 0) " let g:spelunker_disable_backquoted_checking = 1 " Max amount of word suggestions. (default: 15) autocmd vimrc_init_core VimEnter,VimResized * let g:spelunker_max_suggest_words = min([(&lines/4), 10]) - 1 " Max amount of highlighted words in buffer. (default: 100) " let g:spelunker_max_hi_words_each_buf = 100 " Spellcheck type: (default: 1) " 1: File is checked for spelling mistakes when opening and saving. This " may take a bit of time on large files. " 2: Spellcheck displayed words in buffer. Fast and dynamic. The waiting time " depends on the setting of CursorHold `set updatetime=1000`. let g:spelunker_check_type = 2 " Highlight type: (default: 1) " 1: Highlight all types (SpellBad, SpellCap, SpellRare, SpellLocal). " 2: Highlight only SpellBad. " FYI: https://vim-jp.org/vimdoc-en/spell.html#spell-quickstart " let g:spelunker_highlight_type = 1 " Disable default autogroup. (default: 0) " let g:spelunker_disable_auto_group = 1 " Create own custom autogroup to enable spelunker.vim for specific filetypes. " autocmd vimrc_init_core FileType startify " \ if g:enable_spelunker_vim | call spelunker#toggle() | endif " Override highlight group name of incorrectly spelled words. (default: " 'SpelunkerSpellBad') " let g:spelunker_spell_bad_group = 'SpelunkerSpellBad' " Override highlight group name of complex or compound words. (default: " 'SpelunkerComplexOrCompoundWord') " let g:spelunker_complex_or_compound_word_group = 'SpelunkerComplexOrCompoundWord' " skip word let g:spelunker_white_list_for_user = ['tsuyoshi_cho'] " which key let g:user.plugin.info.whichkey.mapkey = extend(g:user.plugin.info.whichkey.mapkey, { \ 'Z' : { 'rawkey' : "Z" }, \}) ''' hook_post_source = ''' set nospell set complete-=kspell " jump keymap silent! nmap ]s (spelunker-jump-next) silent! nmap [s (spelunker-jump-prev) ''' # [[plugins]] # codic support # repo = 'koron/codic-vim' [[plugins]] # codic support repo = 'tsuyoshicho/codic-web.vim' # rev = 'develop' depends = ['vim-pass'] hook_add = ''' " let g:codicweb_token = '' call pass#get_startup('g:codicweb_token','Develop/Codic') ''' [[plugins]] repo = 'tpope/vim-speeddating' depends = ['vim-repeat'] hook_add = ''' " let g:speeddating_no_mappings = 1 " if conflict " remove windows setting if g:user.system.windows silent! vunmap endif ''' hook_post_source = ''' " nmap SpeedDatingUp " nmap SpeedDatingDown " xmap SpeedDatingUp " xmap SpeedDatingDown " nmap d SpeedDatingNowUTC " nmap d SpeedDatingNowLocal " format add " ISO 8601 " SpeedDatingFormat %0Y%%0m%0dT%0H%0M%0S%z " 20210314T150129+0900 SpeedDatingFormat %0Y%-%0m-%0dT%0H:%0M:%0S " 2021-03-14T15:01:29Z or +09:00 " regular format SpeedDatingFormat %0Y%[/-]%0m%1%0d %_H:%M " 2000/01/01 10:15 SpeedDatingFormat %0Y%[/-]%0m%1%0d " 2000/01/01 SpeedDatingFormat %0H:%0M " 10:15 SpeedDatingFormat %-Y年%-m月%-d日%?[ ]%_H時%M分 " 2000年1月1日 12時1分 SpeedDatingFormat %-Y年%-m月%-d日 " 2000年1月1日 " SpeedDatingFormat %-m月%-d日%?[ ](%A) " 1月1日 (月曜日) " SpeedDatingFormat %-m月%-d日%?[ ](%a) " 1月1日 (月) SpeedDatingFormat %-m月%-d日 " 1月1日 SpeedDatingFormat %0H時%0M分%0S秒 " 12時01分30秒 SpeedDatingFormat %0H時%0M分 " 12時01分 SpeedDatingFormat %0M分%0S秒 " 01分30秒 ''' [[plugins]] # https://pixe.la/ repo = 'mattn/vim-pixela' if = 'g:user.function.executable("curl")' merged = 0 depends = ['open-browser.vim','vim-pass'] hook_source = ''' " 'if' do not stop hook_add, skip hook_source " let g:pixela_username = 'tsuyoshicho' " let g:pixela_token = '' call pass#get_startup('g:pixela_username','Develop/Pixela','username') call pass#get_startup('g:pixela_token','Develop/Pixela') ''' ## textobj & operator # textobj # see http://d.hatena.ne.jp/osyo-manga/20130717/1374069987 # support tool # need more good config, temp off # [[plugins]] # repo = 'terryma/vim-expand-region' # hook_add = ''' # " set use textobj keymap # " let g:expand_region_text_objects = { # " need config # " \} # " and other config for custom textobj # ''' # hook_post_source = ''' # " conflict vim built-in v/C-V operation(switch normal/visual-submode) # " xmap v (expand_region_expand) # " xmap (expand_region_shrink) # " do not work # " xmap w (expand_region_expand) # " omap w (expand_region_expand) # " xmap n (expand_region_shrink) # " omap n (expand_region_shrink) # ''' # textobj のベース [[plugins]] repo = 'kana/vim-textobj-user' # special # # jasentense # as/is 拡張 # # jasegment # aW/iW 拡張 # # 複数のカッコで処理を実施し、マッチしたものor(listなら)一番内側を使う # amb, imb [[plugins]] repo = 'osyo-manga/vim-textobj-multiblock' depends = ['vim-textobj-user'] hook_add = ''' let g:textobj_multiblock_no_default_key_mappings = 1 " see https://github.com/rinx/dotfiles/blob/master/vimrc " tex function! s:multiblock_hook_add_tex() let b:textobj_multiblock_blocks = [ \ ['\$', '\$', 1], \ ['\$\$', '\$\$', 1], \ ] endfunction " markdown function! s:multiblock_hook_add_markdown() let b:textobj_multiblock_blocks = [ \ ['`', '`', 1], \ ['```', '```'], \ ] endfunction " ruby function! s:multiblock_hook_add_ruby() let b:textobj_multiblock_blocks = [ \ ['/', '/', 1], \ ] endfunction augroup vimrc_init_multiblock_hook_add autocmd! autocmd FileType tex,latex,plaintex nested call s:multiblock_hook_add_tex() autocmd FileType markdown nested call s:multiblock_hook_add_markdown() autocmd FileType ruby nested call s:multiblock_hook_add_ruby() augroup END ''' hook_post_source = ''' omap amb (textobj-multiblock-a) omap imb (textobj-multiblock-i) xmap amb (textobj-multiblock-a) xmap imb (textobj-multiblock-i) ''' # カッコ系で複数の処理を実施し、マッチしたものor(listなら)一番内側を使う # amt, imt [[plugins]] repo = 'osyo-manga/vim-textobj-multitextobj' depends = ['vim-textobj-user', 'vim-textobj-url', 'vim-sandwich', 'vim-textobj-multiblock', 'vim-textobj-function', 'vim-textobj-jabraces'] hook_add = ''' " URL,datetime,paren,function,space,wiw,indent " paren replace vim-sandwich autofunction let g:textobj_multitextobj_textobjects_i = [ \ '(textobj-url-i)', \ '(textobj-sandwich-auto-i)', \ '(textobj-multiblock-i)', \ '(textobj-function-i)', \] let g:textobj_multitextobj_textobjects_a = [ \ '(textobj-url-a)', \ '(textobj-sandwich-auto-a)', \ '(textobj-multiblock-i)', \ '(textobj-function-a)', \] " jabraces " () (textobj-jabraces-parens-i) " [] (textobj-jabraces-braces-i) " {} (textobj-jabraces-brackets-i) " <> (textobj-jabraces-angles-i) " ≪≫ (textobj-jabraces-double-angles-i) " 「」 (textobj-jabraces-kakko-i) " 『』 (textobj-jabraces-double-kakko-i) " 〈〉 (textobj-jabraces-yama-kakko-i) " 《》 (textobj-jabraces-double-yama-kakko-i) " 〔〕 (textobj-jabraces-kikkou-kakko-i) " 【】 (textobj-jabraces-sumi-kakko-i) let g:textobj_multitextobj_textobjects_group_i = {} let g:textobj_multitextobj_textobjects_group_i.A = [ \ '(textobj-jabraces-kakko-i)', \ '(textobj-jabraces-double-kakko-i)', \ '(textobj-jabraces-double-yama-kakko-i)', \ '(textobj-jabraces-sumi-kakko-i)', \ '(textobj-jabraces-double-angles-i)', \ '(textobj-jabraces-parens-i)', \ '(textobj-jabraces-braces-i)', \ '(textobj-jabraces-brackets-i)', \ ] let g:textobj_multitextobj_textobjects_group_a = {} let g:textobj_multitextobj_textobjects_group_a.A = [ \ '(textobj-jabraces-kakko-a)', \ '(textobj-jabraces-double-kakko-a)', \ '(textobj-jabraces-double-yama-kakko-a)', \ '(textobj-jabraces-sumi-kakko-a)', \ '(textobj-jabraces-double-angles-a)', \ '(textobj-jabraces-parens-a)', \ '(textobj-jabraces-braces-a)', \ '(textobj-jabraces-brackets-a)', \ ] map (textobj-multitextobj-jabraces-i) (textobj-multitextobj-A-i) map (textobj-multitextobj-jabraces-a) (textobj-multitextobj-A-a) ''' hook_post_source = ''' omap imt (textobj-multitextobj-i) omap amt (textobj-multitextobj-a) xmap imt (textobj-multitextobj-i) xmap amt (textobj-multitextobj-a) omap amj (textobj-multitextobj-jabraces-a) omap imj (textobj-multitextobj-jabraces-i) xmap amj (textobj-multitextobj-jabraces-a) xmap imj (textobj-multitextobj-jabraces-i) ''' # バッファ全体 # ae, ie # subversiveと連携してバッファ全体を置換などする [[plugins]] repo = 'kana/vim-textobj-entire' depends = ['vim-textobj-user'] # 行単位 # al, il [[plugins]] repo = 'kana/vim-textobj-line' depends =['vim-textobj-user'] # Folding単位 # az, iz [[plugins]] repo = 'kana/vim-textobj-fold' depends =['vim-textobj-user'] # CamelCaseやsnake_caseの中の単語単位 # av, iv [[plugins]] repo = 'Julian/vim-textobj-variable-segment' depends =['vim-textobj-user'] # 挟まれた単語(指定の直後の文字で囲まれてると判断する) # a/, i/ [[plugins]] repo = 'thinca/vim-textobj-between' depends =['vim-textobj-user'] hook_add = ''' let g:textobj_between_no_default_key_mappings = 1 ''' hook_post_source = ''' omap i/ (textobj-between-i) xmap i/ (textobj-between-i) omap a/ (textobj-between-a) xmap a/ (textobj-between-a) ''' # 日付と時刻 # ada, ida (auto) [[plugins]] repo = 'kana/vim-textobj-datetime' depends = ['vim-textobj-user'] # 連続したスペース # aS, iS [[plugins]] repo = 'saihoooooooo/vim-textobj-space' depends = ['vim-textobj-user'] # 日本語括弧 # デフォルトoff [[plugins]] repo = 'kana/vim-textobj-jabraces' hook_add = ''' let g:textobj_jabraces_no_default_key_mappings = 1 ''' # 関数ブロック # afb/ifb, aFb,iFb # python specific: afp/ifp(function), acp/icp(class) use lazy 'vim-textobj-python' [[plugins]] # repo = 'kana/vim-textobj-function' repo = 'tsuyoshicho/vim-textobj-function' rev = 'develop' # TODO : I send Fix PR. When merged it then to restore original depends = ['vim-textobj-user'] hook_add = ''' let g:textobj_function_no_default_key_mappings = 1 ''' hook_post_source = ''' omap ifb (textobj-function-i) omap afb (textobj-function-a) xmap ifb (textobj-function-i) xmap afb (textobj-function-a) omap iFb (textobj-function-I) omap aFb (textobj-function-A) xmap iFb (textobj-function-I) xmap aFb (textobj-function-A) ''' # 関数call # afc/ifc, aFc,iFc [[plugins]] repo = 'machakann/vim-textobj-functioncall' hook_add = ''' let g:textobj_functioncall_no_default_key_mappings = 1 ''' hook_post_source = ''' omap ifc (textobj-functioncall-i) omap afc (textobj-functioncall-a) xmap ifc (textobj-functioncall-i) xmap afc (textobj-functioncall-a) ''' # 関数内 # syntaxを利用する function 拡張 [[plugins]] repo = 'haya14busa/vim-textobj-function-syntax' depends = ['vim-textobj-function'] # カーソル位置と同じインデント # ai, ii / aI, iI [[plugins]] repo = 'kana/vim-textobj-indent' depends = ['vim-textobj-user'] # 右辺左辺 # a=h/l, i=h/l [[plugins]] repo = 'romgrk/equal.operator' hook_add = ''' let g:equal_operator_default_mappings = 0 ''' hook_post_source = ''' xmap i=h (visual-lhs) omap i=h (operator-lhs) xmap a=h (visual-Lhs) omap a=h (operator-Lhs) xmap i=l (visual-rhs) omap i=l (operator-rhs) xmap a=l (visual-Rhs) omap a=l (operator-Rhs) ''' # URL選択 # au, iu [[plugins]] repo = 'mattn/vim-textobj-url' depends = ['vim-textobj-user'] # 言語別 # multiに入れない系 # word の中の単語を選択 # aw, iw # prefix = i 移動機能もある(smartwardで対応してるので利用は不要 w/W/e/E) [[plugins]] repo = 'h1mesuke/textobj-wiw' depends = ['vim-textobj-user'] hook_add = ''' let g:textobj_wiw_default_key_mappings_prefix = 'i' " keymap info let g:user.plugin.info.whichkey.desc.leader['i'] = { \ 'name' : '+textobj-wiw', \ } ''' # x() 系 # av, iv で x() 系に対応、他にもある [[plugins]] repo = 'anyakichi/vim-textobj-xbrackets' depends = ['vim-textobj-user'] # context内 # icx # at vim-precious # ブロック内/parenごと # a%, i% # at vim-matchup # カッコなしブロックの処理 # aB, iB # at braceless.vim # swap可能なオブジェクト(引数や配列メンバなどの,区切りデータ) # a,, i,, # at vim-swap # operator # see https://qiita.com/rbtnn/items/a47ed6684f1f0bc52906 # ToDo Keymap list up and setup [[plugins]] repo = 'kana/vim-operator-user' # 連番付与 # operator:viwなど 選択状態にしてzS(normal)/zP(prev)で処理 [[plugins]] repo = 'deris/vim-rengbang' # repo = 'tsuyoshicho/vim-rengbang' # rev = 'develop' depends = ['vim-operator-user'] hook_post_source = ''' " xmap " (operator-rengbang) " (operator-rengbang-useprev) " " You can use following operator. " This operator like :'<,'>RengBang (use default options). omap zS (operator-rengbang) xmap zS (operator-rengbang) " This operator like :'<,'>RengBangUsePrev (use previous options). omap zP (operator-rengbang-useprev) xmap zP (operator-rengbang-useprev) " see https://vim-jp.org/blog/2015/06/30/visual-ctrl-a-ctrl-x.html " visual ctrl-x/ctrl-a " xnoremap gv " xnoremap gv " use speeddating if " g と g を使う事で簡単に連番を付与する事が出来る ''' # コメントトグル # operator:viwなど 選択状態にしてgccで処理 # 'tyru/caw.vim' # operator:viwなど 選択状態にしてsa/sd/sr+で処理 # textobj :ab, ib (自動)/ aq, iq (続けて区切り文字を入力) [[plugins]] repo = 'machakann/vim-sandwich' hook_add = ''' " which_key s let g:user.plugin.info.whichkey.mapkey = extend(g:user.plugin.info.whichkey.mapkey, { \ 's' : { 'rawkey' : "s" }, \}) " default textobj map off let g:textobj_sandwich_no_default_key_mappings = 1 let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes) let g:sandwich#recipes += [ \ { \ 'buns': ['#{', '}'], \ 'input': ['#'], \ 'filetype': ['vim'], \ 'nesting': 1, \ }, \ { \ 'buns': ['\(', '\)'], \ 'input': ['8'], \ 'filetype': ['vim'], \ 'nesting': 1, \ }, \ { \ 'buns': ['\%(', '\)'], \ 'input': ['%'], \ 'filetype': ['vim'], \ 'nesting': 1, \ }, \ { \ 'buns': ['\<', '\>'], \ 'input': [','], \ 'filetype': ['vim'], \ 'nesting': 0, \ }, \ { \ 'buns': ['$(', ')'], \ 'input': ['$'], \ 'filetype': ['sh'], \ 'nesting': 1, \ }, \ {'buns' : ['(', ')']}, \ {'buns' : ['[', ']']}, \ {'buns' : ['{', '}']}, \ {'buns' : ['<', '>']}, \ {'buns' : ['≪', '≫']}, \ {'buns' : ['「', '」']}, \ {'buns' : ['『', '』']}, \ {'buns' : ['〈', '〉']}, \ {'buns' : ['《', '》']}, \ {'buns' : ['〔', '〕']}, \ {'buns' : ['【', '】']}, \] let g:sandwich#magicchar#f#patterns = deepcopy(g:sandwich#magicchar#f#default_patterns) let g:sandwich#magicchar#f#patterns += [ \ { \ 'header' : '\<\h\k*', 'footer' : '', \ 'bra' : '(', 'ket' : ')', \ }, \] ''' hook_post_source = ''' omap ab (textobj-sandwich-auto-a) omap ib (textobj-sandwich-auto-i) xmap ab (textobj-sandwich-auto-a) xmap ib (textobj-sandwich-auto-i) omap aq (textobj-sandwich-query-a) omap iq (textobj-sandwich-query-i) xmap aq (textobj-sandwich-query-a) xmap iq (textobj-sandwich-query-i) ''' # viwなど 選択状態にしてqで処理 強制改行 [[plugins]] # like gq operator repo = 'lambdalisue/vim-operator-breakline' depends = ['vim-operator-user'] hook_add = ''' " The following mappings use the value of 'textwidth' nmap q (operator-breakline-textwidth) xmap q (operator-breakline-textwidth) " The following mappings shows prompt to ask the value nmap Q (operator-breakline-manual) xmap Q (operator-breakline-manual) ''' # viwなど 選択状態にしてzrで処理 yankと入れ替え [[plugins]] # yank replace operator repo = 'kana/vim-operator-replace' depends = ['vim-operator-user'] hook_add = ''' omap zr (operator-replace) xmap zr (operator-replace) ''' [[plugins]] # replace operator repo = 'svermeulen/vim-subversive' depends = ['vim-yoink'] hook_post_source = ''' nmap s (SubversiveSubstituteRange) xmap s (SubversiveSubstituteRange) nmap ss (SubversiveSubstituteWordRange) " abolish integ " nmap s (SubversiveSubvertRange) " xmap s (SubversiveSubvertRange) " " nmap ss (SubversiveSubvertWordRange) " need yoink xmap s (SubversiveSubstitute) xmap p (SubversiveSubstitute) xmap P (SubversiveSubstitute) ''' # cx ののち cxで入れ替え # cxx はライン固定 # cxc は状態クリア # X in Visualも入れ替え [[plugins]] repo = 'tommcdo/vim-exchange' # viwなど 選択状態にしてzsで処理 [[plugins]] repo = 'emonkak/vim-operator-sort' depends = ['vim-operator-user'] hook_add = ''' omap zs (operator-sort) xmap zs (operator-sort) ''' # viwなど 選択状態にしてzu/zUで処理 / 当座はciwで [[plugins]] repo = 'emonkak/vim-operator-comment' depends = ['vim-operator-user'] hook_add = ''' omap zu (operator-comment) xmap zu (operator-comment) omap zU (operator-uncomment) xmap zU (operator-uncomment) ''' # viwなど 選択状態にしてzc/zCで処理 [[plugins]] repo = 'mopp/vim-operator-convert-case' depends = ['vim-operator-user'] hook_add = ''' omap zc (operator-convert-case-loop) xmap zc (operator-convert-case-loop) omap zC (operator-convert-case-convert) xmap zC (operator-convert-case-convert) ''' # viwなど 選択状態にしてzt/zlで検索 [[plugins]] repo = 'tyru/operator-reverse.vim' depends = ['vim-operator-user'] hook_add = ''' omap zt (operator-reverse-text) xmap zt (operator-reverse-text) omap zl (operator-reverse-lines) xmap zl (operator-reverse-lines) ''' # Easy Operator(select,yank and other) [[plugins]] repo = 'haya14busa/vim-easyoperator-line' depends = ['vim-easymotion'] hook_add = ''' " let g:EasyOperator_line_do_mapping = 0 ''' hook_post_source = ''' " default (prefix)l in omap/xmap ''' [[plugins]] repo = 'haya14busa/vim-easyoperator-phrase' depends = ['vim-easymotion'] hook_add = ''' " let g:EasyOperator_phrase_do_mapping = 0 ''' hook_post_source = ''' " default (prefix)p in omap/xmap ''' # Startup # [[plugins]] # repo = 'thinca/vim-splash' # hook_add = ''' # " let g:splash#path = '' # ''' [[plugins]] repo = 'mhinz/vim-startify' depends = ['vital.vim'] hook_post_source = ''' let s:Filepath = g:V.import('System.Filepath') let s:List = g:V.import('Data.List') let s:String = g:V.import('Data.String') let g:startify_padding_left=3 let s:padding = repeat(" ", g:startify_padding_left) " filter func function! s:file_contains_list(base, list) abort let Filepath = g:V.import('System.Filepath') let root = expand(a:base, ":p") let filelist = copy(a:list) call filter(filelist, 'Filepath.contains(v:val, root)') return filelist[ : max([g:startify_files_number - 1, 1]) ] endfunction if exists('*mr#mru#list') function! s:mru_list() abort return mr#mru#list() endfunction else let g:startify_update_oldfiles = 1 function! s:mru_list() abort let Filepath = g:V.import('System.Filepath') " oldfile refine unix/win path style let oldfiles = copy(v:oldfiles) call map(oldfiles, 'Filepath.realpath(v:val)') call map(oldfiles, 'fnamemodify(v:val, ":p:~")') return oldfiles endfunction endif function! s:skip_filter(path) abort for regexp in get(g:, 'startify_skiplist', []) let regexp = '\c' . regexp try if a:path =~# regexp return 0 endif catch call s:warn('Pattern '. string(regexp) .' threw an exception. Read :help g:startify_skiplist') endtry endfor return 1 endfunction function! s:totallist() abort let Filepath = g:V.import('System.Filepath') let mru_total_list = s:mru_list() call filter(mru_total_list, '!Filepath.contains(v:val, expand(g:user.dir.cache_home))') call filter(mru_total_list, { _,v -> s:skip_filter(v) }) let mru_total_list = mru_total_list[ : max([g:startify_files_number - 1, 1]) ] call map(mru_total_list, { _, v -> { 'line': fnamemodify(v, ":p:~") , 'path': v } }) call map(mru_total_list, { _, v -> extend(v, {'line': g:user.function.fileicon(v.path) . ' ' . v.line }, "force") }) return mru_total_list endfunction function! s:currentlist() abort let Filepath = g:V.import('System.Filepath') let mru_current_list = s:file_contains_list(getcwd(), s:mru_list()) call filter(mru_current_list, '!Filepath.contains(v:val, g:user.dir.cache_home)') if exists('g:memolist_path') call filter(mru_current_list, '!Filepath.contains(v:val, g:memolist_path)') endif if exists('g:junkfile#directory') call filter(mru_current_list, '!Filepath.contains(v:val, g:junkfile#directory)') endif call filter(mru_current_list, { _,v -> s:skip_filter(v) }) call map(mru_current_list, { _, v -> { 'line': fnamemodify(v, ":p:.") , 'path': v } }) call map(mru_current_list, { _, v -> extend(v, {'line': g:user.function.fileicon(v.path) . ' ' . v.line }, "force") }) return mru_current_list endfunction function! s:memolist() abort let mru_memo_list = [] if exists('g:memolist_path') let mru_memo_list = s:file_contains_list(g:memolist_path, s:mru_list()) call map(mru_memo_list, { _, v -> { 'line': fnamemodify(v, ":p:t") , 'path': v } }) call map(mru_memo_list, { _, v -> extend(v, {'line': g:user.function.fileicon(v.path) . ' ' . v.line }, "force") }) endif return mru_memo_list endfunction function! s:junklist() abort let mru_junk_list = [] if exists('g:junkfile#directory') let mru_junk_list = s:file_contains_list(g:junkfile#directory, s:mru_list()) call map(mru_junk_list, { _, v -> { 'line': fnamemodify(v, ":p:t") , 'path': v } }) call map(mru_junk_list, { _, v -> extend(v, {'line': g:user.function.fileicon(v.path) . ' ' . v.line }, "force") }) endif return mru_junk_list endfunction let g:startify_lists = [ \ { 'header': [s:padding . 'MRU'] , 'type': { -> s:totallist() } }, \ { 'header': [s:padding . 'MRU pwd'] , 'type': { -> s:currentlist() } }, \ { 'header': [s:padding . 'memos'] , 'type': { -> s:memolist() } }, \ { 'header': [s:padding . 'junkfiles'] , 'type': { -> s:junklist() } }, \ { 'header': [s:padding . 'Sessions'] , 'type': 'sessions' }, \ { 'header': [s:padding . 'Bookmarks'] , 'type': 'bookmarks' }, \ { 'header': [s:padding . 'Commands'] , 'type': 'commands' }, \] let g:startify_files_number = 8 let s:tomls = keys(g:dein.file.toml) + keys(g:dein.file.toml_nouse) let s:tomls = s:List.map(s:tomls, { v -> fnamemodify(v, ":~")}) call sort(s:tomls) let g:startify_bookmarks = [ \ {'g': fnamemodify(expand('~/.gvimrc'), ":~")}, \ {'x': fnamemodify(expand('~/.vimrc' ), ":~")}, \ {'w': fnamemodify(expand('~/.bashrc'), ":~")}, \] + s:tomls unlet s:tomls " no need depend : write as text (if no-exist , no work) let g:startify_commands = [ \ {'h': ':help help'}, \ {'r': ['Restart', 'Restart']}, \ {'u': ['Plugin update', 'DeinUpdateStart']}, \ {'l': ['CtrlP Launcher', 'CtrlPLauncher']}, \ {'f': ['LeaderF file search', 'Leaderf file']}, \ {'m': ['Mastodon', 'Mastodon timeline']}, \ {'o': ['Qiita', 'Qiita -l']}, \ {'p': ['Calendar', 'Calendar -split=vertical -s:position=right']}, \] " let g:startify_disable_at_vimenter=0 " This value as default if has('win32unix') " MSYS vim (git for windows) very slowly : reason startify syntax too long let g:startify_disable_at_vimenter=1 endif " ignore server name " let g:startify_skiplist_server = [ 'GVIM' ] " ignore MRU file " Git and other special files let s:special_skiplist = [ \ escape(s:Filepath.separator() . '.git' . s:Filepath.separator(), '\'), \ escape(s:Filepath.abspath(s:Filepath.realpath(g:user.dir.dictionary)) . s:Filepath.separator(), '\') . '.*$', \ 'fugitiveblame$', \] " Vim help files " s:position let s:position = [ \ s:Filepath.abspath(resolve($VIMRUNTIME)) . s:Filepath.separator(), \ 'runtime' . s:Filepath.separator(), \ 'bundle' . s:Filepath.separator() . '.*' . s:Filepath.separator(), \ 'plugged' . s:Filepath.separator() . '.*' . s:Filepath.separator(), \ s:Filepath.abspath(g:dein.dir.plugins) . s:Filepath.separator() . '.*' . s:Filepath.separator(), \] let s:helpfiles = ['.*\.txt$', '.*\.??x$'] let s:help_skiplist = [] for s:helpfile in s:helpfiles let s:help_skiplist = s:List.concat([s:help_skiplist, s:List.map(s:position, \ { v -> escape(v . 'doc' . s:Filepath.separator(), '\') . s:helpfile })]) endfor let g:startify_skiplist = s:special_skiplist + s:help_skiplist unlet s:special_skiplist s:help_skiplist s:helpfile " let g:startify_fortune_use_unicode=1 " autocmd vimrc_init_core User Startified nested setlocal ambiwidth=single " oops: open mru and other keep ambiwidth... let s:logo = [ \ '___ ______________ ___', \ '__ | / /___ _/__ |/ /', \ '__ | / / __ / __ /|_/ /', \ '__ |/ / __/ / _ / / /', \ '_____/ /___/ /_/ /_/', \] let s:datetime = ['*** '.strftime("%Y/%m/%d(%a)", localtime()).' ***'] let g:startify_custom_header = \ map(s:logo + startify#fortune#boxed() + s:datetime, 's:padding . v:val') " space same as padding_left let s:vimver = ['vim version:', ' ' . 'short:' . string(v:version)] if exists('v:versionlong') call add(s:vimver, ' ' . 'long :' . string(v:versionlong)) endif let g:startify_custom_footer = \ map(s:vimver, 's:padding . v:val') unlet s:Filepath s:List s:String ''' [[plugins]] repo = 'simeji/winresizer' hook_add = ''' let g:winresizer_vert_resize = 1 let g:winresizer_horiz_resize = 1 ''' [[plugins]] repo = 'itchyny/vim-winfix' [[plugins]] repo = 'wesQ3/vim-windowswap' # [[plugins]] # repo = "t9md/vim-choosewin" # hook_add = ''' # " use overlay feature # let g:choosewin_overlay_enable = 1 # # " workaround for the overlay font being broken on mutibyte buffer. # " let g:choosewin_overlay_clear_multibyte = 1 # ''' # hook_post_source = ''' # " invoke with '-' : original # " key bind to ',-' # nmap - (choosewin) # ''' [[plugins]] repo = 'bignimbus/you-are-here.vim' hook_post_source = ''' nnoremap - :call you_are_here#ToggleFor(3000) ''' # [[plugins]] # repo = 'justincampbell/vim-eighties' # hook_add = ''' # let g:eighties_enabled = 1 # autocmd vimrc_init_core VimEnter,VimResized * let g:eighties_minimum_width = min([(&columns * 2 / 3), 60]) # let g:eighties_extra_width = 10 " Increase this if you want some extra room # let g:eighties_compute = 1 " Disable this if you just want the minimum + extra # let g:eighties_bufname_additional_patterns = [] " Defaults to [], 'fugitiveblame' is only an example. Takes a comma delimited list of bufnames as strings. # ''' [[plugins]] repo = 'tyru/open-browser.vim' hook_add = ''' let g:netrw_nogx = 1 " disable netrw's gx mapping. nmap gx (openbrowser-smart-search) xmap gx (openbrowser-smart-search) nmap guo (openbrowser-open) xmap guo (openbrowser-open) nmap guO (openbrowser-open-incognito) xmap guO (openbrowser-open-incognito) ''' [[plugins]] repo = 'tyru/open-browser-unicode.vim' depends = ['open-browser.vim'] [[plugins]] repo = 'itchyny/calendar.vim' hook_add = ''' " let g:calendar_frame = 'default' let g:calendar_first_day = "sunday" let g:calendar_view = "days" let g:calendar_google_calendar = 1 let g:calendar_google_task = 1 let g:calendar_updatetime = &updatetime ''' [[plugins]] repo = 'thinca/vim-themis' [[plugins]] repo = 'janko-m/vim-test' depends = ['vimproc.vim', 'asyncrun.vim'] hook_add = ''' let g:test#strategy = 'basic' " let g:test#strategy = 'asyncrun' let g:test#strategy = 'asyncrun_background' " let g:test#strategy = 'asyncrun_background_term' " if g:user.plugin.info.vimproc.ok() " let g:test#strategy = 'vimproc' " elseif g:user.system.nvim " let g:test#strategy = 'neovim' " elseif has('terminal') " let g:test#strategy = 'vimterminal' " endif " type specific " Runners available are 'pytest', 'nose', 'nose2', 'djangotest', 'djangonose', 'mamba', " and Python's built-in unittest as 'pyunit' let g:test#python#runner = 'pytest' " option " let g:test#python#pytest#options = { " \ 'all': '', " \} ''' # Doc & File & Web [[plugins]] repo = 'vim-jp/vimdoc-ja' hook_add = ''' " based on http://haya14busa.com/reading-vim-help/ set helplang& helplang=ja,en ''' [[plugins]] repo = 'mattn/learn-vimscript' # plugin support [[plugins]] repo = 'mopp/layoutplugin.vim' hook_add = ''' let g:layoutplugin#user_name = g:user.name " always my name " let g:layoutplugin#is_append_vimrc " let g:layoutplugin#is_suffix_readme_md let g:layoutplugin#is_suffix_plugin_name = 0 " When set .vim; manually ''' [[plugins]] repo = 'LeafCage/vimhelpgenerator' hook_add = ''' let g:vimhelpgenerator_author = 'Author : ' . g:user.name . ' <' . g:user.devemail . '>' " always my name let g:vimhelpgenerator_uri = 'https://github.com/tsuyoshicho/' let g:vimhelpgenerator_defaultlanguage = 'en' let g:vimhelpgenerator_contents = { \ 'contents' : 1, \ 'introduction' : 1, \ 'usage' : 1, \ 'interface' : 1, \ 'variables' : 1, \ 'commands' : 1, \ 'key-mappings' : 1, \ 'functions' : 1, \ 'setting' : 1, \ 'todo' : 0, \ 'changelog' : 0, \} let g:vimhelpgenerator_virtualhelpopencmd ='tabnew' function! s:vimhelpgen(lang,...) abort let backup = get(g:, 'vimhelpgenerator_defaultlanguage', 'en') let g:vimhelpgenerator_defaultlanguage = a:lang let arglist = extend([0],a:000) call call('vimhelpgenerator#generate', arglist) let g:vimhelpgenerator_defaultlanguage = backup endfunction command! -nargs=* VimHelpGeneratorEn call s:vimhelpgen('en', ) command! -nargs=* VimHelpGeneratorJa call s:vimhelpgen('ja', ) ''' [[plugins]] repo = 'rhysd/devdocs.vim' depends = ['open-browser.vim'] # contents [[plugins]] repo = 'chrisbra/unicode.vim' [[plugins]] # カーソル位置のコンテキストのftを判定するライブラリ repo = 'Shougo/context_filetype.vim' # repo = 'tsuyoshicho/context_filetype.vim' # rev = 'develop' hook_post_source = ''' let s:default_filetypes = g:context_filetype#default_filetypes() let s:plantuml_context = [ \ { \ 'start' : '\_.\%(@start\(uml\|gantt\|ditaa\|salt\|wbs\|mindmap\|math\|latex\)\)\@=', \ 'end' : '\%(@end\1\)\@<=\_.', 'filetype' : 'plantuml' \ }, \ ] " currently broken let s:yaml_context = [ \ { \ 'start' : '\%^-\{3,}.*$', \ 'end' : '\_^-\{3,}.*$', \ 'filetype' : 'yaml' \ }, \ ] for s:key in ['markdown','text'] let g:context_filetype#filetypes[s:key] = extend( \ s:plantuml_context, \ get(s:default_filetypes, s:key, []) \) endfor " same as typename let g:context_filetype#same_filetypes = \extend(get(g:, 'context_filetype#same_filetypes', {}), \ { \ 'yml' : 'yaml', \ } \) ''' [[plugins]] # カーソル位置のコンテキストに合わせてftを切り替える repo = 'osyo-manga/vim-precious' depends = ['context_filetype.vim', 'vim-textobj-user'] # and support context textobj hook_add = ''' " dein toml do not need switch let g:precious_enable_switchers = { \ "toml" : { \ "setfiletype" : 0, \ }, \} " move to change disable let g:precious_enable_switch_CursorMoved = { \ "*" : 0, \} let g:precious_enable_switch_CursorMoved_i = { \ "*" : 0, \} ''' [[plugins]] repo = 'wellle/context.vim' hook_add = ''' " default disable let g:context_enabled = 0 let g:context_add_mappings = 0 let g:context_filetype_blacklist = [] ''' [[plugins]] repo = 'LeafCage/taillight.vim' hook_add = ''' " セミコロン末尾の言語を追加 " JavaScriptは除外(手動で) " autocmd vimrc_init_core FileType c,cpp,java nested TailLight ; /\* \*/ ''' [[plugins]] repo = 'tsuyoshicho/vim-fg' hook_post_source = ''' nnoremap mg :Fg " usable define nnoremap mp :FgPt " xnoremap mp :FgPt nnoremap ma :FgAg ''' # autocomplete [[plugins]] repo = 'prabirshrestha/vim-lsp' hook_add = ''' let g:lsp_async_completion = 1 let g:lsp_auto_enable = 1 " default 1 let g:lsp_diagnostics_enabled = 1 " default 1 let g:lsp_semantic_enabled = 1 " default 0 let g:lsp_work_done_progress_enabled = 1 " default 0 let s:float_ok = 0 if g:user.system.nvim let s:float_ok = 1 elseif has('popupwin') || exists('*popup_create') let s:float_ok = 1 endif if s:float_ok let g:lsp_preview_float = 1 let g:lsp_diagnostics_float_cursor = 1 let g:lsp_diagnostics_echo_cursor = 0 " default 0 enable echo under cursor when in normal mode else let g:lsp_preview_float = 0 let g:lsp_diagnostics_float_cursor = 0 let g:lsp_diagnostics_echo_cursor = 1 " default 0 enable echo under cursor when in normal mode endif " folding " let g:lsp_fold_enabled = 0 " default 1 enable " icon setting " use vim-lsp-icons plugin " let g:lsp_signs_error = {'text': '🔥'} " let g:lsp_signs_warning = {'text': '❗'} " let g:lsp_signs_information = {'text': '👁️'} " server setup " mainly setting use vim-lsp-settings plugin " more settings from https://qiita.com/ryicoh/items/6d51232f37ebfa6a41b2 " before setup let g:lsp_diagnostics_echo_cursor let g:lsp_diagnostics_echo_delay = 50 " before setup let g:lsp_diagnostics_float_cursor let g:lsp_diagnostics_float_delay = 50 " let g:lsp_diagnostics_highlights_enabled = 1 let g:lsp_diagnostics_highlights_delay = 50 let g:lsp_diagnostics_highlights_insert_mode_enabled = 0 " let g:lsp_diagnostics_signs_enabled = 1 let g:lsp_diagnostics_signs_delay = 50 let g:lsp_diagnostics_signs_insert_mode_enabled = 0 if g:user.system.nvim " let g:lsp_diagnostics_virtual_text_enabled = 1 let g:lsp_diagnostics_virtual_text_delay = 50 let g:lsp_diagnostics_virtual_text_prefix = "🍔 " endif " let g:lsp_completion_documentation_enabled = 1 let g:lsp_completion_documentation_delay = 40 " let g:lsp_document_highlight_enabled = 1 let g:lsp_document_highlight_delay = 100 " let g:lsp_document_code_action_signs_enabled = 1 let g:lsp_document_code_action_signs_delay = 100 " before setting folding " more setting done " optional let g:lsp_item = [] " c/c++ ccls if g:user.function.executable('ccls') call add(g:lsp_item, { \ 'name': 'ccls', \ 'cmd': { server_info -> ['ccls'] }, \ 'root_uri': { server_info -> \ lsp#utils#path_to_uri( \ lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json') \ ) \ }, \ 'initialization_options': { \ 'highlight': { \ 'lsRanges' : v:true \ }, \ }, \ 'allowlist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], \}) endif function! s:lsp_user_setup() abort for item in g:lsp_item call lsp#register_server(item) endfor endfunction function! s:lsp_user_buffer_enabled() abort " option setup if dein#is_sourced('asyncomplete-lsp.vim') " use vim-lsp in complete engine asyncomplete and source omni do not " load , set omni vim-lsp function. setlocal omnifunc=lsp#complete endif " use vim built-in/plugin folding let exclude_types = ['markdown','help', 'quickrun'] " quickrun lsp exclude need, but do not work... if get(g:, 'lsp_fold_enabled', 0) let foldset = v:true for filetype_name in split(&filetype, '\.') if index(exclude_types, filetype_name) > -1 let foldset = v:false break end endfor if ('vim' ==? &filetype) && ('marker' ==? &l:foldmethod) let foldset = v:false endif if foldset setlocal \ foldmethod=expr \ foldexpr=lsp#ui#vim#folding#foldexpr() \ foldtext=lsp#ui#vim#folding#foldtext() else echo 'lsp fold skip:' . &filetype endif endif " keymap nmap (lsp-hover) nmap (lsp-rename) nmap gd (lsp-definition) nmap K (lsp-hover) nmap A (lsp-code-action) nmap md (lsp-document-diagnostics) nmap mr (lsp-references) nmap ]e (lsp-next-diagnostic) nmap [e (lsp-previous-diagnostic) nmap ]r (lsp-next-reference) nmap [r (lsp-previous-reference) " autocmd augroup vimrc_init_vim_lsp_buffer_enabled autocmd! if &filetype ==# 'go' autocmd BufWritePre silent! LspDocumentFormatSync autocmd BufWritePre silent! LspCodeActionSync source.organizeImports endif augroup END endfunction augroup vimrc_init_vim_lsp autocmd! autocmd User lsp_setup nested call s:lsp_user_setup() autocmd User lsp_buffer_enabled nested call s:lsp_user_buffer_enabled() augroup END ''' hook_post_source = ''' " from https://mattn.kaoriya.net/software/vim/20191231213507.htm command! LspDebugEnable let g:lsp_log_verbose=1 | let g:lsp_log_file=expand($HOME . '/lsp.log') command! LspDebugDisable let g:lsp_log_verbose=0 | unlet! g:lsp_log_file ''' [[plugins]] repo = 'hrsh7th/vim-vsnip' hook_add = ''' let g:vsnip_snippet_dir = expand(g:user.dir.config_home . '/snippet') call g:user.function.mkdir(g:vsnip_snippet_dir) ''' hook_post_source = ''' " Expand imap vsnip#expandable() ? '(vsnip-expand)' : '' smap vsnip#expandable() ? '(vsnip-expand)' : '' " Expand or jump imap (complete_info(['selected']).selected != -1) ? '' \ : (vsnip#available(1) ? '(vsnip-expand-or-jump)' : '') smap (complete_info(['selected']).selected != -1) ? '' \ : (vsnip#available(1) ? '(vsnip-expand-or-jump)' : '') " imap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' " smap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' " Jump forward or backward imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' ''' [[plugins]] repo = 'kitagry/vs-snippets' merged = 0 [[plugins]] repo = 'hrsh7th/vim-vsnip-integ' depends = ['vim-lsp', 'asyncomplete.vim', 'vim-vsnip'] [[plugins]] repo = 'jackguo380/vim-lsp-cxx-highlight' merged = 0 depends = ['vim-lsp'] [[plugins]] repo = 'mattn/vim-lsp-settings' # repo = 'tsuyoshicho/vim-lsp-settings' # rev = 'develop' merged = 0 depends = ['vim-lsp', 'vital.vim'] hook_add = ''' " install path " ~/.local/share/vim-lsp-settings/ let g:lsp_settings_servers_dir = expand(g:user.dir.data_home . '/vim-lsp-settings') call g:user.function.mkdir(g:lsp_settings_servers_dir) let g:lsp_settings_global_settings_dir = expand(g:user.dir.config_home . '/vim-lsp-settings') call g:user.function.mkdir(g:lsp_settings_global_settings_dir) " config " system-wide / per lsp server " global / per lsp server let g:lsp_settings = {} " affect high-priority vim-lsp-settings installed clangd " detect clangd path " 1. vim-lsp-installed clangd " 2. system installed clangd let s:clangd_path = g:lsp_settings_servers_dir . '/clangd/clangd' if !executable(s:clangd_path) " システムにインストールされたバージョンを利用しますが、 " これが'-j'をサポートしてない場合があります。 " Use the version installed on your system, which may not support'-j '. let s:clangd_path = exepath('clangd') endif " prefer python 3, detect python 3 version " 1. use if python is pytnon3 " 2. use if python3 avaliable if g:user.function.executable('python') " check 'python' let s:py_path = exepath('python') let s:py_version = system(shellescape(s:py_path) . ' -V') let s:py_ver = trim(matchstr(s:py_version, '\s\zs\S\+')) if (empty(s:py_ver) || ('2' ==? strpart(s:py_ver, 0, 1))) \ && g:user.function.executable('python3') " 'python' is version2 and exists 'python3' let s:py_path = exepath('python3') let s:py_version = system(shellescape(s:py_path) . ' -V') let s:py_ver = trim(matchstr(s:py_version, '\s\zs\S\+')) endif endif " efm-langserver " use vim-efm-langserver-settings " let g:lsp_settings['efm-langserver'] = {} " let g:lsp_settings['efm-langserver']['disabled'] = v:false " clangd installed? " set at cpunum let g:lsp_settings['clangd'] = {} if executable(s:clangd_path) let g:lsp_settings['clangd']['cmd'] = [ \ s:clangd_path, '--background-index', '-j=' . g:user.system.cpunum \] " if ccls installed, use only ccls. if g:user.function.executable('ccls') let g:lsp_settings['clangd']['disabled'] = v:true endif endif " python3 available? " prefer python 3 than 2(at python command in vim-lsp-setting) if !empty(s:py_ver) let g:lsp_settings['pyls-ms'] = { \ 'python-path' : s:py_path, \ 'python-ver' : s:py_ver, \} endif let g:lsp_settings['pyls-all'] = { \ 'workspace_config': { \ 'pyls': { \ 'configurationSources': ['flake8'] \ } \ } \} " need run pylsp-all/venv/bin/pip install pylsp-mypy let g:lsp_settings['pylsp-all'] = { \ 'workspace_config': { \ 'pylsp': { \ 'configurationSources': ['flake8'], \ 'plugins': { \ 'pylsp_mypy': { \ 'enabled': 1 \ } \ } \ } \ } \} let g:lsp_settings['gopls'] = { \ 'workspace_config': { \ 'usePlaceholders': v:true, \ 'analyses': { \ 'fillstruct': v:true, \ }, \ }, \ 'initialization_options': { \ 'usePlaceholders': v:true, \ 'analyses': { \ 'fillstruct': v:true, \ }, \ }, \} let g:lsp_settings['yaml-language-server'] = { \ 'workspace_config': { \ 'yaml': { \ 'schemas': { \ 'https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json' : 'docker-compose.y*ml', \ }, \ 'completion': v:true, \ 'hover': v:true, \ 'validate': v:true, \ } \ } \ } " scheme example " 'https://mattn.github.io/efm-langserver/schema.json': '/efm-langserver/config.yaml' " per filetype " let g:lsp_settings_filetype_vim = ['vimscript-language-server'] " let g:lsp_settings_filetype_python = ['pylsp-all', 'pyright-langserver'] let g:lsp_settings_filetype_typescript = ['deno', 'typescript-language-server'] " deno support settings let g:markdown_fenced_languages = get(g:, 'markdown_fenced_languages', []) \ + ['ts=typescript'] ''' hook_post_source = ''' let s:List = g:V.import('Data.List') let g:lsp_settings_root_markers = s:List.concat([ \ s:List.map(g:user.rootmarker.dirs, { v -> v . '/' }), \ g:user.rootmarker.files]) unlet s:List ''' [[plugins]] repo = 'tsuyoshicho/vim-efm-langserver-settings' # rev = 'develop' depends = ['vim-lsp'] build = 'go install github.com/mattn/efm-langserver@latest' hook_add = ''' " debug " let g:efm_langserver_settings#debug = 1 " let g:efm_langserver_settings#config_file = '' " let g:efm_langserver_settings#debug_file = '' " let g:efm_langserver_settings#customlist = 0 " let g:efm_langserver_settings#config = 1 " let g:efm_langserver_settings#debug = 0 " let g:efm_langserver_settings#filetype_whitelist = [] " let g:efm_langserver_settings#filetype_blacklist = [] ''' [[plugins]] repo = 'mattn/vim-lsp-icons' merged = 0 depends = ['vim-lsp'] # autocomplete [[plugins]] repo = 'prabirshrestha/asyncomplete.vim' hook_add = ''' " let g:asyncomplete_auto_popup = 0 let g:asyncomplete_popup_delay = 200 " default let g:asyncomplete_triggers = extend(get(g:,'asyncomplete_triggers',{}), \ { \ '*' : ['.', '>', ':'], \ }) " completeopt manual set let g:asyncomplete_auto_completeopt = 0 " debug command! AsyncompleteDebugEnable let g:asyncomplete_log_file = expand($HOME . '/asyncomplete.log') command! AsyncompleteDebugDisable unlet g:asyncomplete_log_file " default preprocessor:sort by priority from help " when use asyncomplete-fuzzy-match or other preprocessor, disable it if v:true function! s:sort_by_priority_preprocessor(options, matches) abort let l:items = [] for [l:source_name, l:matches] in items(a:matches) for l:item in l:matches['items'] if stridx(l:item['word'], a:options['base']) == 0 let l:item['priority'] = \ get(asyncomplete#get_source_info(l:source_name), 'priority', 0) call add(l:items, l:item) endif endfor endfor " modify : priority 0 is highest, large number more low. " default : 0 - hightest let l:items = sort(l:items, {a, b -> a['priority'] - b['priority']}) call asyncomplete#preprocess_complete(a:options, l:items) endfunction let g:asyncomplete_preprocessor = [function('s:sort_by_priority_preprocessor')] endif ''' hook_post_source = ''' augroup vimrc_init_asyncomplete autocmd! " asyncomplete original " autocmd CompleteDone * if pumvisible() == 0 | pclose | endif " my refine " autocmd CompleteDone * if pumvisible() | pclose | endif " double popup fix autocmd VimEnter * set completeopt-=popup augroup END imap (asyncomplete_force_refresh) ''' # now fuzz match native support in Vim8, disable it # [[plugins]] # repo = 'tsufeki/asyncomplete-fuzzy-match' # depends = ['asyncomplete.vim', 'async.vim'] # if = 'g:user.function.executable("cargo") && !exists("*matchfuzzypos")' # merged = 0 # build = 'cargo build --release' # [[plugins]] # repo = 'machakann/asyncomplete-unicodesymbol.vim' # depends = ['asyncomplete.vim', 'asyncomplete-ezfilter.vim'] # hook_source = ''' # if v:false # augroup vimrc_init_asyncomplete_unicodesymbol # autocmd! # autocmd User asyncomplete_setup call # \ asyncomplete#register_source( # \ asyncomplete#sources#unicodesymbol#get_source_options({ # \ 'name': 'unicodesymbol', # \ 'allowlist': ['julia', 'text'], # \ 'completor': function('asyncomplete#sources#unicodesymbol#completor'), # \ })) # augroup END # # let g:asyncomplete#preprocessor#ezfilter#config.unicodesymbol = # \ {ctx, items -> filter(items, 'ctx.match(v:val.menu)')} # endif # ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-lsp.vim' depends = ['vim-lsp', 'asyncomplete.vim'] hook_post_source = ''' " priority : default - highest " debug if v:false autocmd User lsp_setup echomsg "lsp_setup execute" autocmd User lsp_register_server echomsg "lsp_register_server execute" autocmd User lsp_unregister_server echomsg "lsp_unregister_server execute" autocmd User lsp_server_init echomsg "lsp_server_init execute" autocmd User lsp_server_exit echomsg "lsp_server_exit execute" autocmd User lsp_complete_done echomsg "lsp_complete_done execute" autocmd User lsp_float_opened echomsg "lsp_float_opened execute" autocmd User lsp_float_closed echomsg "lsp_float_closed execute" autocmd User lsp_buffer_enabled echomsg "lsp_buffer_enabled execute" endif ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-tags.vim' depends = ['asyncomplete.vim'] hook_source = ''' if v:false augroup vimrc_init_asyncomplete_tags autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#tags#get_source_options({ \ 'name': 'tags', \ 'allowlist': ['c','cpp','objc','objcpp','vim','javascript','typescript'], \ 'completor': function('asyncomplete#sources#tags#completor'), \ 'config': { \ 'max_file_size': 350000000, \ }, \ 'priority': 10, \ })) augroup END endif ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-emmet.vim' depends = ['asyncomplete.vim', 'emmet-vim'] hook_source = ''' if v:true augroup vimrc_init_asyncomplete_emmet autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#emmet#get_source_options({ \ 'name': 'emmet', \ 'allowlist': ['html', 'css'], \ 'completor': function('asyncomplete#sources#emmet#completor'), \ 'priority': 10, \ })) augroup END endif ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-file.vim' depends = ['asyncomplete.vim'] hook_source = ''' if v:true augroup vimrc_init_asyncomplete_file autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#file#get_source_options({ \ 'name': 'file', \ 'allowlist': ['*'], \ 'completor': function('asyncomplete#sources#file#completor'), \ 'priority': 10, \ })) augroup END endif ''' [[plugins]] repo = 'akaimo/asyncomplete-around.vim' depends = ['asyncomplete.vim'] hook_add = ''' let g:asyncomplete_around_range = 100 ''' hook_source = ''' if v:true augroup vimrc_init_asyncomplete_around autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#around#get_source_options({ \ 'name': 'around', \ 'allowlist': ['*'], \ 'completor': function('asyncomplete#sources#around#completor'), \ 'priority': 20, \ })) augroup END endif ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-buffer.vim' depends = ['asyncomplete.vim'] hook_source = ''' if v:false augroup vimrc_init_asyncomplete_buffer autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#buffer#get_source_options({ \ 'name': 'buffer', \ 'allowlist': ['*'], \ 'blocklist': ['go','python'], \ 'completor': function('asyncomplete#sources#buffer#completor'), \ 'config': { \ 'max_buffer_size': 700000, \ }, \ 'priority': 20, \ })) augroup END endif ''' [[plugins]] repo = 'prabirshrestha/asyncomplete-emoji.vim' depends = ['asyncomplete.vim'] hook_source = ''' if v:true augroup vimrc_init_asyncomplete_emoji autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#emoji#get_source_options({ \ 'name': 'emoji', \ 'allowlist': ['*'], \ 'completor': function('asyncomplete#sources#emoji#completor'), \ 'priority': 30, \ })) augroup END endif ''' [[plugins]] repo = 'yuki-yano/asyncomplete-dictionary' # repo = 'tsuyoshicho/asyncomplete-dictionary' # rev = 'develop' depends = ['asyncomplete.vim'] hook_source = ''' if v:false augroup vimrc_init_asyncomplete_dictionary autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#dictionary#get_source_options({ \ 'name': 'dictionary', \ 'allowlist': ['*'], \ 'completor': function('asyncomplete#sources#dictionary#completor'), \ 'priority': 40, \ })) augroup END endif ''' [[plugins]] repo = 'high-moctane/asyncomplete-nextword.vim' if = 'g:user.function.executable("nextword")' merged = 0 depends = ['asyncomplete.vim', 'async.vim'] hook_source = ''' if v:false augroup vimrc_init_asyncomplete_nextword autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#nextword#get_source_options({ \ 'name': 'nextword', \ 'allowlist': ['*'], \ 'args': ['-n', '300', '-g'], \ 'completor': function('asyncomplete#sources#nextword#completor'), \ 'priority': 40, \ })) augroup END endif ''' [[plugins]] repo = 'gonzoooooo/asyncomplete-look.vim' # repo = 'tsuyoshicho/asyncomplete-look.vim' # rev = 'develop' if = 'g:user.function.executable("look")' merged = 0 depends = ['asyncomplete.vim', 'async.vim'] hook_source = ''' " 'if' do not stop hook_add, skip hook_source if v:true if len(g:user.file.look) > 0 let g:asyncomplete#sources#look#dict = g:user.file.look[0] augroup vimrc_init_asyncomplete_look autocmd! autocmd User asyncomplete_setup call \ asyncomplete#register_source( \ asyncomplete#sources#look#get_source_options({ \ 'name': 'look', \ 'allowlist': ['*'], \ 'completor': function('asyncomplete#sources#look#completor'), \ 'priority': 40, \ })) augroup END endif endif ''' # [[plugins]] # completion (user completion) # repo = 'junegunn/vim-emoji' # hook_post_source = ''' # " set default user completion function # set completefunc=emoji#complete # # " replace :emoji: to # " try echo unicode # function! s:emoji_unicode_echo () # let l:keywords=&iskeyword # setlocal iskeyword-=: # let l:word = expand('') # let l:gh_word = ':'.l:word.':' # if '' !=? emoji#for(l:word) # echo 'emoji :'.expand('').'-'.emoji#for(l:word) # else # echo 'emoji :'.expand('').'-'.'(no match)' # endif # let &iskeyword=l:keywords # endfunction # # nnoremap e :call emoji_unicode_echo() # # function! s:emoji_unicode_replace () # let l:keywords=&iskeyword # setlocal iskeyword-=: # let l:word = expand('') # if word == '' # let &iskeyword=l:keywords # return # endif # # let l:gh_word = ':'.l:word.':' # if '' !=? emoji#for(l:word) # " カーソル位置をword分前に動かしてから、その位置から後の最初のwordを置換する # " 完了後、位置を移動 # " 123456789ABCD # " smile :smile: # " ^____ origin cursor # " ^____ replace match start (word match pos - colon_size (min:1)) # " ^____ if success; search emoji start (same replace match) # # " smile :smile: # " __^__ origin cursor # " ^____ replace match start (word match pos - colon_size (min:1)) # " ^____ if success; search emoji start (same replace match) # # " smile :smile: # " ________^__ origin cursor # " ___^_______ word matchs start (origin - word len(min:1)) # " ______^____ replace match start (word match pos - colon_size (min:1)) # " ______^____ if success; search emoji start (same replace match) # # let pos = getcurpos() # let word_col = pos[2] # let target_col = pos[2] # if pos[2] != 1 # " 行頭以外は位置補正する # let word_col = pos[2] - strlen(l:word) # if word_col < 1 | let word_col = 1 | endif # # let target_col = word_col # if word_col != 1 # call cursor(pos[1], word_col) # call search(l:word) # # let target_pos = getcurpos() # let target_col = target_pos[2] - 1 " : の分 # if target_col < 1 | let target_col = 1 | endif # endif # endif # # call cursor(pos[1], target_col) # # let l:success = 0 # try # call execute('substitute' . '/' . '\%#'.l:gh_word . '/' . '\=emoji#for(l:word)' . '/') # let l:success = 1 # catch # " let l:success = 0 # finally # call cursor(pos[1], pos[2]) # endtry # # if l:success # call cursor(pos[1], target_col) # call search(emoji#for(l:word), 'z') # endif # # endif # let &iskeyword=l:keywords # endfunction # # nnoremap E :call emoji_unicode_replace() # ''' # CtrlP and other fuzzyfinder/picker # other plugin within ctrlp extension # - vim-pass # - yankround.vim # - spelunker.vim # - (lazy plugins) [[plugins]] repo = 'ctrlpvim/ctrlp.vim' # For collision avoidance, dependent setting : lightline depends = ['vital.vim', 'lightline.vim'] hook_add = ''' " based on http://leafcage.hateblo.jp/entry/2013/10/21/lightlinevim-customize function! CtrlPEnter() let w:lightline = 0 endfunction function! CtrlPLeave() call g:lightline#update() endfunction let g:ctrlp_buffer_func = { \ 'enter': 'CtrlPEnter', \ 'exit' : 'CtrlPLeave' \} " based on https://kamiya555.github.io/2016/07/24/vim-ctrlp/ " キャッシュディレクトリ let g:ctrlp_use_caching = 1 let g:ctrlp_cache_dir = expand(g:user.dir.cache_home . '/ctrlp') call g:user.function.mkdir(g:ctrlp_cache_dir) " CtrlPのウィンドウ最大高さ autocmd vimrc_init_core VimEnter,VimResized * \ let g:ctrlp_match_window = 'max:' . string(min([(&lines/3), 20]) - 1) let g:ctrlp_brief_prompt = 1 " let g:ctrlp_user_command_async = 1 " input japanese let g:ctrlp_key_loop = 1 " based on https://qiita.com/0829/items/7053b6e3371592e4fbe6 " based on https://christina04.hatenablog.com/entry/2014/10/30/100612 " based on https://postd.cc/how-to-boost-your-vim-productivity/ if g:user.function.executable('files') let s:fallback_cmd = 'cd %s && files -m ""' " ripgrep only support glob -g / -l search and filename only " elseif g:user.function.executable('rg') " let s:fallback_cmd = 'rg --color never -S -l "" %s' elseif g:user.function.executable('pt') let s:fallback_cmd = 'pt --nocolor --nogroup -S -g "" %s' elseif g:user.function.executable('ag') let s:fallback_cmd = 'ag -a --nocolor --nogroup -S -g "" %s' " jvgrep no support filename match " elseif g:user.function.executable('jvgrep') " let s:fallback_cmd = 'jvgrep --no-color -Rril "" %s' endif if exists('s:fallback_cmd') if g:user.function.executable('nkf') let s:fallback_cmd = s:fallback_cmd . ' | nkf -w' endif endif let g:ctrlp_user_command = { \ 'types': { \ 1: ['.git', 'git -C %s ls-files' ], \ 2: ['.hg', 'hg --cwd %s locate -I .'], \ 3: ['.svn', 'cd %s && svn ls .' ], \ 4: ['.bzr', 'cd %s && bzr ls .' ], \ }, \ } if exists('s:fallback_cmd') let g:ctrlp_use_caching = 0 let g:ctrlp_user_command = extend(g:ctrlp_user_command, \ { 'fallback': s:fallback_cmd }, "keep") endif " let g:ctrlp_cmd = 'CtrlP' " default " ext let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + [ 'dir' ,'line' , 'undo', 'changes','mixed' ] let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['tag'] ''' hook_post_source = ''' let s:List = g:V.import('Data.List') " ルートパスと認識させるためのファイル let g:ctrlp_root_markers = s:List.concat([ \ g:user.rootmarker.dirs, \ g:user.rootmarker.files]) unlet s:List " 無視するディレクトリ let g:ctrlp_custom_ignore = {} let g:ctrlp_custom_ignore['dir'] = \ '\v[\/](' \ . escape(join(g:user.ignore.dirs, '|'), '.') \ . ')$' let g:ctrlp_custom_ignore['file'] = \ '\v\.(' \ . escape(join(g:user.ignore.filetype, '|'), '.') \ . ')$' " matcher if dein#is_sourced('ctrlp-matchfuzzy') && exists('*matchfuzzy') let g:ctrlp_match_func = {'match' : 'ctrlp_matchfuzzy#matcher'} " fastest for built-in function let g:ctrlp_lazy_update = 10 elseif dein#is_sourced('fruzzy') && g:user.system.nvim let g:ctrlp_match_func = {'match': 'fruzzy#ctrlp#matcher'} " fast but python call small heavy let g:ctrlp_lazy_update = 20 elseif dein#is_sourced('ctrlp-py-matcher') && has('python3') " python2 deprecated let g:ctrlp_match_func = {'match' : 'pymatcher#PyMatch'} " fast but python call small heavy let g:ctrlp_lazy_update = 20 else " normal search more heavy let g:ctrlp_lazy_update = 50 endif ''' [[plugins]] repo = 'FelikZ/ctrlp-py-matcher' depends = ['ctrlp.vim'] # config in ctrlp.vim [[plugins]] # based on https://blog.kaneshin.co/entry/vim-advent-calendar-2012 repo = 'kaneshin/ctrlp-git-log' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['git_log'] ''' [[plugins]] # based on https://mattn.kaoriya.net/software/vim/20120427205409.htm repo = 'mattn/ctrlp-mark' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['mark'] ''' [[plugins]] # based on https://mattn.kaoriya.net/software/vim/20120427205409.htm repo = 'mattn/ctrlp-register' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['register'] ''' [[plugins]] # based on https://mattn.kaoriya.net/software/vim/20120427205409.htm repo = 'mattn/ctrlp-launcher' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['launcher'] let g:ctrlp_launcher_file = expand(g:user.dir.vim . '/launcher') nmap :CtrlPLauncher ''' [[plugins]] repo = 'ompugao/ctrlp-history' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['history/search', 'history/cmd'] ''' [[plugins]] repo = 'suy/vim-ctrlp-commandline' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['commandline'] ''' [[plugins]] repo = 'prabirshrestha/ctrlp-env' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['env'] ''' [[plugins]] repo = 'ompugao/ctrlp-locate' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['locate'] ''' [[plugins]] repo = 'hara/ctrlp-colorscheme' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['colorscheme'] ''' [[plugins]] repo = 'endel/ctrlp-filetype.vim' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['filetype'] ''' [[plugins]] repo = 'sgur/ctrlp-extensions.vim' depends = ['ctrlp.vim'] hook_add = ''' " ['yankring', 'menu', 'cmd'] " yank use LeafCage/yankround.vim let g:ctrlp_yankring_disable = 1 " let g:ctrlp_yankring_limit = 50 " default 100 " let g:ctrlp_yankring_minimum_chars = 4 " default 2 let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['menu', 'cmd'] let g:ctrlp_cmd = 'CtrlPMenu' " menu override ''' [[plugins]] repo = 'zeero/vim-ctrlp-help' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['help'] ''' [[plugins]] repo = 'DavidEGx/ctrlp-smarttabs' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['smarttabs'] " let g:ctrlp_smarttabs_modify_tabline = 1 " If 1 will highlight the selected file in the tabline. " (Default: 1) " let g:ctrlp_smarttabs_reverse = 1 " Reverse the order in which files are displayed. " (Default: 1) let g:ctrlp_smarttabs_exclude_quickfix = 1 " Exclude quickfix buffers. " (Default: 0) ''' [[plugins]] repo = 'mattn/ctrlp-lsp' depends = ['vim-lsp', 'ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['lsp_document_symbol', 'lsp_workspace_symbol'] ''' [[plugins]] repo = 'tsuyoshicho/ctrlp-mr.vim' # rev = 'develop' depends = ['ctrlp.vim', 'mr.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['mr/mru', 'mr/mrw', 'mr/mrr'] " " if need, enable " let g:ctrlp_mr_mru_curdir_base = v:true " let g:ctrlp_mr_mrw_curdir_base = v:true " let g:ctrlp_mr_mrr_curdir_base = v:true ''' [[plugins]] repo = 'prabirshrestha/quickpick.vim' [[plugins]] repo = 'prabirshrestha/quickpick-lsp.vim' depends = ['vim-lsp', 'quickpick.vim'] [[plugins]] # w3m,lynx,wwwrenderer-vimのどれかが必要 repo = 'thinca/vim-ref' # repo = 'tsuyoshicho/vim-ref' # rev = 'develop' depends = ['wwwrenderer-vim'] # if= 'g:user.function.executable("lynx")' 現在の環境構築ではパスを通してない hook_add = ''' " " 自動設定 " let g:ref_source_webdict_cmd " " 'lynx -dump -nonumbers %s' " " '=wwwrenderer#render("%s")' " " " same as ref_source_webdict_cmd " let g:ref_rfc_cmd ''' [[plugins]] # JavaDoc repo = 'LeafCage/ref-javadoc' depends = ['vim-ref'] hook_add = ''' " " 自動設定 " " same as ref_source_webdict_cmd " let g:ref_javadoc_cmd " " localpath " let g:ref_javadoc_path ''' [[plugins]] # info repo = 'eiiches/vim-ref-info' depends = ['vim-ref'] # QuickRun & AsyncRun [[plugins]] repo = 'osyo-manga/quickrun-hook-u-nya-' [[plugins]] repo = 'mattn/vim-quickrunex' [[plugins]] repo = 'heavenshell/vim-quickrun-hook-unittest' # [[plugins]] # repo = 'D:\Data\ReposWork\git\vim-quickrun-progress-job' # merged = 0 # repo = 'tsuyoshicho/vim-quickrun-progress-job' # rev = 'develop' [[plugins]] repo = 'thinca/vim-quickrun' depends = ['vim-altercmd', 'quickrun-hook-u-nya-', 'open-browser.vim', 'vim-quickrunex', 'vim-quickrun-hook-unittest'] hook_add = ''' " config let g:quickrun_config = get(g:, 'quickrun_config', {}) " global let g:quickrun_config['_'] = extend({ \ 'outputter' : 'error', \ 'outputter/error/success' : 'buffer', \ 'outputter/error/error' : 'multi', \ 'outputter/multi/targets' : ['loclist', 'popup'], \ 'outputter/loclist/open_cmd' : '', \ 'outputter/buffer/opener' : ':rightbelow 8sp', \ 'outputter/buffer/close_on_empty' : 1, \ 'outputter/buffer/running_mark' : '[running...]', \ "hook/slash/enable" : 1, \ 'hook/u_nya_/enable' : 1, \}, get(g:quickrun_config, '_', {}), "keep") " per filetype let s:quickrun_filetype_encode_fixlist = ['python', 'ruby', 'markdown'] " vim let g:quickrun_config['vim'] = extend({ \ 'hook/slash/enable' : 0, \}, get(g:quickrun_config, 'vim', {}), "keep") " markdown let g:quickrun_config['markdown'] = extend({ \ 'type' : 'markdown/pandoc', \ 'outputter' : 'browser', \}, get(g:quickrun_config, 'markdown', {}), "keep") " python let g:quickrun_config['python'] = extend({ \ 'hook/time/enable' : 1, \}, get(g:quickrun_config, 'python', {}), "keep") " ruby let g:quickrun_config['ruby'] = extend({ \ 'hook/time/enable' : 1, \}, get(g:quickrun_config, 'ruby', {}), "keep") " c++ if g:user.function.executable('clang++') let g:quickrun_config['cpp'] = extend({ \ 'type' : 'cpp/clang++', \}, get(g:quickrun_config, 'cpp', {}), "keep") elseif g:user.function.executable('g++') let g:quickrun_config['cpp'] = extend({ \ 'type' : 'cpp/g++', \}, get(g:quickrun_config, 'cpp', {}), "keep") endif " c if g:user.function.executable('clang') let g:quickrun_config['c'] = extend({ \ 'type' : 'c/clang', \}, get(g:quickrun_config, 'c', {}), "keep") elseif g:user.function.executable('gcc') let g:quickrun_config['c'] = extend({ \ 'type' : 'c/gcc', \}, get(g:quickrun_config, 'c', {}), "keep") endif " typescript let g:quickrun_config['typescript'] = extend({ \ 'type': g:user.function.executable('ts-node') ? 'typescript/ts-node' : \ g:user.function.executable('tsc') ? 'typescript/tsc' : \ g:user.function.executable('deno') ? 'typescript/deno' : \ '', \}, get(g:quickrun_config, 'typescript', {}), "keep") " from ycino " tsc command check run as root let g:quickrun_config['typescript/tsc/noemit'] = extend({ \ 'command': 'tsc', \ 'exec': ['%c --project . --noEmit --incremental --tsBuildInfoFile .git/.tsbuildinfo'], \ 'outputter' : 'loclist', \ 'outputter/loclist/errorformat' : '%+A %#%f %#(%l\,%c): %m,%C%m', \}, get(g:quickrun_config, 'typescript/tsc/noemit', {}), "keep") " deno let g:quickrun_config['typescript/deno'] = extend({ \ 'command' : 'deno', \ 'cmdopt' : 'run', \ 'hook/output_encode/enable' : 1, \ 'hook/output_encode/fileformat' : 'unix', \ 'outputter/loclist/errorformat' : '%A%*[^:]: TS%n [%t%*[A-Z]]: %m,%Z at file:\/\/\/%f:%l:%n,%C %m,%-GCheck%.%#' , \}, get(g:quickrun_config, 'typescript/deno', {}), "keep") " shift jis: 'cp932' " shift jis: 'cp65001' if g:user.system.windows for s:typename in s:quickrun_filetype_encode_fixlist let g:quickrun_config[s:typename]['hook/output_encode/enable'] = 1 let g:quickrun_config[s:typename]['hook/output_encode/encoding'] = 'cp932' let g:quickrun_config[s:typename]['hook/output_encode/fileformat'] = 'unix' endfor unlet s:typename endif " unittest let g:quickrun_config['php.unit'] = extend({ \ 'command' : 'testrunner', \ 'cmdopt' : 'phpunit', \}, get(g:quickrun_config, 'php.unit', {}), "keep") let g:quickrun_config['python.unit'] = extend({ \ 'command' : 'nosetests', \ 'cmdopt' : '-v -s', \}, get(g:quickrun_config, 'python.unit', {}), "keep") let g:quickrun_config['python.pytest'] = extend({ \ 'command' : 'pytest', \ 'cmdopt' : '-v', \}, get(g:quickrun_config, 'python.pytest', {}), "keep") " Django unittest let g:quickrun_config['python.django'] = extend({ \ 'command' : 'python', \ 'cmdopt' : 'test --pararell=2 --keepdb -v2', \}, get(g:quickrun_config, 'python.django', {}), "keep") " " pytest-django " let g:quickrun_config['python.django'] = extend({ " \ 'command' : 'python', " \ 'cmdopt' : 'test --noinput -- --verbose --reuse-db', " \ 'test_fw' : 'pytest', " \}, get(g:quickrun_config, 'python.django', {}), "keep") let g:quickrun_config['ruby.rspec'] = extend({ \ 'command' : 'rspec', \ 'cmdopt' : '-f d', \}, get(g:quickrun_config, 'ruby.rspec', {}), "keep") let g:quickrun_config['ruby.minitest'] = extend({ \ 'command' : 'ruby', \}, get(g:quickrun_config, 'ruby.minitest', {}), "keep") let g:quickrun_config['go.test'] = extend({ \ 'command' : 'go', \ 'cmdopt' : 'test -v', \}, get(g:quickrun_config, 'go.test', {}), "keep") let g:quickrun_config['typescript.jest'] = extend({ \ 'command' : 'jest', \}, get(g:quickrun_config, 'typescript.jest', {}), "keep") let g:quickrun_config['javascript.mocha'] = extend({ \ 'command' : 'mocha', \}, get(g:quickrun_config, 'javascript.mocha', {}), "keep") let g:quickrun_config['javascript.jest'] = extend({ \ 'command' : 'jest', \}, get(g:quickrun_config, 'javascript.jest', {}), "keep") function! s:runner_setup() abort if dein#tap('vim-quickrun-progress-job') let g:quickrun_config._['runner'] = 'progress_job' elseif g:user.plugin.info.vimproc.ok() let g:quickrun_config._['runner'] = 'vimproc' let g:quickrun_config._['runner/vimproc/sleep'] = 30 let g:quickrun_config._['runner/vimproc/updatetime'] = 50 elseif has('job') || (g:user.system.nvim && dein#tap('vim-quickrun-neovim-job')) if g:user.system.nvim let g:quickrun_config._['runner'] = 'neovim_job' else let g:quickrun_config._['runner'] = 'job' endif else let g:quickrun_config._['runner'] = 'system' endif endfunction augroup vimrc_init_quickrun autocmd! autocmd VimEnter * nested :call s:runner_setup() " quickrun lsp exclude need, but do not work... " all foldmethod manual setting autocmd FileType quickrun setlocal foldmethod=manual foldexpr=0 " temp off : use Quickrun python.pytest instead " " unittest " autocmd BufWinEnter,BufNewFile *test.php setlocal filetype=php.unit " " Choose UnitTest, py.test or Django. " " autocmd BufWinEnter,BufNewFile test_*.py setlocal filetype=python.unit " autocmd BufWinEnter,BufNewFile test_*.py setlocal filetype=python.pytest " " autocmd BufWinEnter,BufNewFile test_*.py setlocal filetype=python.django " autocmd BufWinEnter,BufNewFile *.t setlocal filetype=perl.unit " autocmd BufWinEnter,BufNewFile *_spec.rb setlocal filetype=ruby.rspec " autocmd BufWinEnter,BufNewFile *_test.rb setlocal filetype=ruby.minitest " autocmd BufWinEnter,BufNewFile *_test.go setlocal filetype=go.test " " TypeScript support only Jest " autocmd BufWinEnter,BufNewFile *.spec.ts setlocal filetype=typescript.jest " " Choose Mocha or Jest " " autocmd BufWinEnter,BufNewFile *.test.js setlocal filetype=javascript.mocha " " autocmd BufWinEnter,BufNewFile *.test.js setlocal filetype=javascript.jest augroup END " keymap info let g:user.plugin.info.whichkey.desc.leader['q'] = { \ 'name' : '+QuickRun', \ } " mapping " thanks lambdalisue nmap qr (quickrun) " Terminate the quickrun with nnoremap quickrun#is_running() ? quickrun#sweep_sessions() : "\" ''' hook_post_source = ''' let s:slash_hook = { \ "name" : "slash", \ "kind" : "hook", \ "config" : { \ "enable" : 0, \ "shellslash" : 0, \ } \} function! s:slash_hook.on_hook_loaded(session, context) abort if self.config.enable && exists('+shellslash') let self.config.shellslash = &shellslash set noshellslash endif endfunction function! s:slash_hook.on_exit(session, context) abort if self.config.enable && exists('+shellslash') let &shellslash = self.config.shellslash endif endfunction call quickrun#module#register(s:slash_hook, 1) unlet s:slash_hook " :QuickRun 時に quickfix の中身をクリアする " こうしておかないと quickfix の中身が残ったままになってしまうため let s:clear_hook = { \ "name" : "clear_quickfix", \ "kind" : "hook", \} function! s:clear_hook.on_normalized(session, context) call setqflist([]) endfunction call quickrun#module#register(s:clear_hook, 1) unlet s:clear_hook if dein#is_sourced('vim-precious') nmap qo (precious-quickrun-op) endif nnoremap qt :QuickRun -mode n -runner job -hook/unittest/enable 1 " thanks ycino AlterCommand r[un] QuickRun AlterCommand r[un] QuickRun ''' [[plugins]] repo = 'skywind3000/asyncrun.vim' depends = ['vital.vim'] hook_post_source = ''' let s:List = g:V.import('Data.List') let g:asyncrun_rootmarks = s:List.concat([ \ g:user.rootmarker.dirs, \ g:user.rootmarker.files]) unlet s:List " cooperate with vim-fugitive wrapper command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ ''' # UI # based on https://tmnm.tech/2017/10/11/vim-setting-with-cica/ # need powerline,devicons font [[plugins]] repo = 'ryanoasis/vim-devicons' hook_add = ''' " フォルダアイコンの表示をON let g:WebDevIconsUnicodeDecorateFolderNodes = 1 let g:NERDTreeDirArrowExpandable = nr2char(0xf0da) "  nf-fa-caret_right let g:NERDTreeDirArrowCollapsible = nr2char(0xf0d7) "  nf-fa-caret_down let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols = get(g:, 'WebDevIconsUnicodeDecorateFileNodesExtensionSymbols', {}) let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['html'] = nr2char(0xe736) " '' let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['css'] = nr2char(0xe749) " '' let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['markdown'] = nr2char(0xf48a) " '' let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['md'] = nr2char(0xf48a) " '' let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['txt'] = nr2char(0xf0f6) " '' let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols = get(g:, 'WebDevIconsUnicodeDecorateFileNodesExactSymbols', {}) let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['pipfile'] = nr2char(0xe73c) " '' ''' [[plugins]] repo = 'lambdalisue/nerdfont.vim' hook_add = ''' let g:nerdfont#path#extension#customs = get(g:, 'nerdfont#path#extension#customs', {}) let g:nerdfont#path#extension#customs['html'] = nr2char(0xe736) " '' let g:nerdfont#path#extension#customs['css'] = nr2char(0xe749) " '' let g:nerdfont#path#extension#customs['markdown'] = nr2char(0xf48a) " '' let g:nerdfont#path#extension#customs['md'] = nr2char(0xf48a) " '' let g:nerdfont#path#extension#customs['txt'] = nr2char(0xf0f6) " '' let g:nerdfont#path#basename#customs = get(g:, 'nerdfont#path#basename#customs', {}) let g:nerdfont#path#basename#customs['pipfile'] = nr2char(0xe73c) " '' " ctrlp settings " stop webdevicon setting (when vim-devicons both installed blocker) let g:webdevicons_enable_ctrlp = 0 let g:ctrlp_formatline_func = 's:formatline(s:curtype() == "buf" ? v:val : nerdfont#find(v:val) . " " . v:val)' ''' [[plugins]] repo = 'lambdalisue/glyph-palette.vim' hook_add = ''' " custom glyph let g:glyph_palette#palette = get(g:, 'glyph_palette#palette', copy(g:glyph_palette#defaults#palette)) let g:glyph_palette#palette['GlyphPalette3'] += [ \ nr2char(0xe736), \ nr2char(0xe749), \ nr2char(0xf48a), \ nr2char(0xf0f6), \ ] ''' [plugins.ftplugin] fern = ''' call glyph_palette#apply() ''' startify = ''' call glyph_palette#apply() ''' ctrlp = ''' call glyph_palette#apply() ''' # currently off # [[plugins]] # repo = 'wsdjeg/dein-ui.vim' # depends = ['dein.vim'] # hook_add = ''' # let g:spacevim_plugin_manager = 'dein' # let g:spacevim_plugin_manager_max_processes = 4 # ''' [[plugins]] repo = 'haya14busa/dein-command.vim' depends = ['dein.vim'] [[plugins]] repo = 'mopp/sky-color-clock.vim' depends = ['vim-pass'] hook_add = ''' " Configure variables. " let g:sky_color_clock#color_stops let g:sky_color_clock#datetime_format = '%m/%d(%a) %H:%M' let g:sky_color_clock#enable_emoji_icon = 1 " let g:sky_color_clock#openweathermap_api_key = "" call pass#get_startup('g:sky_color_clock#openweathermap_api_key','Develop/OpenWeatherMap') let g:sky_color_clock#temperature_color_stops = [ \ [263, '#f0f8ff'], \ [288, '#ffffff'], \ [313, '#dc143c'] \ ] let g:sky_color_clock#latitude = g:user.location.latitude let g:sky_color_clock#openweathermap_city_id = g:user.location.cityid ''' # Git [[plugins]] repo = 'tpope/vim-git' hook_add = ''' let g:gitcommit_cleanup = 'scissors' ''' [[plugins]] repo = 'tpope/vim-fugitive' hook_post_source = ''' augroup vimrc_init_fugitive autocmd! " based on https://qiita.com/yuku_t/items/0c1aff03949cb1b8fe6b autocmd QuickFixCmdPost Ggrep nested cwindow augroup END ''' [plugins.ftplugin] fugitiveblame = ''' " see https://vi.stackexchange.com/questions/11502/how-to-execute-a-command-when-leaving-the-fugitiveblame-window " nnoremap q :qwincmd = nnoremap q :q= ''' [[plugins]] repo = 'skanehira/gh.vim' depends = ['vim-pass'] hook_source = ''' " github token call pass#get_startup('g:gh_token','Develop/Github') ''' [[plugins]] repo = 'tpope/vim-rhubarb' depends = ['vim-fugitive','vim-pass'] if = 'g:user.function.executable("hub")' merged = 0 hook_add = ''' " github token call pass#get_startup('g:RHUBARB_TOKEN','Develop/Github') ''' [plugins.ftplugin] gitcommit = ''' setlocal omnifunc=rhubarb#omnifunc ''' gitrebase = ''' setlocal omnifunc=rhubarb#omnifunc ''' [[plugins]] # git log show repo = 'junegunn/gv.vim' depends = ['vim-fugitive'] hook_add = ''' ''' [[plugins]] repo = 'idanarye/vim-merginal' depends = ['vim-fugitive'] [[plugins]] repo = 'cohama/agit.vim' # git is installed, need for basic [[plugins]] repo = 'lambdalisue/gina.vim' # git is installed, need for basic [[plugins]] repo = 'rhysd/git-messenger.vim' [[plugins]] # git commit repo = 'teddywing/vim-gitcha' [[plugins]] # git rebase repo = 'hotwatermorning/auto-git-diff' hook_add = ''' let g:auto_git_diff_command_options = '--stat -p --submodule -C' ''' [plugins.ftplugin] gitrebase = ''' " git rebase diff setup nmap (auto_git_diff_scroll_manual_update) nmap (auto_git_diff_scroll_down_half) nmap (auto_git_diff_scroll_up_half) ''' [[plugins]] repo = 'mhinz/vim-signify' hook_add = ''' let g:signify_sign_add = nr2char(0x271a) " '✚' let g:signify_sign_change = nr2char(0x279c) " '➜' let g:signify_sign_delete = nr2char(0x2718) " '✘' let g:signify_sign_delete_first_line = nr2char(0x2717) " '✗' " highlight line " let g:signify_line_highlight = 1 ''' hook_post_source = ''' " Need a quick update updatetime set updatetime=200 " highlight SignifySignAdd guifg=#009900 guibg= ctermfg=2 ctermbg= " highlight SignifySignChange guifg=#bbbb00 guibg= ctermfg=3 ctermbg= " highlight SignifySignDelete guifg=#ff2222 guibg= ctermfg=1 ctermbg= " highlight gui=underlined term=underlined cterm=underlined " highlight SignifySignDeleteFirstLine " highlight link SignifySignDeleteFirstLine SignifySignDelete " keymap info let g:user.plugin.info.whichkey.desc.leader['h'] = { \ 'name' : '+Signify', \ } nnoremap hp :SignifyHunkDiff nnoremap hu :SignifyHunkUndo " nnoremap hs : " staging ''' # [[plugins]] # repo = 'gotchane/vim-git-commit-prefix' [[plugins]] repo = 'rhysd/conflict-marker.vim' hook_add = ''' " disable the default highlight group let g:conflict_marker_highlight_group = '' " Include text after begin and end markers let g:conflict_marker_begin = '^<<<<<<< .*$' let g:conflict_marker_end = '^>>>>>>> .*$' highlight ConflictMarkerBegin guibg=#2f7366 highlight ConflictMarkerOurs guibg=#2e5049 highlight ConflictMarkerTheirs guibg=#344f69 highlight ConflictMarkerEnd guibg=#2f628e ''' # self create plugin statusline updater [[plugins]] repo = 'tsuyoshicho/StatuslineUpateTimer.vim' hook_add = ''' " update evenly 15sec let g:StatuslineUpdateTimer#updatetime = 15 * 1000 " set adjust let g:StatuslineUpdateTimer#adjust_minute = 1 ''' [[plugins]] repo = 'KabbAmine/vCoolor.vim' [[plugins]] repo = 'itchyny/lightline.vim' hook_add = ''' " lightline setting in lightline-delphinus " debug " let g:lightline = {} " breakadd expr g:lightline " Based on https://github.com/itchyny/lightline.vim/issues/228 function! LightlineCharcode() abort let line = getline('.') let col = col('.') " return col - 1 < len(line) ? printf('C:%02x', char2nr(matchstr(line[(col - 1):], '^.'))) : 'C: ' let codestr = ' ' if col - 1 < len(line) let matched_char = matchstr(line[(col - 1):], '^.') let codestr = printf('%s:%6x', matched_char, char2nr(matched_char)) endif return codestr endfunction ''' hook_post_source = ''' ''' [[plugins]] repo = 'taohexxx/lightline-buffer' depends = ['lightline.vim', 'vim-devicons'] hook_add = ''' " lightline-buffer setting in lightline-delphinus " lightline-buffer ui settings " replace these symbols with ascii characters if your environment does not support unicode let g:lightline_buffer_logo = nr2char(0xe7c5) " original ' ' let g:lightline_buffer_readonly_icon = '' let g:lightline_buffer_modified_icon = '⭐' let g:lightline_buffer_git_icon = ' ' let g:lightline_buffer_ellipsis_icon = '..' let g:lightline_buffer_expand_left_icon = '◀ ' let g:lightline_buffer_expand_right_icon = ' ▶' " let g:lightline_buffer_active_buffer_left_icon = '⬅️' " let g:lightline_buffer_active_buffer_right_icon = '➡️' " let g:lightline_buffer_separator_icon = ' ' " enable devicons, only support utf-8 " require let g:lightline_buffer_enable_devicons = 1 " lightline-buffer function settings let g:lightline_buffer_show_bufnr = 1 " :help filename-modifiers " let g:lightline_buffer_fname_mod = ':t' let g:lightline_buffer_fname_mod = ':p:~' " " hide buffer list " let g:lightline_buffer_excludes = ['vimfiler'] " " " max file name length " let g:lightline_buffer_maxflen = 30 " " " max file extension length " let g:lightline_buffer_maxfextlen = 3 " " " min file name length " let g:lightline_buffer_minflen = 16 " " " min file extension length " let g:lightline_buffer_minfextlen = 3 " " reserve length for other component (e.g. info, close) let g:lightline_buffer_reservelen = 30 ''' hook_post_source = ''' " need lightline-buffer " " 常にタブラインを表示 " set showtabline=2 " " バッファが編集中でもその他のファイルを開けるように " set hidden " " remap arrow keys " nnoremap :bprev " nnoremap :bnext " nnoremap :tabprevious " nnoremap :tabnext " current lightline-buffer off " gui use text tabline " if has('gui_running') " set guioptions-=e " endif ''' [[plugins]] repo = 'micchy326/lightline-lsp-progress' hook_add = ''' let g:lsp_work_done_progress_enabled = 1 ''' [[plugins]] repo = 'tsuyoshicho/lightline-lsp' # rev = 'develop' depends = ['lightline.vim'] hook_add = ''' let g:lightline#lsp#server_interval = 60 if has('gui_running') let g:lightline#lsp#indicator_checking = "\uf110" let g:lightline#lsp#indicator_warning = "\uf071" let g:lightline#lsp#indicator_error = "\uf05e" let g:lightline#lsp#indicator_information = "\uf05a" let g:lightline#lsp#indicator_hint = "\uf0e5" let g:lightline#lsp#indicator_ok = "\uf00c" endif ''' [[plugins]] repo = 'mkalinski/vim-lightline_tabpagecount' depends = ['lightline.vim'] hook_add = ''' let g:lightline_tabpagecount#format = '(w:%d,b:%d)' ''' # lightline setting use lightline-delphinus # based on https://qiita.com/delphinus/items/af5809b587f2af0a9f7f [[plugins]] repo = 'delphinus/lightline-delphinus' # repo = 'tsuyoshicho/lightline-delphinus' # rev = 'develop' depends = ['lightline.vim', 'lightline-buffer', 'vim-lightline_tabpagecount', 'vim-devicons', 'vim-anzu', 'vim-submode', 'lightline-lsp', 'lightline-lsp-progress', 'vista.vim', 'vim-signify', 'gina.vim', 'StatuslineUpateTimer.vim'] # 設定するフォントは powerline patched hook_add = ''' let g:lightline_delphinus_use_powerline_glyphs = 1 let g:lightline_delphinus_use_nerd_fonts_glyphs = 1 let g:lightline_delphinus_colorscheme = 'solarized_improved' " let g:lightline_delphinus_colorscheme = 'nord_improved' ''' hook_post_source = ''' " enable setting " let g:lightline_delphinus_tagbar_enable = 1 " let g:lightline_delphinus_gitgutter_enable = 1 let g:lightline_delphinus_signify_enable = 1 let s:gina_regex_fts = join(copy(g:user.filetype['ignore_git']), "\\|") function! Lightline_components_gina() abort if &buftype ==# 'terminal' || &filetype =~# 'denite' || winwidth(0) < 100 return '' endif try let s:branch_glyph = '' if g:lightline_delphinus_use_powerline_glyphs let s:branch_glyph = "\ue0a0" "  endif if &filetype !~? s:gina_regex_fts let head = gina#component#repo#branch() if head !=? '' let head = s:branch_glyph . head endif return head endif catch endtry return '' endfunction " charcode use LightlineCharcode instead of lightline#delphinus#components#charcode let g:lightline = { \ 'colorscheme': g:lightline_delphinus_colorscheme, \ 'active': { \ 'left' : [ \ [ 'mode', 'paste' ], \ [ 'gitbranch', 'filepath', 'filename', 'method' ], \ [ 'signify', 'lsp_count', 'lsp_ok', 'lsp_status_ok', 'lsp_status_error', 'lsp_status_warning', 'lsp_status' ] \ ], \ 'right': [ \ [ 'lineinfo', 'percent', 'sky_color_clock' ], \ [ 'fileformat', 'fileencoding', 'filetype', 'char_code' ], \ [ 'anzu', 'submode' ], \ ], \ }, \ 'inactive': { \ 'left' : [ [ 'filepath' ], [ 'filename' ] ], \ 'right' : [ [ 'sky_color_clock' ], [ 'lineinfo' ], [ 'percent' ] ], \ }, \ 'component': { \ 'sky_color_clock' : "%#SkyColorClock#%{' ' . sky_color_clock#statusline() . ' ' . StatuslineUpdateTimer#emoji_clock() . ' '}%#SkyColorClockTemp# ", \ 'separator' : nr2char(0xff9e8), \ }, \ 'component_function': { \ 'modified': 'lightline#delphinus#components#modified', \ 'readonly': 'lightline#delphinus#components#readonly', \ 'fugitive': 'lightline#delphinus#components#fugitive', \ 'filepath': 'lightline#delphinus#components#filepath', \ 'filename': 'lightline#delphinus#components#filename', \ 'fileformat': 'lightline#delphinus#components#fileformat', \ 'filetype': 'lightline#delphinus#components#filetype', \ 'fileencoding': 'lightline#delphinus#components#fileencoding', \ 'mode': 'lightline#delphinus#components#mode', \ 'char_code': 'LightlineCharcode', \ 'lineinfo': 'lightline#delphinus#components#lineinfo', \ 'percent': 'lightline#delphinus#components#percent', \ 'currenttag': 'lightline#delphinus#components#currenttag', \ 'gitgutter': 'lightline#delphinus#components#gitgutter', \ 'signify': 'lightline#delphinus#components#signify', \ 'lsp_count': 'lightline#lsp#count', \ 'lsp_ok': 'lightline#lsp#ok', \ 'lsp_status': 'lightline_lsp_progress#progress', \ 'method': 'NearestMethodOrFunction', \ 'anzu': 'anzu#search_status', \ 'gitbranch': 'Lightline_components_gina', \ 'submode': 'submode#current', \ 'bufferinfo': 'lightline#buffer#bufferinfo', \ }, \ 'component_function_visible_condition': { \ 'mode': 1, \ 'currenttag': 0, \ 'char_code': 0, \ 'fileformat': 0, \ 'filetype': 0, \ 'fileencoding': 0, \ }, \ 'component_expand': { \ 'lsp_status_error': 'lightline#lsp#status_error', \ 'lsp_status_warning': 'lightline#lsp#status_warning', \ 'lsp_status_ok': 'lightline#lsp#status_ok', \ 'buffercurrent': 'lightline#buffer#buffercurrent', \ 'bufferbefore': 'lightline#buffer#bufferbefore', \ 'bufferafter': 'lightline#buffer#bufferafter', \ }, \ 'component_type': { \ 'lsp_status_error': 'error', \ 'lsp_status_warning': 'warning', \ 'lsp_status_ok': 'ok', \ 'buffercurrent': 'tabsel', \ 'bufferbefore': 'raw', \ 'bufferafter': 'raw', \ }, \ 'component_raw': { \ 'sky_color_clock': 1, \ }, \ 'separator': { 'left': nr2char(0xe0b0), 'right': nr2char(0xe0b2) }, \ 'subseparator': { 'left': nr2char(0xe0b1), 'right': nr2char(0xe0b3) }, \ 'tab_component_function': { \ 'tabpagecount': 'lightline_tabpagecount#component', \ }, \ 'tab': { \ 'active' : ['tabnum', 'filename', 'tabpagecount', 'modified'], \ 'inactive' : ['tabnum', 'filename', 'tabpagecount', 'modified'], \ }, \ 'tabline': { \ 'left' : [ [ 'bufferinfo' ], \ [ 'separator' ], \ [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], \ 'right' : [ [ 'close' ], ], \ }, \} " lightline-buffer mix-safety " \ 'tabline': { " \ 'left' : [ [ 'bufferinfo' ], " \ [ 'separator' ], " \ [ 'tabs' ], ], " \ 'right' : [ [ 'close' ], ], " \ }, " lightline-buffer native " \ 'tabline': { " \ 'left' : [ [ 'bufferinfo' ], " \ [ 'separator' ], " \ [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], " \ 'right' : [ [ 'close' ], ], " \ }, " colorscheme setting in night-and-day " force re-init call lightline#init() call lightline#colorscheme() call lightline#update() ''' [[plugins]] # repo = 'nightsense/night-and-day' repo = 'tsuyoshicho/night-and-day' # rev = 'develop' rev = 'feature/autoload' merged = 0 depends = ['lightline-delphinus'] hook_add = ''' " " colorscheme 処理 - 必要な依存関係は処理すること " if has('gui_running') " " set background=light " set background=dark " augroup vimrc_init_night_and_day " autocmd! " autocmd VimEnter * nested colorscheme gruvbox | autocmd! vimrc_init_night_and_day " augroup END " else " " set background=light " " icebergはdark固定 " set background=dark " augroup vimrc_init_night_and_day " autocmd! " autocmd VimEnter * nested colorscheme iceberg | autocmd! vimrc_init_night_and_day " augroup END " endif " g:nd_themes setting template if has('gui_running') let g:nd_themes = [ \ ['sunrise+0', 'iceberg', 'light', 'iceberg' ], \ ['sunrise+1/2', 'edge', 'light', 'edge' ], \ ['sunset+0', 'rigel', 'dark', 'rigel' ], \ ['sunset+1/3', 'dracula', 'dark', 'dracula' ], \ ['sunset+2/3', 'gruvbox', 'dark', 'gruvbox' ], \] else let g:nd_themes = [ \ ['sunrise+0', 'rigel', 'dark', 'rigel' ], \ ['sunset+0', 'dracula', 'dark', 'dracula' ], \] endif let g:nd_latitude = '30' " Asia/Tokyo 35 let g:nd_timeshift = '0' " shift minutes " " debug " let g:nd_themes = [ " \ ['09:00', 'gruvbox', 'dark', 'gruvbox'], " \ ['18:12', 'iceberg', 'dark', 'iceberg'], " \] let g:nd_lightline = 1 ''' # Edit operation # [[plugins]] # repo = 'matze/vim-move' # depends = ['vim-submode'] # hook_add = ''' # " default map disable # let g:move_map_keys = 0 # " setting with submode # # " indent adjust? # let g:move_auto_indent = 0 # " endofline limit? -> nolimit # let g:move_past_end_of_line = 1 # ''' # hook_post_source = ''' # " normal mode line move # call submode#enter_with('linemove', 'n', 'r', 'Mj', 'MoveLineDown') # call submode#enter_with('linemove', 'n', 'r', 'Mk', 'MoveLineUp') # call submode#leave_with('linemove', 'n', 'r', '') # call submode#map('linemove', 'n', 'r', 'j', 'MoveLineDown') # call submode#map('linemove', 'n', 'r', 'k', 'MoveLineUp') # # " visual mode block move # call submode#enter_with('blockmove', 'x', 'r', 'Mj', 'MoveBlockDown') # call submode#enter_with('blockmove', 'x', 'r', 'Mk', 'MoveBlockUp') # call submode#enter_with('blockmove', 'x', 'r', 'Mh', 'MoveBlockLeft') # call submode#enter_with('blockmove', 'x', 'r', 'Ml', 'MoveBlockRight') # call submode#leave_with('blockmove', 'x', 'r', '') # call submode#map('blockmove', 'x', 'r', 'j', 'MoveBlockDown') # call submode#map('blockmove', 'x', 'r', 'k', 'MoveBlockUp') # call submode#map('blockmove', 'x', 'r', 'h', 'MoveBlockLeft') # call submode#map('blockmove', 'x', 'r', 'l', 'MoveBlockRight') # ''' [[plugins]] repo = 't9md/vim-textmanip' depends = ['vim-submode'] hook_add = ''' " default map disable(default) let g:textmanip_enable_mappings = 0 let g:textmanip_move_ignore_shiftwidth = 1 ''' hook_post_source = ''' " visual mode move call submode#enter_with('blockmove', 'x', 'r', 'Mk', '(textmanip-move-up)' ) call submode#enter_with('blockmove', 'x', 'r', 'Mj', '(textmanip-move-down)' ) call submode#enter_with('blockmove', 'x', 'r', 'Mh', '(textmanip-move-left)' ) call submode#enter_with('blockmove', 'x', 'r', 'Ml', '(textmanip-move-right)') call submode#leave_with('blockmove', 'x', 'r', '') call submode#map('blockmove', 'x', 'r', 'k', '(textmanip-move-up)' ) call submode#map('blockmove', 'x', 'r', 'j', '(textmanip-move-down)' ) call submode#map('blockmove', 'x', 'r', 'h', '(textmanip-move-left)' ) call submode#map('blockmove', 'x', 'r', 'l', '(textmanip-move-right)') call submode#map('blockmove', 'x', 'r', 't', '(textmanip-toggle-mode)') ''' [[plugins]] repo = 'tyru/columnskip.vim' hook_post_source = ''' " like tmhedberg/indent-motion nmap sk (columnskip:nonblank:prev) omap sk (columnskip:nonblank:prev) xmap sk (columnskip:nonblank:prev) nmap sj (columnskip:nonblank:next) omap sj (columnskip:nonblank:next) xmap sj (columnskip:nonblank:next) nmap sK (columnskip:first-nonblank:prev) omap sK (columnskip:first-nonblank:prev) xmap sK (columnskip:first-nonblank:prev) nmap sJ (columnskip:first-nonblank:next) omap sJ (columnskip:first-nonblank:next) xmap sJ (columnskip:first-nonblank:next) ''' # [[plugins]] # repo = 'haya14busa/vim-edgemotion' # hook_post_source = ''' # " map (edgemotion-j) # " map (edgemotion-k) # # map (edgemotion-j) # map (edgemotion-k) # ''' # [[plugins]] # repo = 'bronson/vim-trailing-whitespace' # hook_add = ''' # " disable # let g:extra_whitespace_ignored_filetypes = copy(g:user.filetype['ignore_whitespace']) # ''' [[plugins]] repo = 'ntpeters/vim-better-whitespace' hook_add = ''' " disable let g:better_whitespace_filetypes_blacklist = copy(g:user.filetype['ignore_whitespace']) " strip eof blankline let g:strip_whitelines_at_eof=1 ''' [[plugins]] repo = 'lambdalisue/trimmer.vim' [[plugins]] repo = 'thinca/vim-zenspace' hook_post_source = ''' " https://qiita.com/tmsanrinsha/items/d6c11f2b7788eb24c776 " add non zenspace (UCS spaces) augroup vimrc_init_zenspace autocmd! autocmd VimEnter,WinEnter * nested match ZenSpace /\%u180E\|\%u2000\|\%u2001\|\%u2002\|\%u2003\|\%u2004\|\%u2005\|\%u2006\|\%u2007\|\%u2008\|\%u2009\|\%u200A\|\%u2028\|\%u2029\|\%u202F\|\%u205F\|\%u3000/ augroup END ''' [[plugins]] repo = 'junegunn/goyo.vim' hook_post_source = ''' " currently, statusline update and enter/leave (rel)number " manipulation conflict. nnoremap :Goyo ''' [[plugins]] repo = 'junegunn/limelight.vim' hook_add = ''' if !has('gui_running') " Color name (:help cterm-colors) or ANSI code let g:limelight_conceal_ctermfg = 'gray' let g:limelight_conceal_ctermfg = 240 else " Color name (:help gui-colors) or RGB color let g:limelight_conceal_guifg = 'DarkGray' let g:limelight_conceal_guifg = '#777777' endif " Default: 0.5 " let g:limelight_default_coefficient = 0.7 " Number of preceding/following paragraphs to include (default: 0) " let g:limelight_paragraph_span = 1 " Beginning/end of paragraph " When there's no empty line between the paragraphs " and each paragraph starts with indentation " let g:limelight_bop = '^\s' " let g:limelight_eop = '\ze\n^\s' " Highlighting priority (default: 10) " Set it to -1 not to overrule hlsearch " let g:limelight_priority = -1 ''' hook_post_source = ''' " with Goyo autocmd vimrc_init_core User GoyoEnter Limelight autocmd vimrc_init_core User GoyoLeave Limelight! ''' [[plugins]] # repo = 'nathanaelkane/vim-indent-guides' repo = 'Bakudankun/vim-indent-guides' hook_add = ''' " based on https://wonderwall.hatenablog.com/entry/2016/03/21/205741 " based on https://qiita.com/Layzie/items/a1c8d14bccb14c02eb1b " vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1 " 無効にしたいファイルタイプ let g:indent_guides_exclude_filetypes = g:user.filetype.ignore_indent " マッピングは使わない let g:indent_guides_default_mapping = 0 ''' # # exclusive : need indent-guide off # [[plugins]] # repo = 'Yggdroot/indentLine' # hook_add = ''' # " enable # " let g:indentLine_enabled = 0 # let g:indentLine_enabled = 1 # # " need UTF-8 ┆ U+2506 # " let g:indentLine_first_char = '┆' # " let g:indentLine_char = '┆' # " need UTF-8 ⦙ U+299A # let g:indentLine_first_char = '⦙' # let g:indentLine_char = '⦙' # " need patched font :  nf-indent-line / e621 # " let g:indentLine_first_char = nr2char(0xe621) # " let g:indentLine_char = nr2char(0xe621) # # " no conceal for edit # let g:indentLine_fileTypeExclude = ['startify', 'json'] # let g:indentLine_bufTypeExclude = ['help', 'terminal'] # # " conceallevel/concealcursor set in vimrc # let g:indentLine_setConceal = 0 # ''' # hook_post_source = ''' # " based on http://d.hatena.ne.jp/osyo-manga/20140722/1406040828 # augroup vimrc_init_indentLine # autocmd! # " precious.vim が filetype を切り替える度に indentLine をリセットする # autocmd User PreciousFileType IndentLinesReset # augroup END # ''' # commentout [[plugins]] repo = 'tyru/caw.vim' depends = ['vim-operator-user', 'vim-repeat'] # operator-user : mapping improve # repeat : repeat action work fine # latest vim support auto bracket # [[plugins]] # repo = 'ConradIrwin/vim-bracketed-paste' [[plugins]] repo = 'tweekmonster/braceless.vim' hook_add = ''' let g:braceless_block_key = 'B' let g:braceless_jump_prev_key = 'B' let g:braceless_jump_next_key = 'B' ''' [plugins.ftplugin] python = ''' BracelessEnable " indent: vim-python-pep8-indent " fold : lsp fold ''' haml = ''' BracelessEnable +indent +fold +highlight ''' yaml = ''' BracelessEnable +indent +fold +highlight ''' coffee = ''' BracelessEnable +indent +fold +highlight ''' [[plugins]] repo = 'editorconfig/editorconfig-vim' # repo = 'sgur/vim-editorconfig' hook_add = ''' " editorconfig/editorconfig-vim let g:EditorConfig_exclude_patterns = [ \ 'fugitive://.*', \ 'scp://.*', \ 'fern://.*', \ 'gh://.*', \ 'readingvimrc://.*', \] " sgur/vim-editorconfig " editorconfig rootがある場合は、そこを起点とした相対処理にする " let g:editorconfig_root_chdir = 1 " default:0 ''' [[plugins]] repo = 'mattn/vim-sonictemplate' hook_add = ''' " user template let g:sonictemplate_vim_template_dir = expand(g:user.dir.config_home . '/template') call g:user.function.mkdir(g:sonictemplate_vim_template_dir) " always my name let g:sonictemplate_vim_vars = { \ '_': { \ 'author': g:user.name, \ }, \} " which key C-Y info set in emmet ''' [[plugins]] repo = 'andymass/vim-matchup' hook_add = ''' " let g:matchup_matchparen_enabled = 0 " if use parenmatch " deliver text object a%/i% ''' [[plugins]] # paren match rainbow repo = 'luochen1990/rainbow' hook_add = ''' let g:rainbow_active = 1 let g:rainbow_conf = { \ 'separately': { \ 'vim': { \ 'parentheses': [ \ 'start=/(/ end=/)/', \ 'start=/\[/ end=/\]/', \ 'start=/{/ end=/}/ fold', \ 'start=/if/ step=/elseif\|else/ end=/|\?endif/ fold', \ ], \ 'parentheses_options': 'containedin=vimFuncBody,vimExecute', \ }, \ }, \} ''' [[plugins]] repo = 't9md/vim-quickhl' hook_add = ''' let g:quickhl_manual_enable_at_startup = 1 " normally work itchyny/vim-cursorword let g:quickhl_cword_enable_at_startup = 0 " currently not work yet. let g:quickhl_tag_enable_at_startup = 0 let g:quickhl_manual_keywords = [ \ { 'pattern': '\c\', 'regexp': 1 }, \ { 'pattern': '\C\<\(TODO\|FIXME\|NOTE\|INFO\)\>', 'regexp': 1 }, \ { 'pattern': '\C\<\(ToC\|WIP\)\>', 'regexp': 1 }, \ { 'pattern': '\C\*\<[A-Z0-9]\+\>\*', 'regexp': 1 }, \] " which key let g:user.plugin.info.whichkey.mapkey = extend(g:user.plugin.info.whichkey.mapkey, { \ '' : { 'rawkey' : " " , 'desc' : g:user.plugin.info.whichkey.desc.space }, \}) ''' hook_post_source = ''' nmap m (quickhl-manual-this) xmap m (quickhl-manual-this) nmap M (quickhl-manual-reset) xmap M (quickhl-manual-reset) nmap j (quickhl-cword-toggle) " nmap ] (quickhl-tag-toggle) ''' [[plugins]] repo = 'cohama/lexima.vim' hook_add = ''' let g:lexima_no_default_rules = 1 let g:lexima_enable_basic_rules = 1 let g:lexima_enable_newline_rules = 1 let g:lexima_enable_space_rules = 1 let g:lexima_enable_endwise_rules = 1 " self process define : need abnormal completion process(like asyncomplete) " let g:lexima_accept_pum_with_enter = 0 let g:lexima_map_escape = '(lexima-esc)' let g:lexima_ctrlh_as_backspace = 1 ''' hook_post_source = ''' " initialize default rules call lexima#clear_rules() call lexima#set_default_rules() " add rule set let s:additional_rules = [] " suport plantuml,... let s:cr_key = '' let s:additional_rules = s:additional_rules + [ \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@enduml', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@enduml', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@endgantt', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@endgantt', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@endditaa', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@endditaa', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@enddot', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@enddot', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@endsalt', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@endsalt', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@endwbs', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@endwbs', \ 'syntax': [], \ }, \ { \ 'filetype': ['plantuml'], \ 'char': '', \ 'input': s:cr_key, \ 'at': '\%(^\s*#.*\)\@.*\%#', \ 'input_after': '' . '@endmindmap', \ 'except': '\c\v^(\s*)\s.*%#\n%(%(\s*|\1\s.+)\n)*\1' . '\@endmindmap', \ 'syntax': [], \ }, \] unlet s:cr_key " rule from https://github.com/rinx/dotfiles/blob/master/vimrc " markdown let s:additional_rules = s:additional_rules + [ \ {'filetype': ['markdown'], 'char': '**', 'input_after': '**'}, \ {'filetype': ['markdown'], 'char': '__', 'input_after': '__'}, \ {'filetype': ['markdown'], 'char': '~~', 'input_after': '~~'}, \ {'filetype': ['markdown'], 'char': '', 'at': '\*\%#\*', 'delete': 1}, \ {'filetype': ['markdown'], 'char': '', 'at': '_\%#_', 'delete': 1}, \ {'filetype': ['markdown'], 'char': '', 'at': '\~\%#\~', 'delete': 1}, \ {'filetype': ['markdown'], 'char': '', 'at': '^\s*\*\s.*\%#', 'input': '*'}, \ {'filetype': ['markdown'], 'char': '', 'at': '^\s*+\s.*\%#', 'input': '+'}, \ {'filetype': ['markdown'], 'char': '', 'at': '^\s*-\s.*\%#', 'input': '-'}, \] " from https://github.com/cohama/.vim/blob/master/dein.toml " {'filetype': ['markdown'], 'char': '', 'at': '^```\(\S*\)\%#```', 'input': 'kS'}, let s:additional_rules = s:additional_rules + [ \ {'filetype': ['markdown'], 'char': '#', 'at': '^\%#', 'input': '#' }, \ {'filetype': ['markdown'], 'char': '#', 'at': '^#\+ \%#', 'input': '#' }, \ {'filetype': ['markdown'], 'char': '', 'at': '^##\+ \%#', 'input': ''}, \ {'filetype': ['markdown'], 'char': '', 'at': '^# \%#', 'input': '' }, \] " vimspec " from https://github.com/cohama/.vim/blob/master/dein.toml let s:additional_rules = s:additional_rules + [ \ { \ 'filetype': ['vimspec'], \ 'char': '', \ 'at': '^\s*\%(Describe\|Context\|It\|Before\|After\)\s\+.*\%#', \ 'input_after': 'End', \ }, \] " vim, vimspec " from https://github.com/cohama/.vim/blob/master/dein.toml " custom " ignore stype ["String", "Comment"] " vimspec support " [] support " indent fix let s:additional_rules = s:additional_rules + [ \ { \ 'filetype': ['vim', 'vimspec'], \ 'char': '', \ 'input': '', \ 'at': '{\%#}', \ 'input_after': '', \ }, \ { \ 'filetype': ['vim', 'vimspec'], \ 'char': '', \ 'input': '', \ 'at': '\[\%#\]', \ 'input_after': '', \ }, \ { \ 'filetype': ['vim', 'vimspec'], \ 'char': '', \ 'input': '', \ 'at': '\\\s.*\%#$', \ }, \] " add rule for s:rule in s:additional_rules call lexima#add_rule(s:rule) endfor unlet s:rule s:additional_rules " http://secret-garden.hatenablog.com/entry/2015/05/21/194914 " http://secret-garden.hatenablog.com/entry/2015/05/06/211712 " keymapping " see https://qiita.com/yami_beta/items/26995a5c382bd83ac38f inoremap =lexima#insmode#leave(1, 'C-G>URIGHT>') " popup support CR/space(If completion popup is exists, decision completion) " add_rules overwrite CR/space mapping " move to vimrc ''' # [[plugins]] # repo = 'deathlyfrantic/lexima-template-rules' # depends = ['lexima.vim'] # 上手く動かない # [[plugins]] # repo = 'dkarter/bullets.vim' # hook_add = ''' # " key map conflict # " let g:bullets_set_mappings = 0 # let g:bullets_mapping_leader = '' # # let g:bullets_enable_in_empty_buffers = 1 # " let g:bullets_enabled_file_types = ['markdown', 'text', 'gitcommit'] # ''' [[plugins]] repo = 'justinmk/vim-gtfo' # [[plugins]] # repo = 'deris/vim-shot-f' # [[plugins]] # repo = 'rhysd/clever-f.vim' # hook_add = ''' # " let g:clever_f_ignore_case = 1 # let g:clever_f_smart_case = 1 # let g:clever_f_use_migemo = 1 # let g:clever_f_fix_key_direction = 1 # let g:clever_f_chars_match_any_signs = ";:" # # let g:clever_f_not_overwrites_standard_mappings = 1 # ''' # hook_post_source = ''' # nmap f (clever-f-f) # xmap f (clever-f-f) # omap f (clever-f-f) # nmap F (clever-f-F) # xmap F (clever-f-F) # omap F (clever-f-F) # " t use tab # " nmap t (clever-f-t) # " xmap t (clever-f-t) # " omap t (clever-f-t) # " nmap T (clever-f-T) # " xmap T (clever-f-T) # " omap T (clever-f-T) # ''' [[plugins]] repo = 'hrsh7th/vim-eft' hook_add = ''' let g:eft_ignorecase = v:true ''' hook_post_source = ''' silent! nunmap [Subleader]; nmap [Subleader]; (eft-repeat) xmap [Subleader]; (eft-repeat) nmap f (eft-f-repeatable) xmap f (eft-f-repeatable) omap f (eft-f-repeatable) nmap F (eft-F-repeatable) xmap F (eft-F-repeatable) omap F (eft-F-repeatable) " t use tab " nmap t (eft-t-repeatable) " xmap t (eft-t-repeatable) " omap t (eft-t-repeatable) " nmap T (eft-T-repeatable) " xmap T (eft-T-repeatable) " omap T (eft-T-repeatable) ''' [[plugins]] repo = 'bkad/CamelCaseMotion' hook_post_source = ''' " normal/operator/visual only / no work select nnoremap [CamelCaseMotion] nmap c [CamelCaseMotion] nmap [CamelCaseMotion]w CamelCaseMotion_w nmap [CamelCaseMotion]b CamelCaseMotion_b nmap [CamelCaseMotion]e CamelCaseMotion_e onoremap [CamelCaseMotion] omap c [CamelCaseMotion] omap [CamelCaseMotion]w CamelCaseMotion_w omap [CamelCaseMotion]b CamelCaseMotion_b omap [CamelCaseMotion]e CamelCaseMotion_e xnoremap [CamelCaseMotion] xmap c [CamelCaseMotion] xmap [CamelCaseMotion]w CamelCaseMotion_w xmap [CamelCaseMotion]b CamelCaseMotion_b xmap [CamelCaseMotion]e CamelCaseMotion_e ''' [[plugins]] repo = 'kana/vim-smartword' depends =['CamelCaseMotion'] hook_post_source = ''' nmap w (smartword-w) nmap b (smartword-b) nmap e (smartword-e) nmap ge (smartword-ge) xmap w (smartword-w) xmap b (smartword-b) xmap e (smartword-e) xmap ge (smartword-ge) omap w (smartword-w) omap b (smartword-b) omap e (smartword-e) omap ge (smartword-ge) " support CamelCaseMotion combine map (smartword-basic-w) CamelCaseMotion_w map (smartword-basic-b) CamelCaseMotion_b map (smartword-basic-e) CamelCaseMotion_e map (smartword-basic-ge) CamelCaseMotion_ge " need smartword-basic map nmap w (smartword-basic-w) nmap b (smartword-basic-b) nmap e (smartword-basic-e) nmap ge (smartword-basic-ge) xmap w (smartword-basic-w) xmap b (smartword-basic-b) xmap e (smartword-basic-e) xmap ge (smartword-basic-ge) omap w (smartword-basic-w) omap b (smartword-basic-b) omap e (smartword-basic-e) omap ge (smartword-basic-ge) ''' [[plugins]] repo = 'kana/vim-niceblock' [[plugins]] repo = 'kana/vim-gf-user' # repo = 'tsuyoshicho/vim-gf-user' # rev = 'develop' [[plugins]] repo = 'kana/vim-gf-diff' depends =['vim-gf-user'] [[plugins]] repo = 'sgur/vim-gf-autoload' depends =['vim-gf-user'] [[plugins]] repo = 'haya14busa/vim-signjk-motion' [[plugins]] repo = 'easymotion/vim-easymotion' depends = ['vim-repeat', 'vim-signjk-motion'] hook_add = ''' " based on http://haya14busa.com/mastering-vim-easymotion/ " based on http://haya14busa.com/vim_migemo_search/ " based on http://haya14busa.com/vim-lazymotion-on-speed/ " based on http://haya14busa.com/vim-easymotion-ver-3-dot-0-overwin-motions/ " Disable default mapping let g:EasyMotion_do_mapping = 0 " if g:user.function.executable('cmigemo') " endif " 一応常に設定 let g:EasyMotion_use_migemo = 1 " smartcase let g:EasyMotion_smartcase = 1 let g:EasyMotion_use_smartsign_jp = 1 " use repeat '.' let g:EasyMotion_keys='hklyuiopnm,qwertzxcvbasdgjf;' " keep cursor colum JK motion let g:EasyMotion_startofline = 0 " Jump to first match with enter & space let g:EasyMotion_enter_jump_first = 1 let g:EasyMotion_space_jump_first = 1 ''' hook_post_source = ''' " select unmap default silent! sunmap " f{char} to move to {char} nmap f (easymotion-overwin-f) xmap f (easymotion-bd-f) omap f (easymotion-bd-f) " s{char}{char} to move to {char}{char} " s to ss nmap ss (easymotion-overwin-f2) xmap ss (easymotion-bd-f2) omap ss (easymotion-bd-f2) " Move to line " omap l (textobj-signjk-lines) " xmap l (textobj-signjk-lines) nmap l (easymotion-overwin-line) xmap l (easymotion-bd-jk) omap l (easymotion-bd-jk) " JK motions: Line motions " map j (signjk-j) " map k (signjk-k) nmap j (easymotion-j) xmap j (easymotion-j) omap j (easymotion-j) nmap k (easymotion-k) xmap k (easymotion-k) omap k (easymotion-k) " " Start of Line JK(temp off conflict jplus) " nmap J (easymotion-sol-j) " xmap J (easymotion-sol-j) " omap J (easymotion-sol-j) " nmap K (easymotion-sol-k) " xmap K (easymotion-sol-k) " omap K (easymotion-sol-k) " Move to word(comflisct smartword normal w op use W) nmap W (easymotion-overwin-w) xmap W (easymotion-bd-w) omap W (easymotion-bd-w) " Move to search nmap n (easymotion-bd-n) xmap n (easymotion-bd-n) omap n (easymotion-bd-n) ''' [[plugins]] repo = 'junegunn/vim-easy-align' hook_add = ''' let g:easy_align_bypass_fold = 1 ''' hook_post_source = ''' " see https://wonderwall.hatenablog.com/entry/2016/03/29/215904 " map to gA " Start interactive EasyAlign for a motion/text object (e.g. gAip) nmap gA (EasyAlign) " Start interactive EasyAlign in visual mode (e.g. vipgA) xmap gA (EasyAlign) ''' [[plugins]] repo = 'severin-lemaignan/vim-minimap' # repo = 'koron/minimap-vim' hook_post_source = ''' nmap :MinimapToggle ''' [[plugins]] # Doxygen repo = 'vim-scripts/DoxygenToolkit.vim' # repo = 'JohnBro/DoxygenToolkit.vim' depends = ['vital.vim', 'vim-fileheader'] # use setting hook_post_source = ''' let s:now = g:V.import('DateTime').now() let s:year = string(s:now.year()) " basic " let g:DoxygenToolkit_briefTag_pre = '@brief ' " let g:DoxygenToolkit_briefTag_post = '' " let g:DoxygenToolkit_templateParamTag_pre = '@tparam ' " let g:DoxygenToolkit_templateParamTag_post = '' " let g:DoxygenToolkit_paramTag_pre = '@param ' " let g:DoxygenToolkit_paramTag_post = '' " let g:DoxygenToolkit_returnTag = '@return ' " let g:DoxygenToolkit_throwTag_pre = '@throw ' " @exception is also valid " let g:DoxygenToolkit_throwTag_post = '' " let g:DoxygenToolkit_fileTag = '@file ' " let g:DoxygenToolkit_authorTag = '@author ' " let g:DoxygenToolkit_dateTag = '@date ' " let g:DoxygenToolkit_versionTag = '@version ' " let g:DoxygenToolkit_undocTag = 'DOX_SKIP_BLOCK' " let g:DoxygenToolkit_blockTag = '@name ' " let g:DoxygenToolkit_classTag = '@class ' " format tuning : default OK " let g:DoxygenToolkit_cinoptions = 'c1C1' " Work area format " simple delay (git user/email async get in fileheader plugin) let g:DoxygenToolkit_authorName = g:user.git.name " use current develop user name " projct specfic " let g:DoxygenToolkit_blockHeader = '' " let g:DoxygenToolkit_blockFooter = '' " let g:DoxygenToolkit_licenseTag = 'need simple license string: (C) 2009 - ' . s:year . ' xxx Corporation All rights reserved.' " let g:DoxygenToolkit_versionString = 1.0 " let g:DoxygenToolkit_compactOneLineDoc = 'no' " let g:DoxygenToolkit_compactDoc = 'no' " let g:DoxygenToolkit_ignoreForReturn = " Style " let g:DoxygenToolkit_commentType = 'C++' let g:DoxygenToolkit_commentType = 'C' " C type " let g:DoxygenToolkit_startCommentTag = '/** ' " let g:DoxygenToolkit_startCommentBlock = '/* ' " let g:DoxygenToolkit_interCommentTag = '* ' " let g:DoxygenToolkit_interCommentBlock = '* ' " let g:DoxygenToolkit_endCommentTag = '*/' " let g:DoxygenToolkit_endCommentBlock = '*/' " C++ type " let g:DoxygenToolkit_startCommentTag = '/// ' " let g:DoxygenToolkit_startCommentBlock = '// ' " let g:DoxygenToolkit_interCommentTag = '/// ' " let g:DoxygenToolkit_interCommentBlock = '// ' " let g:DoxygenToolkit_endCommentTag = '' " let g:DoxygenToolkit_endCommentBlock = '' " need tuning " let g:DoxygenToolkit_maxFunctionProtoLines = 10 " let g:DoxygenToolkit_briefTag_className = 'no' " let g:DoxygenToolkit_briefTag_structName = 'no' " let g:DoxygenToolkit_briefTag_enumName = 'no' " let g:DoxygenToolkit_briefTag_namespaceName = 'no' " let g:DoxygenToolkit_briefTag_funcName = 'no' " let g:DoxygenToolkit_keepEmptyLineAfterComment = 'no' " let g:DoxygenToolkit_python_autoRemoveSelfParam = 'yes' " let g:DoxygenToolkit_python_autoFunctionReturn = 'yes' ''' [[plugins]] # Doxygen and other repo = 'kkoomen/vim-doge' # [[plugins]] # PowerShell # repo = 'PProvost/vim-ps1' # imported to vim official [[plugins]] repo = 'liuchengxu/vista.vim' # repo = 'tsuyoshicho/vista.vim' # rev = 'develop' depends = ['vim-lsp', 'lightline.vim', 'fzf', 'fzf.vim'] hook_add = ''' " indent let g:vista_icon_indent = ["╰─▸ ", "├─▸ "] " default ctags let g:vista_default_executive = 'ctags' " lsp enable let g:vista_executive_for = { \ 'cpp' : 'vim_lsp', \ 'sh' : 'vim_lsp', \ 'vim' : 'vim_lsp', \ 'python' : 'vim_lsp', \ 'markdown' : 'toc', \ } let g:vista_update_on_text_changed = 1 " Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind. let g:vista#renderer#enable_icon = 1 " The default icons can't be suitable for all the filetypes, you can extend it as you wish. let g:vista#renderer#icons = { \ "function": nr2char(0xf0ad), \ "variable": nr2char(0xf0ae), \ } "\ "function": nr2char(0xf0ad), " 0xf0ad  "\ "variable": nr2char(0xf0ae), " 0xf0ae  "\ "function": nr2char(0xf794), " 0xf794 󿞔 "\ "variable": nr2char(0xf71b), " 0xf71b 󿜛 function! NearestMethodOrFunction() abort return get(b:, 'vista_nearest_method_or_function', '') endfunction augroup vimrc_init_vista autocmd! autocmd VimEnter,BufEnter,BufWinEnter,InsertEnter * \ nested call vista#RunForNearestMethodOrFunction() autocmd User lsp_server_init \ nested call vista#RunForNearestMethodOrFunction() augroup END " keymap info let g:user.plugin.info.whichkey.desc.leader['v'] = { \ 'name' : '+Vista', \ } nnoremap :Vista!! nnoremap vv :Vista!! nnoremap vf :Vista finder ''' # [[plugins]] # Chrome/Firefox GhostText Extention # repo = 'pandysong/ghost-text.vim' [[plugins]] # GnuPG Encrypt repo = 'jamessan/vim-gnupg' # [[plugins]] # RFC # repo = 'zh4ui/vim-rfc-reader' # [plugins.ftplugin] # ref-rfc = ''' # " vim-ref rfcと連携 # setlocal filetype=rfc # ''' [[plugins]] # RFC repo = 'vim-scripts/rfc-syntax' # repo = 'dhulihan/vim-rfc' [plugins.ftplugin] ref-rfc = ''' " vim-ref rfcと連携 setlocal filetype=rfc ''' [[plugins]] # vimref repo = 'cowsys/ctrlp-vimref' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['vimref'] ''' [[plugins]] # Qiita repo = 'mattn/qiita-vim' depends = ['ctrlp.vim'] hook_add = ''' let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', []) \ + ['qiita'] ''' [[plugins]] # Slack repo = 'higashi000/sarahck.vim' depends = ['slackstatus.vim', 'webapi-vim','vim-pass'] [[plugins]] # Slack repo = 'mizukmb/slackstatus.vim' depends = ['webapi-vim','vim-pass'] hook_add = ''' " slackstatus.vim use g:slackstatus_token " sarahck.vim use g:slackToken " team m-falcon call pass#get_startup('g:slackstatus_token','Message/Slack/team-m-falcon.legacy') call pass#get_startup('g:slackToken', 'Message/Slack/team-m-falcon.legacy') " vim-jp " call pass#get_startup('g:slackstatus_token','Message/Slack/vim-jp.legacy') " call pass#get_startup('g:slackToken', 'Message/Slack/vim-jp.legacy') function! s:slack_team_completion(A,L,P) abort let team_list = ['team-m-falcon','vim-jp'] return join(team_list,"\n") endfunction function! s:slack_token_change(team) abort let path = 'Message/Slack/' . a:team . '.legacy' let token = pass#get(path) let g:slackstatus_token = token let g:slackToken = token endfunction command! -nargs=1 -complete=custom,slack_team_completion SlackWorkspaceChange :call slack_token_change() ''' [[plugins]] # Mastodon repo = 'mattn/vim-mastodon' depends = ['webapi-vim','vim-pass'] hook_add = ''' " mstdn.jp let g:mastodon_host = 'mstdn.jp' call pass#get_startup('g:mastodon_access_token','Message/Mastodon/mstdn.jp') function! s:mastodon_completion(A,L,P) abort let host_list = ['mstdn.jp'] return join(host_list,"\n") endfunction function! s:mastodon_change_hosttoken(host) abort let path = 'Message/Mastodon/' . a:host let g:mastodon_host = a:host let g:mastodon_access_token = pass#get(path) endfunction command! -nargs=1 -complete=custom,mastodon_completion MastodonHostChange :call mastodon_change_hosttoken() ''' [[plugins]] # man repo = 'lambdalisue/vim-manpager' [[plugins]] # fzf repo = 'junegunn/fzf' merged = 0 [[plugins]] repo = 'junegunn/fzf.vim' merged = 0 depends = ['fzf'] hook_add = ''' let g:fzf_command_prefix = 'Fzf' " fzfからファイルにジャンプできるようにする let g:fzf_buffers_jump = 1 " Customize fzf colors to match your color scheme let g:fzf_colors = { \ 'fg': ['fg', 'Normal'], \ 'bg': ['bg', 'Normal'], \ 'hl': ['fg', 'Comment'], \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], \ 'hl+': ['fg', 'Statement'], \ 'info': ['fg', 'PreProc'], \ 'border': ['fg', 'Ignore'], \ 'prompt': ['fg', 'Conditional'], \ 'pointer': ['fg', 'Exception'], \ 'marker': ['fg', 'Keyword'], \ 'spinner': ['fg', 'Label'], \ 'header': ['fg', 'Comment'], \} ''' hook_post_source = ''' " see https://qiita.com/hisawa/items/fc5300a526cb926aef08 " ,でタグ検索 nnoremap :call fzf#vim#tags(expand('')) " based on https://qiita.com/Sa2Knight/items/6635af9fc648a5431685 nnoremap [fzf] nmap z [fzf] function! s:fzf_command(cmd) abort return g:fzf_command_prefix . a:cmd endfunction nnoremap [fzf]f ':' . fzf_command('GFiles') . '' nnoremap [fzf]F ':' . fzf_command('GFiles?') . '' nnoremap [fzf]b ':' . fzf_command('Buffers') . '' nnoremap [fzf]l ':' . fzf_command('BLines') . '' nnoremap [fzf]h ':' . fzf_command('History') . '' nnoremap [fzf]m ':' . fzf_command('Mark') . '' ''' [[plugins]] # fzf repo = 'n04ln/yankee.vim' depends = ['fzf'] hook_add = ''' let g:yankee_buf_list = [ \ '""', '"*', '"+', '"^', \ '":', '".', '"%', \ '"0', '"1', '"2', '"3', '"4', '"5', '"6', '"7', '"8', '"9', \ '"a', '"b', '"c', '"d', '"e', '"f', '"g', '"h', '"i', '"j', \] ''' [[plugins]] # orgmode repo = 'jceb/vim-orgmode' [[plugins]] # memo repo = 'Shougo/junkfile.vim' hook_add = ''' let g:junkfile#directory = expand(g:user.dir.cache_home . '/junkfile') call g:user.function.mkdir(g:junkfile#directory) ''' [[plugins]] # memo repo = 'mattn/vim-gist' depends = ['vim-pass'] hook_add = ''' " let g:gist_token = '' call pass#get_startup('g:github_user','Develop/Github','username') call pass#get_startup('g:gist_token','Develop/Github') ''' [[plugins]] # memo repo = 'glidenote/memolist.vim' depends = ['ctrlp.vim'] hook_add = ''' let g:memolist_path = expand(g:user.dir.vim . '/memo') call g:user.function.mkdir(g:memolist_path) let g:memolist_template_dir_path = expand(g:user.dir.config_home . '/template/memo') call g:user.function.mkdir(g:memolist_template_dir_path) nnoremap mn :MemoNew nnoremap ml :MemoList nnoremap mg :MemoGrep " suffix type (default markdown) let g:memolist_memo_suffix = "md" " date format (default %Y-%m-%d %H:%M) " ISO8601 " let g:memolist_memo_date = "%FT%T%z" let g:memolist_memo_date = "%F" " tags prompt (default 0) " let g:memolist_prompt_tags = 1 " categories prompt (default 0) let g:memolist_prompt_categories = 1 " use qfixgrep (default 0) " let g:memolist_qfixgrep = 1 " use vimfiler (default 0) " let g:memolist_vimfiler = 1 " use fzf (default 0) " let g:memolist_fzf = 1 " remove filename prefix (default 0) " let g:memolist_filename_prefix_none = 1 " use unite (default 0) " let g:memolist_unite = 1 " use arbitrary unite source (default is 'file') " let g:memolist_unite_source = "file_rec" " use arbitrary unite option (default is empty) " let g:memolist_unite_option = "-auto-preview -start-insert" " use denite (default 0) " let g:memolist_denite = 1 " use arbitrary denite source (default is 'file_rec') " let g:memolist_denite_source = "anything" " use arbitrary denite option (default is empty) " let g:memolist_denite_option = "anything" " use various Ex commands (default '') let g:memolist_ex_cmd = 'CtrlP' " use delimiter of array in yaml front matter (default is ' ') let g:memolist_delimiter_yaml_array = ',' " use when get items from yaml front matter " first line string pattern of yaml front matter (default "==========") let g:memolist_delimiter_yaml_start = "---" " last line string pattern of yaml front matter (default "- - -") let g:memolist_delimiter_yaml_end = "---" ''' [[plugins]] # cheat sheet repo = 'reireias/vim-cheatsheet' hook_add = ''' let g:cheatsheet#cheat_file = expand(g:user.dir.vim. '/cheatsheet.md') let g:cheatsheet#vsplit = 1 ''' hook_post_source = ''' " augroup vimrc_init_cheatsheet " autocmd! " if ale " autocmd BufEnter g:cheatsheet#cheat_file nested ALEDisableBuffer " augroup END ''' [[plugins]] # detect shebang repo = 'vitalk/vim-shebang' hook_post_source = ''' " map key : map !# :Shebang " unmap select-mode silent! sunmap !# ''' [[plugins]] # detect url repo = 'itchyny/vim-highlighturl' hook_add = ''' " " if enable only ft, use below " let g:highlighturl_enable = 0 " augroup vimrc_init_highlighturl " autocmd! " autocmd FileType javascript,html call highlighturl#enable_local() " augroup END ''' # not work lsp for filetype # [[plugins]] # repo = 'yasuhiroki/github-actions-yaml.vim' [[plugins]] repo = 'mattn/vim-maketable' depends = ['vim-altercmd'] hook_post_source = ''' AlterCommand maketable MakeTable AlterCommand maketable MakeTable ''' [[plugins]] repo = 'dhruvasagar/vim-table-mode' depends = ['vim-submode'] hook_add = ''' let g:table_mode_map_prefix = 'T' " keymap info let g:user.plugin.info.whichkey.desc.leader['T'] = { \ 'name' : '+TableMode', \ } ''' hook_post_source = ''' augroup vimrc_init_vim_table_mode autocmd! autocmd FileType markdown,rst nested if tablemode#IsActive() == 0 | call tablemode#Enable() | endif augroup END " table move call submode#enter_with('tablemove', 'n', '', g:table_mode_map_prefix . 'M') call submode#map('tablemove', 'n', 'r', 'k', '(table-mode-motion-up)' ) call submode#map('tablemove', 'n', 'r', 'j', '(table-mode-motion-down)' ) call submode#map('tablemove', 'n', 'r', 'h', '(table-mode-motion-left)' ) call submode#map('tablemove', 'n', 'r', 'l', '(table-mode-motion-right)') ''' # EOF