Open13

Vimオーバーホール計画

https://twitter.com/KawarimiDoll/status/1444254949731307520

nvim --startuptime ./startup.log

startup.log
times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.022  000.022: --- NVIM STARTING ---
003.629  003.607: locale set
013.985  010.355: inits 1
014.206  000.221: window checked
017.278  003.072: parsing arguments
018.015  000.737: expanding arguments
018.289  000.274: inits 2
018.589  000.300: init highlight
018.590  000.001: waiting for UI
022.316  003.726: done waiting for UI
022.322  000.006: init screen for UI
022.358  000.036: init default mappings
025.681  003.322: init default autocommands
051.663  001.748  001.748: sourcing /Users/kawarimidoll/.config/nvim/autoload/plug.vim
088.731  000.042  000.042: sourcing /Users/kawarimidoll/.config/nvim/plugged/dart-vim-plugin/ftdetect/dart.vim
090.178  012.372  012.330: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/filetype.vim
096.881  000.034  000.034: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/ftplugin.vim
104.031  000.028  000.028: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/indent.vim
113.199  000.062  000.062: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
113.350  008.197  008.135: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
124.387  000.204  000.204: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-which-key/autoload/which_key.vim
128.010  000.294  000.294: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/nosyntax.vim
128.706  000.075  000.075: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
128.766  003.273  002.905: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
153.122  006.627  006.627: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/autoload/sonokai.vim
158.422  028.513  021.886: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/colors/sonokai.vim
169.418  000.095  000.095: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-lightline-coc/autoload/lightline/coc.vim
169.817  132.942  078.477: sourcing /Users/kawarimidoll/.config/nvim/init.vim
169.825  011.202: sourcing vimrc file(s)
171.486  000.289  000.289: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/plugin/autopairs.vim
184.993  000.156  000.156: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/utility.vim
186.551  000.267  000.267: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/highlight.vim
187.220  007.344  006.921: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/plugin/gitgutter.vim
195.973  000.313  000.313: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-closetag/plugin/closetag.vim
203.139  000.054  000.054: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-trailing-whitespace/plugin/trailing-whitespace.vim
205.502  000.083  000.083: sourcing /Users/kawarimidoll/.config/nvim/plugged/dart-vim-plugin/plugin/dart.vim
218.676  004.190  004.190: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-easymotion/plugin/EasyMotion.vim
220.411  000.177  000.177: sourcing /Users/kawarimidoll/.config/nvim/plugged/memolist.vim/plugin/memolist.vim
227.236  000.170  000.170: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-asterisk/plugin/asterisk.vim
234.122  000.111  000.111: sourcing /Users/kawarimidoll/.config/nvim/plugged/lightline.vim/plugin/lightline.vim
236.922  000.069  000.069: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-showmarks/plugin/showmarks.vim
239.410  000.072  000.072: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-agriculture/plugin/agriculture.vim
241.584  000.200  000.200: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-lightline-coc/plugin/lightline/coc.vim
244.382  001.096  001.096: sourcing /Users/kawarimidoll/.config/nvim/plugged/fzf/plugin/fzf.vim
254.237  001.206  001.206: sourcing /Users/kawarimidoll/.config/nvim/plugged/fzf.vim/plugin/fzf.vim
256.079  000.309  000.309: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-carbon-now-sh/plugin/vim-carbon-now-sh.vim
257.145  000.235  000.235: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-which-key/plugin/which_key.vim
263.987  000.091  000.091: sourcing /Users/kawarimidoll/.config/nvim/plugged/vista.vim/plugin/vista.vim
271.937  000.279  000.279: sourcing /Users/kawarimidoll/.config/nvim/plugged/traces.vim/plugin/traces.vim
275.378  000.607  000.607: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/operator/sandwich.vim
295.983  000.246  000.246: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/sandwich.vim
297.312  000.321  000.321: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/textobj/sandwich.vim
304.012  000.354  000.354: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-goimports/plugin/goimports.vim
317.496  000.105  000.105: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/rpc.vim
319.714  001.017  001.017: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/util.vim
329.012  000.233  000.233: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/client.vim
333.991  019.971  018.616: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/plugin/coc.vim
346.106  000.481  000.481: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-anzu/plugin/anzu.vim
355.939  000.056  000.056: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-silicon/plugin/silicon.vim
365.219  000.408  000.408: sourcing /Users/kawarimidoll/.config/nvim/plugged/winresizer/plugin/winresizer.vim
408.876  000.275  000.275: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-expand-region/autoload/expand_region.vim
409.002  030.589  030.314: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-expand-region/plugin/expand_region.vim
435.986  000.102  000.102: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-quickrun/plugin/quickrun.vim
461.255  000.124  000.124: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-flutter/plugin/flutter.vim
462.796  000.684  000.684: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-abolish/plugin/abolish.vim
467.392  000.479  000.479: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-endwise/plugin/endwise.vim
474.824  000.138  000.138: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sleuth/plugin/sleuth.vim
486.784  003.919  003.919: sourcing /Users/kawarimidoll/.config/nvim/plugged/caw.vim/plugin/caw.vim
494.812  000.251  000.251: sourcing /Users/kawarimidoll/.config/nvim/plugged/open-browser.vim/plugin/openbrowser.vim
497.843  000.264  000.264: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops.vim
498.257  001.860  001.596: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/plugin/denops.vim
504.492  000.077  000.077: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/diagnostic.vim
507.150  000.150  000.150: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/gzip.vim
513.160  000.017  000.017: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/health.vim
514.763  000.057  000.057: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/man.vim
538.896  000.238  000.238: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
539.291  023.038  022.800: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchit.vim
540.163  000.277  000.277: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchparen.vim
547.336  000.451  000.451: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/netrwPlugin.vim
548.501  000.153  000.153: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/rplugin.vim
551.438  001.733  001.733: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/shada.vim
552.422  000.024  000.024: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/spellfile.vim
553.661  000.104  000.104: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tarPlugin.vim
555.406  000.092  000.092: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tohtml.vim
556.515  000.035  000.035: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tutor.vim
581.225  000.357  000.357: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/zipPlugin.vim
593.732  320.461: loading rtp plugins
594.063  000.331: loading packages
594.752  000.688: loading after plugins
594.763  000.011: inits 3
627.007  032.244: reading ShaDa
627.127  000.120: opening buffers
635.424  000.100  000.100: sourcing /Users/kawarimidoll/.config/nvim/plugged/vista.vim/autoload/vista/sidebar.vim
652.727  000.096  000.096: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/autoload/autopairs/Variables.vim
653.395  017.140  017.044: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/autoload/autopairs.vim
654.686  000.162  000.162: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/autoload/autopairs/Keybinds.vim
655.672  000.160  000.160: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/autoload/autopairs/Strings.vim
662.842  000.125  000.125: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter.vim
674.356  001.114  001.114: sourcing /Users/kawarimidoll/.config/nvim/plugged/lightline.vim/autoload/lightline.vim
676.368  000.375  000.375: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-anzu/autoload/anzu.vim
687.309  000.478  000.478: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/hunk.vim
690.603  000.285  000.285: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc.vim
691.730  000.207  000.207: sourcing /Users/kawarimidoll/.config/nvim/plugged/lightline.vim/autoload/lightline/tab.vim
701.482  000.254  000.254: sourcing /Users/kawarimidoll/.config/nvim/plugged/lightline.vim/autoload/lightline/colorscheme.vim
702.122  002.427  002.173: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/autoload/lightline/colorscheme/sonokai.vim
709.142  059.442: BufEnter autocommands
709.144  000.002: editing files in windows
718.099  000.327  000.327: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/server.vim
727.022  000.211  000.211: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/util.vim
727.237  007.870  007.659: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/server/channel.vim
729.134  011.792: VimEnter autocommands
729.144  000.010: UIEnter autocommands
736.837  000.267  000.267: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/autoload/provider/clipboard.vim
736.851  007.440: before starting main loop
786.615  001.006  001.006: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/float.vim
789.994  052.138: first screen update
789.996  000.002: --- NVIM STARTED ---

