[ftplugin] _ = ''' setlocal formatoptions-=r setlocal formatoptions-=o setlocal formatoptions+=mMBl ''' dockerfile = ''' function! s:set_abbrev(instruction) abort execute 'inoreabbrev ' a:instruction \ "(getline('.')[:col('.') - 2] ==# '{a:instruction}')" \ $"? '{toupper(a:instruction)}' : '{a:instruction}'" endfunction call s:set_abbrev('add') call s:set_abbrev('arg') call s:set_abbrev('cmd') call s:set_abbrev('copy') call s:set_abbrev('entrypoint') call s:set_abbrev('env') call s:set_abbrev('expose') call s:set_abbrev('from') call s:set_abbrev('healthcheck') call s:set_abbrev('label') call s:set_abbrev('onbuild') call s:set_abbrev('run') call s:set_abbrev('shell') call s:set_abbrev('user') call s:set_abbrev('volume') call s:set_abbrev('workdir') inoreabbrev as \ (getline('.')[:col('.') - 2] =~# '^FROM\s\+.*\s\+') ? 'AS' : 'as' ''' gitcommit = ''' setlocal textwidth=72 colorcolumn=+1 " based on https://zenn.dev/uochan/articles/2021-12-08-vim-conventional-commits function! s:select_type() abort let title = getline('.')->split(';')[0]->trim()->printf('%s: ') normal! "_dip put! =title endfunction nnoremap call select_type()A nnoremap [Space]q q if expand('#')->getbufvar('&buftype') ==# 'terminal' autocmd vimrc WinClosed ++once startinsert endif " Open diff view if winnr('$') ==# 1 call cursor(1, 1) let s:scissors = search('>8', 'nW') if s:scissors belowright wincmd v call winrestview(#{ lnum: s:scissors, col: 0, topline: s:scissors }) wincmd p endif endif ''' gitrebase = ''' nnoremap Cycle nnoremap move +1 nnoremap move -2 nnoremap [Space]q q if expand('#')->getbufvar('&buftype') ==# 'terminal' autocmd vimrc WinClosed ++once startinsert endif ''' help = ''' nnoremap q q nnoremap zv xnoremap zv nnoremap [Toggle]l \ printf('help %s@%s', expand(''), \ expand('%:e') ==# 'jax' ? 'en': 'ja') ''' python = ''' setlocal softtabstop=4 shiftwidth=4 setlocal textwidth=80 setlocal smarttab nosmartindent inoreabbrev improt \ (getline('.')[:col('.') - 2] =~# 'from\s\+.*\s\+' \ getline('.')[:col('.') - 2] ==# 'improt') ? 'import' \ : 'improt' ''' qf = ''' setlocal nowrap nolist setlocal numberwidth=2 nnoremap q getwininfo(win_getid())[0].loclist ? \ 'lclose' \ : 'cclose' nnoremap j line('.') == line('$') ? 'gg' : 'j' nnoremap k line('.') == 1 ? 'G' : 'k' " from https://github.com/mityu/dotfiles/blob/f5cb5f9a/dot_vim/runtime/ftplugin/qf.vim#L6 nnoremap o zzp nnoremap p zzp ''' toml = ''' if !has('nvim') && getline(1) =~# '\v^(\[\[plugins]]|hook_)' call dein#toml#syntax() endif ''' zsh = ''' setlocal iskeyword+=- ''' checkhealth = ''' nnoremap q q ''' go = ''' setlocal noexpandtab nosmarttab shiftwidth=0 ''' tsv = ''' setlocal noexpandtab ''' rasi = ''' setlocal shiftwidth=4 indentkeys=0{,0},o,O ''' vim = ''' setlocal formatoptions-=ro textwidth=0 ''' [[plugins]] repo = 'https://github.com/4513ECHO/vim-jq-indent' [[plugins]] repo = 'https://github.com/4513ECHO/vim-vimhelp-hoptag' [plugins.ftplugin] help = ''' nnoremap (hoptag-next) nnoremap (hoptag-prev) ''' [[plugins]] repo = 'https://github.com/cohama/vim-hier' on_event = ['QuickFixCmdPost'] [plugins.ftplugin] qf = ''' autocmd vimrc WinClosed \ : if &buftype ==# 'quickfix' \ | execute 'HierStop' \ | endif ''' [[plugins]] repo = 'https://github.com/itchyny/vim-qfedit' on_event = ['QuickFixCmdPost'] [[plugins]] repo = 'https://github.com/lifepillar/pgsql.vim' hook_add = ''' let g:sql_type_default = 'pgsql' ''' [[plugins]] repo = 'https://github.com/lifepillar/vim-colortemplate' [[plugins]] repo = 'https://github.com/MTDL9/vim-log-highlighting' [[plugins]] repo = 'https://github.com/rbtnn/vim-vimscript_indentexpr' [[plugins]] repo = 'https://github.com/syusui-s/scrapbox-vim' [[plugins]] repo = 'https://github.com/thinca/vim-qfreplace' on_cmd = ['Qfreplace'] [plugins.ftplugin] qf = ''' nnoremap r Qfreplace ''' qfreplace = ''' nnoremap q q ''' [[plugins]] repo = 'https://github.com/vim-skk/skkdict.vim'