" set encoding=utf-8 " scriptencoding utf-8 " _ _ _ _ " (_) (_) | (_) " _ _ __ _| |___ ___ _ __ ___ " | | '_ \| | __\ \ / / | '_ ` _ \ " | | | | | | |_ \ V /| | | | | | | " |_|_| |_|_|\__(_)_/ |_|_| |_| |_| " @kawarimidoll " https://twitter.com/kawarimidoll " https://github.com/kawarimidoll "----------------- " Disable default plugins "----------------- let g:did_install_default_menus = 1 let g:did_install_syntax_menu = 1 let g:did_indent_on = 1 let g:did_load_filetypes = 1 " load ftplugin to set commentstring " let g:did_load_ftplugin = 1 let g:loaded_2html_plugin = 1 let g:loaded_gzip = 1 let g:loaded_man = 1 let g:loaded_matchit = 1 let g:loaded_matchparen = 1 let g:loaded_netrwPlugin = 1 let g:loaded_remote_plugins = 1 let g:loaded_shada_plugin = 1 let g:loaded_spellfile_plugin = 1 let g:loaded_tarPlugin = 1 let g:loaded_tutor_mode_plugin = 1 let g:loaded_zipPlugin = 1 let g:skip_loading_mswin = 1 "----------------- " Options "----------------- set ambiwidth=single set autoindent set autoread set background=dark set backspace=indent,eol,start set clipboard=unnamed set cmdheight=2 set completeopt=longest,menu set cursorline set display=lastline set expandtab set fenc=utf-8 set fileencoding=utf-8 set fileencodings=utf-8 set fileformats=unix,dos,mac set formatoptions=tcqmMj1 set helplang=ja set hidden set history=200 set hlsearch set ignorecase set incsearch set infercase set laststatus=2 set lazyredraw set linebreak set list set listchars=tab:^-,trail:~,extends:»,precedes:«,nbsp:% set matchtime=1 set nobackup set nomodeline set noshowmode set noswapfile set nowritebackup set nrformats= set number set ruler set scrolloff=5 set shiftround set shiftwidth=2 set showcmd set showmatch set showtabline=2 set shortmess+=c set signcolumn=yes set smartcase set smartindent set softtabstop=2 set splitbelow set splitright set switchbuf=usetab set t_Co=256 set tabstop=2 set termguicolors set textwidth=0 set title set ttyfast set updatetime=300 set whichwrap=b,s,h,l,<,>,[,],~ set wildmenu set wildmode=list:longest,full set wrap set wrapscan " [Tips should also describe automatic installation for Neovim|junegunn/vim-plug](https://github.com/junegunn/vim-plug/issues/739) let autoload_plug_path = stdpath('config') . '/autoload/plug.vim' if !filereadable(autoload_plug_path) if !executable('curl') echoerr 'You have to install curl.' execute 'quit!' endif silent execute '!curl -fL --create-dirs -o ' . autoload_plug_path . \ ' https://raw.github.com/junegunn/vim-plug/master/plug.vim' autocmd VimEnter * PlugInstall --sync | source $MYVIMRC else " [おい、NeoBundle もいいけど vim-plug 使えよ](https://qiita.com/b4b4r07/items/fa9c8cceb321edea5da0) function! s:AutoPlugInstall() abort let list = get(g:, 'plugs', {})->items()->copy() \ ->filter({_,item->!isdirectory(item[1].dir)}) \ ->map({_,item->item[0]}) if empty(list) return endif echo 'Not installed plugs: ' . string(list) if confirm('Install plugs?', "yes\nno", 2) == 1 PlugInstall --sync | close endif endfunction augroup vimrc_plug autocmd! autocmd VimEnter * call s:AutoPlugInstall() augroup END endif unlet autoload_plug_path call plug#begin(stdpath('config') . '/plugged') " Plug 'glidenote/memolist.vim' Plug '4513ECHO/vim-readme-viewer', { 'on': 'PlugReadme' } Plug 'arthurxavierx/vim-caser', { 'on': [] } Plug 'echasnovski/mini.nvim' Plug 'folke/which-key.nvim', { 'on': [] } Plug 'haya14busa/vim-asterisk', { 'on': [] } Plug 'jacquesbh/vim-showmarks', { 'on': 'DoShowMarks' } Plug 'junegunn/fzf', { 'on': [], 'do': { -> fzf#install() } } Plug 'kat0h/bufpreview.vim', { 'on': 'PreviewMarkdown' } Plug 'kdheepak/lazygit.nvim', { 'on': 'LazyGit' } Plug 'kevinhwang91/nvim-hlslens', { 'on': [] } Plug 'kyazdani42/nvim-web-devicons', { 'on': [] } Plug 'lambdalisue/gina.vim', { 'on': 'Gina' } Plug 'lewis6991/gitsigns.nvim', { 'on': [] } Plug 'lewis6991/impatient.nvim' Plug 'nathom/filetype.nvim' Plug 'neoclide/coc.nvim', { 'on': [], 'branch': 'release' } Plug 'norcalli/nvim-colorizer.lua' ", { 'on': [] } Plug 'nvim-lua/plenary.nvim', { 'on': [] } Plug 'phaazon/hop.nvim', { 'on': [] } Plug 'segeljakt/vim-silicon', { 'on': 'Silicon' } Plug 'simeji/winresizer', { 'on': 'WinResizerStartResize' } Plug 'terryma/vim-expand-region', { 'on': '(expand_region_' } Plug 'tyru/capture.vim', { 'on': 'Capture' } Plug 'tyru/open-browser.vim', { 'on': ['OpenBrowser', '(openbrowser-'] } Plug 'vim-denops/denops.vim', { 'on': [] } Plug 'vim-jp/vimdoc-ja' Plug 'voldikss/vim-floaterm', { 'on': 'FloatermNew' } Plug 'vim-skk/denops-skkeleton.vim' Plug 'delphinus/skkeleton_indicator.nvim' Plug 'Shougo/ddc.vim' Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } Plug 'nvim-treesitter/nvim-treesitter-textobjects' call plug#end() " set runtimepath^=$DOT_DIR/dps-open " https://qiita.com/Alice_ecilA/items/d251a90e4a71d67444dd#vim%E3%81%AE%E3%82%BF%E3%82%A4%E3%83%9E%E3%83%BC%E6%A9%9F%E8%83%BD%E3%81%A7%E9%81%85%E5%BB%B6%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BF " load plugins by timer function! s:LazyLoadPlugs(timer) abort " save current position by marking Z because plug#load reloads current buffer normal! mZ call plug#load( \ 'denops.vim', \ 'denops-skkeleton.vim', \ 'skkeleton_indicator.nvim', \ 'coc.nvim', \ 'fzf', \ 'gitsigns.nvim', \ 'nvim-hlslens', \ 'nvim-web-devicons', \ 'plenary.nvim', \ 'hop.nvim', \ 'vim-asterisk', \ 'vim-caser', \ 'which-key.nvim', \ ) normal! g`Z delmarks Z call ddc#enable() lua << EOF require('which-key').setup() require('hop').setup() require('hlslens').setup({ calm_down = true }) require('gitsigns').setup ({ signs = { add = { text = '+' }, change = { text = '~' }, delete = { text = '_' }, topdelete = { text = '‾' }, changedelete = { text = '~_' }, }, current_line_blame = true, }) require('skkeleton_indicator').setup({ alwaysShown = false, fadeOutMs = 30000, }) EOF endfunction call timer_start(20, function("s:LazyLoadPlugs")) lua << EOF require('impatient') require('colorizer').setup() require('filetype').setup({ overrides = { extensions = { bashrc = 'bash', env = 'env', }, complex = { ["%.env.*"] = "env", ["%.zshrc.*"] = "zsh", [".*shrc"] = "bash", ["git--__.+"] = "bash", }, } }) require('mini.bufremove').setup() require('mini.comment').setup() require('mini.cursorword').setup() require('mini.surround').setup() require('mini.trailspace').setup() require('mini.tabline').setup() require('mini.pairs').setup() -- require('mini.jump').setup() -- require('mini.starter').setup() require('mini.misc').setup({ make_global = { 'put', 'put_text', 'zoom' } }) require('nvim-treesitter.configs').setup({ ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) highlight = { enable = true, -- false will disable the whole extension -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = { 'vim' }, }, indent = { enable = true }, textobjects = { select = { enable = true, lookahead = true, keymaps = { ["af"] = "@function.outer", ["if"] = "@function.inner", ["ac"] = "@conditional.outer", ["ic"] = "@conditional.inner", ["ab"] = "@block.outer", ["ib"] = "@block.inner", }, }, move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@conditional.outer", }, goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@conditional.outer", }, goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@conditional.outer", }, goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@conditional.outer", }, }, }, }) EOF let g:readme_viewer#plugin_manager = 'vim-plug' let g:asterisk#keeppos = 1 let g:coc_global_extensions = [ \ 'coc-fzf-preview', \ 'coc-spell-checker', \ 'coc-word', \ ] let g:lazygit_floating_window_scaling_factor = 1 let g:lazygit_floating_window_winblend = 20 " let g:memolist_memo_suffix = "md" " let g:memolist_fzf = 1 let g:netrw_nogx = 1 " disable netrw's gx mapping for openbrowser let g:silicon = {} let g:silicon['output'] = '~/Downloads/silicon-{time:%Y-%m-%d-%H%M%S}.png' let g:fzf_preview_fzf_preview_window_option = 'down:70%' let g:fzf_preview_use_dev_icons = 1 let g:fzf_preview_default_fzf_options = { \ '--reverse': v:true, \ '--preview-window': 'wrap', \ '--cycle': v:true, \ '--no-sort': v:true, \ } let g:markdown_fenced_languages = ['ts=typescript'] imap (skkeleton-enable) cmap (skkeleton-enable) let s:jisyoPath = '~/.cache/nvim/SKK-JISYO.L' if !filereadable(expand(s:jisyoPath)) echo "SSK Jisyo does not exists! '" . \ s:jisyoPath . "' is required!" let s:jisyoDir = fnamemodify(s:jisyoPath, ':h') let s:cmds = [ \ "curl -OL http://openlab.jp/skk/dic/SKK-JISYO.L.gz", \ "gunzip SKK-JISYO.L.gz", \ "mkdir -p " . s:jisyoDir, \ "mv ./SKK-JISYO.L " . s:jisyoDir, \ ] echo "To get Jisyo, run:" for cmd in s:cmds echo cmd endfor let s:choice = confirm("Run automatically?", "y\nN") if s:choice == 1 echo "Running..." for cmd in s:cmds call system(cmd) endfor echo "Done." endif endif call ddc#custom#patch_global('sources', ['skkeleton']) call ddc#custom#patch_global('sourceOptions', #{ \ skkeleton: #{ \ matchers: ['skkeleton'], \ minAutoCompleteLength: 1, \ }, \ }) call skkeleton#config(#{ \ eggLikeNewline: v:true, \ globalJisyo: expand(s:jisyoPath), \ showCandidatesCount: 1, \ immediatelyCancel: v:false, \ keepState: v:true, \ }) " call skkeleton#register_kanatable('rom', #{ " \ l: ['l', ''], " \ l-: ['-', ''], " \ l_: ['_', ''], " \ la: ['ぁ', ''], " \ le: ['ぇ', ''], " \ li: ['ぃ', ''], " \ ll: 'disable', " \ lo: ['ぉ', ''], " \ ltu: ['っ', ''], " \ lu: ['ぅ', ''], " \ lwa: ['ゎ', ''], " \ lya: ['ゃ', ''], " \ lyo: ['ょ', ''], " \ lyu: ['ゅ', ''], " \ }) call skkeleton#register_kanatable('rom', { \ "z\": ["\u3000", ''], \ }) function s:enable_ddc() abort let b:coc_suggest_disable = v:true call ddc#custom#patch_global('autoCompleteEvents', ['TextChangedI', 'TextChangedP', 'CmdlineChanged']) endfunction function s:disable_ddc() abort let b:coc_suggest_disable = v:false call ddc#custom#patch_global('autoCompleteEvents', []) endfunction call disable_ddc() augroup skkeleton " https://gist.github.com/yuki-yano/d2197be559841d0aeaf91344fde60b54 autocmd! autocmd User skkeleton-enable-pre call enable_ddc() autocmd User skkeleton-disable-pre call disable_ddc() augroup END "----------------- " coc.nvim configuration " https://github.com/neoclide/coc.nvim#example-vim-configuration "----------------- " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Make auto-select the first completion item and notify coc.nvim to format on enter " https://github.com/tpope/vim-endwise/issues/125#issuecomment-743921576 inoremap =coc_confirm() function! s:coc_confirm() abort if pumvisible() return coc#_select_confirm() else return "\u\\=coc#on_enter()\" endif endfunction " Use `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'help' expand('') elseif (coc#rpc#ready()) call CocActionAsync('doHover') else execute '!'.&keywordprg expand('') endif endfunction " Highlight the symbol and its references when holding the cursor. " autocmd CursorHold * silent call CocActionAsync('highlight') " Symbol renaming. nmap rn (coc-rename) " Formatting selected code. xmap f (coc-format-selected) nmap f (coc-format-selected) augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " Applying codeAction to the selected region. " Example: `aap` for current paragraph xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) " Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) " Remap and for scroll float windows/popups. nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" " Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of language server. nmap (coc-range-select) xmap (coc-range-select) " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocAction('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') "----------------- " Commands and Functions "----------------- command! RcEdit edit $MYVIMRC command! RcReload write | source $MYVIMRC | nohlsearch | redraw | echo 'init.vim is reloaded.' command! DenoFmt write | echo system("deno fmt -q ".expand("%:p")) | edit | echo 'deno fmt current file' command! CopyFullPath let @*=expand('%:p') | echo 'copy full path' command! CopyDirName let @*=expand('%:h') | echo 'copy dir name' command! CopyFileName let @*=expand('%:t') | echo 'copy file name' command! CopyRelativePath let @*=expand('%:h').'/'.expand('%:t') | echo 'copy relative path' command! -nargs=* T split | wincmd j | resize 12 | terminal command! Nyancat FloatermNew --autoclose=2 nyancat command! FzReadme call fzf#run(fzf#wrap(#{ \ source: values(map(copy(g:plugs), {k,v-> k.' '.get(split(globpath(get(v,'dir',''), '\creadme.*'), '\n'), 0, '')})), \ options: ['--with-nth=1', '--preview', 'bat --color=always --plain {2}'], \ sink: funcref('s:PlugReadmeFzf')})) function s:PlugReadmeFzf(name_and_path) abort execute 'PlugReadme' substitute(a:name_and_path, ' .*', '', '') endfunction " command! CocFlutter CocList --input=flutter commands " command! CocGo CocList --input=go commands " command! GoRun !go run %:p " command! CocMarkmap CocCommand markmap.create command! Trim lua MiniTrailspace.trim() command! BaTrim retab | Trim command! -bang GhGraph if !exists('g:loaded_floaterm') | call plug#load('vim-floaterm') | endif | \ execute 'FloatermNew' '--title=contributions' '--height=13' \ '--width=55' 'gh' 'graph' (0 ? '--scheme=random' : '') " https://github.com/neovim/neovim/pull/12383#issuecomment-695768082 " https://github.com/Shougo/shougo-s-github/blob/master/vim/autoload/vimrc.vim#L84 function! init#visual_paste(direction) range abort let registers = {} for name in ['"', '0'] let registers[name] = {'type': getregtype(name), 'value': getreg(name)} endfor execute 'normal!' a:direction for [name, register] in items(registers) call setreg(name, register.value, register.type) endfor endfunction " https://zenn.dev/skanehira/articles/2021-11-29-vim-paste-clipboard-link let s:clipboard_register = has('linux') || has('unix') ? '+' : '*' function! init#markdown_link_paste() abort let link = trim(getreg(s:clipboard_register)) if link !~# '^http' normal! gv call init#visual_paste('p') return endif let old = getreg(0) normal! gv"9y call setreg(9, printf('[%s](%s)', getreg(9), link)) normal! gv"9p call setreg(9, old) for name in ['"', '0'] call setreg(name, link) endfor endfunction " [vimのマーク機能をできるだけ活用してみる - Make 鮫 noise](http://saihoooooooo.hatenablog.com/entry/2013/04/30/001908) " let g:mark_chars = ['h', 'j', 'k', 'l'] " function! s:AutoMark() abort " let b:mark_pos = exists('b:mark_pos') ? (b:mark_pos + 1) % len(g:mark_chars) : 0 " execute 'normal! m' . g:mark_chars[b:mark_pos] " echo 'auto-marked' g:mark_chars[b:mark_pos] " endfunction " function! s:AutoJump() abort " if !exists('b:mark_pos') " echo 'not auto-marked yet.' " return " endif " execute 'normal! `' . g:mark_chars[b:mark_pos] " echo 'jumped to mark' g:mark_chars[b:mark_pos] " endfunction " [neovim terminal](https://gist.github.com/pocari/fd0622fb5ec6946a368e8ee0603979ae) " exitフックを指定して:terminalを開く function! s:termopen_wrapper(cmd) abort " terminalの終了時にバッファを消すフック function! OnTermExit(job_id, code, event) dict " Process Exit表示後の押下を自動化する call feedkeys("\") endfunction call termopen(a:cmd =~ '^\s*$' ? $SHELL : a:cmd, {'on_exit': function('OnTermExit')}) " call termopen(a:cmd =~ '^\s*$' ? $SHELL : a:cmd) endfunction function! TermHelper(h_or_v, size, cmd) abort " echo a:cmd if a:h_or_v == 'h' topleft new | execute 'Eterminal ' . a:cmd execute 'resize ' . a:size else vertical botright new | execute 'Eterminal ' . a:cmd execute 'vertical resize ' . a:size endif endfunction " 水平ウィンドウ分割してターミナル表示 引数はwindowの行数指定(Horizontal terminal) command! -count=15 -nargs=* Hterminal :call TermHelper('h', , ) " 垂直ウィンドウ分割してターミナル表示 引数はwindowの行数指定(Vertical terminal) command! -count=80 -nargs=* Vterminal :call TermHelper('v', , ) " ウィンドウ分割なしでターミナル表示(Extended Terminal) command! -nargs=* Eterminal :call s:termopen_wrapper() " command! DenoRepl silent only | botright 12 new | execute 'terminal deno' command! -nargs=* -bang Dex silent only! | botright 12 split | \ execute 'terminal' (has('nvim') ? '' : '++curwin') 'dex' \ (0 ? '--clear' : '') expand('%:p') | \ stopinsert | execute 'normal! G' | set bufhidden=wipe | \ execute 'autocmd BufEnter if winnr("$") == 1 | quit! | endif' | \ file Dex | wincmd k command! Croc execute '!croc send ' expand('%:p') lua << EOF -- [url-encode.lua](https://gist.github.com/liukun/f9ce7d6d14fa45fe9b924a3eed5c3d99) -- [string/gsub - Lua Memo](https://aoikujira.com/wiki/lua/index.php?string%252Fgsub) function urlencode(url) if url == nil then return '' end return url:gsub("\n", "\r\n") :gsub("([^%w _%%%-%.~])", function(c) return string.format("%%%02X", string.byte(c)) end) :gsub(" ", "+") end EOF " https://github.com/kristijanhusak/vim-carbon-now-sh/blob/master/plugin/vim-carbon-now-sh.vim command! -range=% CarbonNowSh ,call s:carbonNowSh() function! s:carbonNowSh() range "{{{ if !exists('g:loaded_openbrowser') call plug#load('open-browser.vim') endif let l:code = s:urlEncode(s:getVisualSelection()) let l:url = 'https://carbon.now.sh/?l=' .. &filetype .. '&code=' .. l:code call openbrowser#open(l:url) endfunction "}}} function! s:urlEncode(string) "{{{ return v:lua.urlencode(a:string) endfunction "}}} function! s:getVisualSelection() "{{{ let [l:line_start, l:column_start] = getpos("'<")[1:2] let [l:line_end, l:column_end] = getpos("'>")[1:2] let l:lines = getline(l:line_start, l:line_end) if len(l:lines) == 0 return '' endif let l:lines[-1] = l:lines[-1][:l:column_end - (&selection ==? 'inclusive' ? 1 : 2)] let l:lines[0] = l:lines[0][l:column_start - 1:] return join(l:lines, "\n") endfunction "}}} " braces motion " (count)+braces+action " [ to effect prev, ] to effect next " m to move, t to copy, o to add blank line " use capital to fix cursor position " nnoremap [m ':move-' . (v:count1 + 1) . '=l' " nnoremap ]m ':move+' . v:count1 . '=l' " nnoremap [M ':move-' . (v:count1 + 1) . '=l' . v:count1 . 'j' " nnoremap ]M ':move+' . v:count1 . '=l' . v:count1 . 'k' " nnoremap [t ':copy-' . v:count1 . '=l' " nnoremap ]t ':copy+' . (v:count1 - 1) . '=l' " nnoremap [T 'mz:copy-' . v:count1 . '=l`z:delmarks z' " nnoremap ]T 'mz:copy+' . (v:count1 - 1) . '=l`z:delmarks z' " nnoremap [o '' . v:count1 . 'O' . (v:count ? v:count - 1 . 'k' : '') " nnoremap ]o '' . v:count1 . 'o' " nnoremap [O 'mz' . v:count1 . 'O`z:delmarks z' " nnoremap ]O 'mz' . v:count1 . 'o`z:delmarks z' " xnoremap [m :move'<-2gv=gv " xnoremap ]m :move'>+1gv=gv " xnoremap [M :move'<-2gv=gvj " xnoremap ]M :move'>+1gv=gvk " xnoremap [t :copy'<-2gv=gv " xnoremap ]t :copy'>+1gv=gv " xnoremap [T :copy'<-2gv=gvj " xnoremap ]T :copy'>+1gv=gvk "----------------- " Key mappings " :map ノーマル、ビジュアル、選択、オペレータ待機 " :nmap ノーマル " :vmap ビジュアル、選択 " :smap 選択 " :xmap ビジュアル " :omap オペレータ待機 " :map! 挿入、コマンドライン " :imap 挿入 " :lmap 挿入、コマンドライン、Lang-Arg " :cmap コマンドライン " :tmap 端末ジョブ "----------------- " global noremap j gj noremap k gk noremap gj j noremap gk k noremap gV `[v`] noremap H ^ noremap L $ noremap [b bprevious noremap ]b bnext noremap [B bfirst noremap ]B blast noremap [q cprevious noremap ]q cnext noremap [Q cfirst noremap ]Q clast map M % nmap s xmap s nnoremap so :HopChar1 nnoremap st :HopChar2 nnoremap sl HopLine nnoremap sw HopWord noremap n execute('normal! ' . v:count1 . 'n')lua require('hlslens').start() noremap N execute('normal! ' . v:count1 . 'N')lua require('hlslens').start() map * (asterisk-z*)lua require('hlslens').start() map # (asterisk-gz*)lua require('hlslens').start() " normal nnoremap :WinResizerStartResize " nnoremap mm :call AutoMark() " nnoremap m, :call AutoJump() nnoremap S :%s/\V///g " [Vim で q を prefix キーにする - 永遠に未完成](https://thinca.hatenablog.com/entry/q-as-prefix-key-in-vim) nnoremap