読み込み時間上位はこのあたり

593.732  320.461: loading rtp plugins
169.817  132.942  078.477: sourcing /Users/kawarimidoll/.config/nvim/init.vim
709.142  059.442: BufEnter autocommands
789.994  052.138: first screen update
627.007  032.244: reading ShaDa
409.002  030.589  030.314: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-expand-region/plugin/expand_region.vim
158.422  028.513  021.886: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/colors/sonokai.vim
539.291  023.038  022.800: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchit.vim
333.991  019.971  018.616: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/plugin/coc.vim
653.395  017.140  017.044: sourcing /Users/kawarimidoll/.config/nvim/plugged/auto-pairs/autoload/autopairs.vim
090.178  012.372  012.330: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/filetype.vim
729.134  011.792: VimEnter autocommands
169.825  011.202: sourcing vimrc file(s)
013.985  010.355: inits 1

プラグインを読まない状態でも起動時間を計測
nvim -u NONE --startuptime ./startup-u-none.log

startup-u-none.log
times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.165  000.165: --- NVIM STARTING ---
009.642  009.476: locale set
013.182  003.540: inits 1
013.424  000.243: window checked
017.470  004.045: parsing arguments
017.841  000.371: expanding arguments
018.247  000.406: inits 2
018.691  000.444: init highlight
018.692  000.001: waiting for UI
021.146  002.454: done waiting for UI
021.153  000.007: init screen for UI
021.366  000.213: init default mappings
022.625  001.259: init default autocommands
022.627  000.001: sourcing vimrc file(s)
022.785  000.158: inits 3
027.327  004.542: reading ShaDa
027.389  000.063: opening buffers
027.390  000.001: BufEnter autocommands
027.393  000.002: editing files in windows
027.507  000.114: VimEnter autocommands
027.509  000.002: UIEnter autocommands
027.510  000.001: before starting main loop
029.068  001.558: first screen update
029.071  000.003: --- NVIM STARTED ---

この30msが基準となるはずだ

プラグインを全部消してみた

startup-no-plugins.log
times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.014  000.014: --- NVIM STARTING ---
001.613  001.598: locale set
003.475  001.862: inits 1
003.499  000.024: window checked
007.581  004.081: parsing arguments
008.005  000.424: expanding arguments
008.043  000.038: inits 2
008.523  000.480: init highlight
008.524  000.001: waiting for UI
012.663  004.139: done waiting for UI
012.675  000.012: init screen for UI
012.698  000.022: init default mappings
013.199  000.502: init default autocommands
017.034  000.197  000.197: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
023.485  005.978  005.978: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/filetype.vim
024.906  000.709  000.709: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/scripts.vim
024.985  009.438  002.554: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
025.184  010.629  001.191: sourcing /Users/kawarimidoll/.config/nvim/init.vim
025.195  001.366: sourcing vimrc file(s)
025.557  000.087  000.087: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/ftplugin.vim
025.884  000.038  000.038: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/indent.vim
027.424  000.252  000.252: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/diagnostic.vim
027.976  000.324  000.324: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/gzip.vim
028.241  000.045  000.045: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/health.vim
028.580  000.089  000.089: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/man.vim
030.984  000.341  000.341: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
031.271  002.376  002.035: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchit.vim
031.810  000.327  000.327: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchparen.vim
032.580  000.535  000.535: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/netrwPlugin.vim
033.099  000.186  000.186: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/rplugin.vim
033.447  000.108  000.108: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/shada.vim
033.722  000.048  000.048: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/spellfile.vim
034.188  000.134  000.134: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tarPlugin.vim
034.619  000.219  000.219: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tohtml.vim
034.977  000.047  000.047: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tutor.vim
035.441  000.173  000.173: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/zipPlugin.vim
036.419  006.235: loading rtp plugins
036.624  000.205: loading packages
037.209  000.585: loading after plugins
037.219  000.009: inits 3
039.074  001.855: reading ShaDa
039.139  000.065: opening buffers
039.155  000.016: BufEnter autocommands
039.157  000.002: editing files in windows
039.513  000.356: VimEnter autocommands
039.514  000.002: UIEnter autocommands
040.452  000.422  000.422: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/autoload/provider/clipboard.vim
040.466  000.530: before starting main loop
041.027  000.561: first screen update
041.028  000.001: --- NVIM STARTED ---

ふーむ デフォルトプラグインっぽいのを結構読み込んでいるな

let g:loaded_gzip = 1
let g:loaded_tar = 1
let g:loaded_tarPlugin = 1

こんな感じで読み込み完了フラグを立てればスキップされるのかと思ったけど特に変化なしっぽい…一旦パス

--nopluginで起動したら良いのかな?まあいいや
set系も問題はないでしょう 既存のまま使っていく

残したいキーマップやコマンドはこの辺

" vimrcを読み込んだり編集したりする
command! Rcedit edit $MYVIMRC
command! Rcreload write | source $MYVIMRC | nohlsearch | redraw | echo 'init.vim is reloaded.'

" jkとgjgkの動作を逆転し表示行の状態で移動
noremap j gj
noremap k gk
noremap gj j
noremap gk k

" gVで直前のペースト範囲を選択(使ってないかも)
noremap gV `[v`]

" HLで行頭行末へ
noremap H ^
noremap L $

" brackets motions
noremap [b :<C-u>bprevious<CR>
noremap ]b :<C-u>bnext<CR>
noremap [B :<C-u>bfirst<CR>
noremap ]B :<C-u>blast<CR>
noremap [q :<C-u>cprevious<CR>
noremap ]q :<C-u>cnext<CR>
noremap [Q :<C-u>cfirst<CR>
noremap ]Q :<C-u>clast<CR>

" Mで対応範囲を選択
map M %

" ペースト時に末尾へ
nnoremap p p`[v`]=`]
nnoremap P P`[v`]=`]

" ]pを本来のpの動作に
nnoremap ]p p
nnoremap ]P P

" xをブラックホールを使うdに
nnoremap x "_d
nnoremap xx "_dd
nnoremap X "_D

" Yを行末までのコピーに
nnoremap Y y$

" Spaceマッピング
" dでバッファデリート
nnoremap <Space>d :<C-u>bdelete<CR>
" g/Gで上下に行を複製
nnoremap <silent><Space>g :<C-u>copy.<CR>
nnoremap <silent><Space>G :<C-u>copy-1<CR>
" o/Oで空行挿入
nnoremap <silent><Space>o :<c-u>put =repeat(nr2char(10), v:count1)<cr>
nnoremap <silent><Space>O :<c-u>put! =repeat(nr2char(10), v:count1)<cr>'[
" qで終了
nnoremap <Space>q :<C-u>quit<CR>
" tで直前のバッファとトグル
nnoremap <Space>t <C-^>
" wで保存 wqで保存して終了
nnoremap <Space>w :<C-u>write<CR>
nnoremap <Space>wq :<C-u>exit<CR>

" C-j/C-kで上下に行移動
nnoremap <silent><expr> <C-k> ':<C-u>move-1-' . v:count1 . '<CR>=l'
nnoremap <silent><expr> <C-j> ':<C-u>move+' . v:count1 . '<CR>=l'

" C-n/C-pでメニュー選択
cnoremap <expr> <C-n> wildmenumode() ? "\<C-n>" : "\<Down>"
cnoremap <expr> <C-p> wildmenumode() ? "\<C-p>" : "\<Up>"

" commandモードでのemacs式カーソル移動
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
cnoremap <C-d> <Del>

" jjでエスケープ(ほとんど使ってない)
inoremap <silent> jj <ESC>

" visualモードでの設定はnormalモードの反映
xnoremap <silent> y y`]
xnoremap x "_x
xnoremap z zf
xnoremap <silent><C-k> :m'<-2<CR>gv=gv
xnoremap <silent><C-j> :m'>+1<CR>gv=gv

" <>で連続インデント調整
xnoremap < <gv
xnoremap > >gv

" operator
onoremap x d

" terminal
tnoremap <C-w><C-n> <C-w>N
tnoremap <Esc> <C-\><C-n>

syntax enable
" 全角スペースの可視化 colorscheme以降に記述する
if has('syntax')
  let s:HighlightZenkakuSpace = {-> execute("highlight ZenkakuSpace cterm=reverse ctermfg=darkmagenta") }
  augroup vimrc_appearances
    autocmd!
    autocmd ColorScheme * call call( s:HighlightZenkakuSpace, [] )
    autocmd VimEnter,WinEnter,BufRead * let w:m1=matchadd('ZenkakuSpace', ' ')
  augroup END
  call call( s:HighlightZenkakuSpace, [] )
endif
highlight HighlightedyankRegion cterm=reverse gui=reverse

ではdein導入するぞ

https://github.com/Shougo/dein.vim
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > dein_installer.sh
sh ./dein_installer.sh ~/.cache/dein

実行!

Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:


"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/Users/kawarimidoll/.cache/dein/repos/github.com/Shougo/dein.vim

" Required:
call dein#begin('/Users/kawarimidoll/.cache/dein')

" Let dein manage dein
" Required:
call dein#add('/Users/kawarimidoll/.cache/dein/repos/github.com/Shougo/dein.vim')

" Add or remove your plugins here like this:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')

" Required:
call dein#end()

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
"if dein#check_install()
"  call dein#install()
"endif

"End dein Scripts-------------------------


Done.
Complete setup dein!

ということでinit.vim先頭に追記

はすさんのdotfiles参考にしよう

https://zenn.dev/hasu_83/articles/how-to-use-skk-in-vim
init.vim
"-----------------
" dein scripts
"-----------------
if &compatible
  set nocompatible
endif
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
  call dein#begin('~/.cache/dein')
  call dein#load_toml('~/.config/nvim/dein.toml')
  call dein#end()
  call dein#save_state()
endif

filetype plugin indent on
syntax enable

" Install not installed plugins on startup automatically
if dein#check_install()
  call dein#install()
endif
dein.toml
[[plugins]]
repo = 'Shougo/dein.vim'

[[plugins]]
repo='vim-denops/denops.vim'

https://mobile.twitter.com/KawarimiDoll/status/1444550390679158784

浅知恵で一気にやるのに無理があった
全とっかえは保留

一応必要な機能は見えてきた

必須のもの

  • lsp
    • 現在cocだが他のものでも良い denoの補完が動くことは必須
  • fzf
    • fzf.vimからfzf-previewへ移行予定
  • 括弧補完
    • 入力中の補完の機能が何かしらほしい
  • sandwich
    • こっちはノーマル・ビジュアルでの括弧補完
  • caw
  • GitGutter

あとはrgの結果をquickfixに入れる仕組みとか

実は使ってないもの

  • whichkey
  • quickrun
    • 設定できてない
  • vista
  • レコードレジスタ自動変更
    • 結局qレジスタしか使わん
  • マーク機能
    • 使ってない
      この辺は一旦消す 必要なら後から入れる

ある程度整理した

nvim --startuptime ./startup.log

times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.041  000.041: --- NVIM STARTING ---
004.295  004.255: locale set
007.168  002.872: inits 1
007.590  000.423: window checked
012.914  005.324: parsing arguments
013.654  000.739: expanding arguments
014.014  000.360: inits 2
014.534  000.520: init highlight
014.535  000.002: waiting for UI
019.346  004.810: done waiting for UI
019.356  000.010: init screen for UI
019.418  000.062: init default mappings
021.383  001.965: init default autocommands
027.999  002.812  002.812: sourcing /Users/kawarimidoll/.config/nvim/autoload/plug.vim
040.876  005.658  005.658: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/filetype.vim
042.143  000.074  000.074: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/ftplugin.vim
043.788  000.271  000.271: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/indent.vim
046.260  000.201  000.201: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
046.445  001.607  001.406: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
049.335  000.580  000.580: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/nosyntax.vim
050.025  000.074  000.074: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
050.089  002.304  001.650: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
053.240  000.470  000.470: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/autoload/sonokai.vim
059.790  008.179  007.709: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/colors/sonokai.vim
076.958  054.513  033.607: sourcing /Users/kawarimidoll/.config/nvim/init.vim
076.967  001.072: sourcing vimrc file(s)
087.577  000.347  000.347: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/utility.vim
089.035  000.414  000.414: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/highlight.vim
089.901  004.003  003.242: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/plugin/gitgutter.vim
090.984  000.200  000.200: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-trailing-whitespace/plugin/trailing-whitespace.vim
101.924  004.450  004.450: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-easymotion/plugin/EasyMotion.vim
103.939  000.181  000.181: sourcing /Users/kawarimidoll/.config/nvim/plugged/memolist.vim/plugin/memolist.vim
105.552  000.355  000.355: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-asterisk/plugin/asterisk.vim
107.481  000.209  000.209: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-showmarks/plugin/showmarks.vim
109.029  000.196  000.196: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-agriculture/plugin/agriculture.vim
111.564  001.002  001.002: sourcing /Users/kawarimidoll/.config/nvim/plugged/fzf/plugin/fzf.vim
120.200  000.076  000.076: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-carbon-now-sh/plugin/vim-carbon-now-sh.vim
121.887  000.163  000.163: sourcing /Users/kawarimidoll/.config/nvim/plugged/gina.vim/plugin/gina.vim
124.074  000.445  000.445: sourcing /Users/kawarimidoll/.config/nvim/plugged/traces.vim/plugin/traces.vim
126.391  000.500  000.500: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/operator/sandwich.vim
127.846  000.291  000.291: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/sandwich.vim
128.741  000.191  000.191: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/textobj/sandwich.vim
130.856  000.217  000.217: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/rpc.vim
132.805  000.830  000.830: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/util.vim
134.321  000.425  000.425: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/client.vim
138.060  008.181  006.709: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/plugin/coc.vim
140.250  000.504  000.504: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-anzu/plugin/anzu.vim
141.766  000.736  000.736: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-silicon/plugin/silicon.vim
145.393  000.372  000.372: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-expand-region/autoload/expand_region.vim
145.459  001.786  001.414: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-expand-region/plugin/expand_region.vim
152.564  000.712  000.712: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-abolish/plugin/abolish.vim
153.882  000.367  000.367: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sleuth/plugin/sleuth.vim
203.414  002.259  002.259: sourcing /Users/kawarimidoll/.config/nvim/plugged/caw.vim/plugin/caw.vim
205.087  000.404  000.404: sourcing /Users/kawarimidoll/.config/nvim/plugged/open-browser.vim/plugin/openbrowser.vim
207.770  000.251  000.251: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops.vim
207.919  001.407  001.157: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/plugin/denops.vim
209.268  000.151  000.151: sourcing /Users/kawarimidoll/.config/nvim/plugged/nvim-web-devicons/plugin/nvim-web-devicons.vim
228.264  000.038  000.038: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/diagnostic.vim
229.161  000.128  000.128: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/gzip.vim
230.375  000.046  000.046: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/health.vim
231.632  000.211  000.211: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/man.vim
265.546  000.212  000.212: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
265.940  033.513  033.301: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchit.vim
267.157  000.291  000.291: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchparen.vim
268.021  000.161  000.161: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/netrwPlugin.vim
277.327  000.020  000.020: sourcing /Users/kawarimidoll/.local/share/nvim/rplugin.vim
277.339  008.644  008.623: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/rplugin.vim
278.839  000.296  000.296: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/shada.vim
279.518  000.047  000.047: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/spellfile.vim
280.232  000.039  000.039: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tarPlugin.vim
281.117  000.213  000.213: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tohtml.vim
282.319  000.063  000.063: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tutor.vim
283.256  000.044  000.044: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/zipPlugin.vim
291.408  141.935: loading rtp plugins
291.637  000.230: loading packages
292.306  000.669: loading after plugins
292.316  000.009: inits 3
294.270  001.955: reading ShaDa
295.608  001.338: opening buffers
296.461  000.242  000.242: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter.vim
296.958  001.108: BufEnter autocommands
296.960  000.002: editing files in windows
299.313  000.159  000.159: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/util.vim
299.633  001.443  001.284: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/server.vim
300.549  000.071  000.071: sourcing /Users/kawarimidoll/.config/nvim/plugged/denops.vim/autoload/denops/job.vim
301.871  003.396: VimEnter autocommands
301.879  000.009: UIEnter autocommands
303.001  000.401  000.401: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/autoload/provider/clipboard.vim
303.013  000.732: before starting main loop
305.087  001.043  001.043: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/float.vim
306.734  002.678: first screen update
306.736  000.002: --- NVIM STARTED ---

調整前に700ms以上かかっていたのが300msになったので倍速化できたといえる 悪くないがもう少し改善したい

特にデフォルトプラグインの読み込みが目につく
let g:loaded_gzip = 1とか設定しているんだけどな 「ファイルを見ているけど処理はしていない」可能性もあるがその割には時間がかかっている

times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.008  000.008: --- NVIM STARTING ---
001.678  001.670: locale set
006.926  005.248: inits 1
006.950  000.024: window checked
011.004  004.054: parsing arguments
011.462  000.458: expanding arguments
011.523  000.062: inits 2
012.002  000.479: init highlight
012.003  000.001: waiting for UI
015.284  003.280: done waiting for UI
015.297  000.013: init screen for UI
015.322  000.025: init default mappings
016.603  001.281: init default autocommands
022.978  002.521  002.521: sourcing /Users/kawarimidoll/.config/nvim/autoload/plug.vim
036.086  006.071  006.071: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/filetype.vim
037.607  000.073  000.073: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/ftplugin.vim
038.551  000.170  000.170: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/indent.vim
039.929  000.080  000.080: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
040.015  001.095  001.015: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
042.200  000.447  000.447: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/nosyntax.vim
042.792  000.073  000.073: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/synload.vim
042.852  001.569  001.049: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/syntax/syntax.vim
044.470  000.357  000.357: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/autoload/sonokai.vim
050.571  007.282  006.925: sourcing /Users/kawarimidoll/.config/nvim/plugged/sonokai/colors/sonokai.vim
054.097  035.860  017.079: sourcing /Users/kawarimidoll/.config/nvim/init.vim
054.105  001.643: sourcing vimrc file(s)
057.121  000.307  000.307: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/utility.vim
057.984  000.295  000.295: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter/highlight.vim
058.536  003.614  003.011: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/plugin/gitgutter.vim
059.747  000.181  000.181: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-trailing-whitespace/plugin/trailing-whitespace.vim
064.227  003.682  003.682: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-easymotion/plugin/EasyMotion.vim
065.281  000.296  000.296: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-asterisk/plugin/asterisk.vim
066.726  000.786  000.786: sourcing /Users/kawarimidoll/.config/nvim/plugged/fzf/plugin/fzf.vim
067.549  000.143  000.143: sourcing /Users/kawarimidoll/.config/nvim/plugged/gina.vim/plugin/gina.vim
068.632  000.297  000.297: sourcing /Users/kawarimidoll/.config/nvim/plugged/traces.vim/plugin/traces.vim
071.140  000.435  000.435: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/operator/sandwich.vim
071.590  000.256  000.256: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/sandwich.vim
072.117  000.162  000.162: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sandwich/plugin/textobj/sandwich.vim
074.164  000.413  000.413: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/rpc.vim
074.977  000.401  000.401: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/util.vim
075.918  000.267  000.267: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/client.vim
079.417  006.135  005.053: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/plugin/coc.vim
080.559  000.416  000.416: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-anzu/plugin/anzu.vim
081.903  000.741  000.741: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-abolish/plugin/abolish.vim
082.885  000.244  000.244: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-sleuth/plugin/sleuth.vim
086.139  002.368  002.368: sourcing /Users/kawarimidoll/.config/nvim/plugged/caw.vim/plugin/caw.vim
087.109  000.154  000.154: sourcing /Users/kawarimidoll/.config/nvim/plugged/nvim-web-devicons/plugin/nvim-web-devicons.vim
088.427  000.057  000.057: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/diagnostic.vim
088.935  000.030  000.030: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/gzip.vim
089.324  000.028  000.028: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/health.vim
089.813  000.127  000.127: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/man.vim
097.168  000.319  000.319: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
097.499  007.346  007.028: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchit.vim
098.024  000.166  000.166: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/matchparen.vim
098.508  000.119  000.119: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/netrwPlugin.vim
099.495  000.326  000.326: sourcing /Users/kawarimidoll/.local/share/nvim/rplugin.vim
099.510  000.822  000.496: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/rplugin.vim
100.147  000.228  000.228: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/shada.vim
100.604  000.050  000.050: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/spellfile.vim
100.879  000.041  000.041: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tarPlugin.vim
101.317  000.194  000.194: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tohtml.vim
101.606  000.040  000.040: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/tutor.vim
101.993  000.043  000.043: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/plugin/zipPlugin.vim
107.466  024.159: loading rtp plugins
107.676  000.209: loading packages
108.336  000.660: loading after plugins
108.345  000.009: inits 3
110.039  001.694: reading ShaDa
111.301  001.261: opening buffers
111.935  000.253  000.253: sourcing /Users/kawarimidoll/.config/nvim/plugged/vim-gitgutter/autoload/gitgutter.vim
112.265  000.711: BufEnter autocommands
112.266  000.001: editing files in windows
112.550  000.283: VimEnter autocommands
112.551  000.001: UIEnter autocommands
113.256  000.272  000.272: sourcing /opt/homebrew/Cellar/neovim/HEAD-9ca7b6b/share/nvim/runtime/autoload/provider/clipboard.vim
113.264  000.441: before starting main loop
114.543  000.892  000.892: sourcing /Users/kawarimidoll/.config/nvim/plugged/coc.nvim/autoload/coc/float.vim
115.394  001.238: first screen update
115.396  000.002: --- NVIM STARTED ---

使ってないプラグインの剪定とvim-plugのlazyload設定を増やして150msを切った
これでほとんど待機が感じられなくなったので良いかな

  • lazyloadできたもの
    • open-browser
    • expand-region
    • silicon
    • carbon-now-sh
    • showmarks
  • lazyloadしたいと思ったけどできなかったもの
    • asterisk
    • anzu
    • sandwich
    • caw

表示系以外は「該当のコマンドや関数を実行したらロードする」というようにしたいがそもそもプラグインをロードしないと関数のマッピングがされないというジレンマ
マッピングだけできると良さそうだが…そういう手段あるのかしら

ついでにシェル自体の起動も高速化

https://zenn.dev/ktakayama/articles/27b9d6218ed2f0ee9992

シェルの起動時にStarshipやVelociraptorがこんな感じで初期化を行っており、これがボトルネックになっていた

eval "$(starship init zsh)"

source <(vr completions zsh)

シェルを開き直すたびに実行する必要はないのでキャッシュに書き出して読み込む方式に変更

if [ ! -f /tmp/zsh_starship.cache ]; then
  starship init zsh > /tmp/zsh_starship.cache
  zcompile /tmp/zsh_starship.cache
fi
source /tmp/zsh_starship.cache

if [ ! -f /tmp/zsh_velociraptor.cache ]; then
  vr completions zsh > /tmp/zsh_velociraptor.cache
  zcompile /tmp/zsh_velociraptor.cache
fi
source /tmp/zsh_velociraptor.cache

あとターミナルもitermからkittyにした このときに検討していたログが残っていてよかった

https://zenn.dev/kawarimidoll/articles/007449407cc78d#kitty

kitty.confで有効にしている設定は以下

~/.config/kitty/kitty.conf
font_family      RobotoMono Nerd Font
font_size 18.0

# URLまわり 初めから有効だったか?
url_color #0087bd
url_style curly
open_url_with default
url_prefixes http https file ftp gemini irc gopher mailto news git
detect_urls yes

# ゼロだと画面ギリギリまで文字が出て見づらいため
window_padding_width 5 10

# Tab設定 マージン足しても良いかも
tab_bar_edge top
tab_bar_style separator
tab_separator "  ┇  "

# https://github.com/dexpota/kitty-themes/blob/master/themes/Pnevma.conf
background #1c1c1c
foreground #d0d0d0
cursor #e3c8ae
selection_background #4d4d4d
color0 #2f2e2d
color8 #4a4845
color1 #a36666
color9 #d78787
color2 #90a57d
color10 #afbea2
color3 #d7af87
color11 #e4c9af
color4 #7fa5bd
color12 #a1bdce
color5 #c79ec4
color13 #d7beda
color6 #8adbb4
color14 #b1e7dd
color7 #d0d0d0
color15 #efefef
selection_foreground #1c1c1c

# mac用設定
macos_quit_when_last_window_closed yes
macos_window_resizable yes

# cmd+tで新規タブを現在のディレクトリで開く
kitty_mod ctrl+shift
map kitty_mod+t     new_tab_with_cwd
map cmd+t     new_tab_with_cwd

# kitten設定は多分デフォルトのまま
map kitty_mod+e kitten hints
map kitty_mod+p>f kitten hints --type path --program -
map kitty_mod+p>shift+f kitten hints --type path
map kitty_mod+p>l kitten hints --type line --program -
map kitty_mod+p>w kitten hints --type word --program -
map kitty_mod+p>h kitten hints --type hash --program -
map kitty_mod+p>n kitten hints --type linenum
map kitty_mod+p>y kitten hints --type hyperlink

あとタブにディレクトリ名を出すため.zshrcに以下を追加
参考:https://github.com/kovidgoyal/kitty/issues/930

precmd () { print -Pn "\e]0;%~\a" }

軽快!

どうせlazyloadできないならneovim専用のlua系のプラグインに変えてしまおう

https://zenn.dev/hituzi_no_sippo/articles/871c06cdbc45b53181e3
  • lightline → lualine
  • easymotion → hop
  • coloresque → colorizer
  • caw → nvim-comment
  • gitgutter → gitsigns

これまでlua製のプラグインは避けていたけど以下の理由があるため採用しても問題なさそう

  • vimに戻る予定はない
    • (dotfilesは公開しているけど)他の人に使ってもらう予定もないため両対応する必要はない
  • lua製のほうが全体的に新しい
  • 速さをアピールしているものが多い
  • luaわからないと思っていたけど各プラグインの設定を書く程度ならほとんど知識いらない、少なくともVimScriptよりは書きやすい

https://zenn.dev/kouta/articles/ab2d9df961238e

vim-which-keyは設定が面倒でやめたけどwhich-key.nvimは入れただけで動いてくれて良さげ
あとlazygit.nvimも良い感じだ LazyGitコマンド打つまで読み込み遅延できるのもありがたい

ログインするとコメントできます