Nvim :help
ページは、このスクリプトを使用して、ソースから tree-sitter-vimdoc パーサーで生成されています。
CTRL-]
コマンドを実行する前の位置に戻ります。 :tselect 一致するタグのリストから1つのタグを選択します。/* */
, #if, #else, #endif に移動します。 [/ 前のコメントの開始位置に移動します。 ]/ 次のコメントの終了位置に移動します。 [# 閉じられていない #if、#ifdef、または #else に戻ります。 ]# 閉じられていない #else または #endif に進みます。 [( 閉じられていない '(' に戻ります。 ]) 閉じられていない ')' に進みます。 [{ 閉じられていない '{' に戻ります。 ]} 閉じられていない '}' に進みます。map _u :call ID_search()<Bar>execute "/\\<" .. g:word .. "\\>"<CR> map _n :n<Bar>execute "/\\<" .. g:word .. "\\>"<CR> function! ID_search() let g:word = expand("<cword>") let x = system("lid --key=none " .. g:word) let x = substitute(x, "\n", " ", "g") execute "next " .. x endfunこれを使用するには、カーソルを単語の上に置き、"_u" と入力すると、vim はその単語を含むファイルをロードします。"n" で同じファイル内の単語の次の出現箇所を検索します。"_n" で次のファイルに移動します。
:inoremap <C-E> <C-X><C-E> :inoremap <C-Y> <C-X><C-Y>ただし、これにより、カーソルの上下にある行からテキストをコピーする機能が失われます i_CTRL-E。
:map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y> :map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
:ab teh the :ab fro for
:%s/./&/gn characters :%s/\i\+/&/gn words :%s/^//n lines :%s/the/&/gn "the" anywhere :%s/\<the\>/&/gn "the" as a word'hlsearch' をリセットするか、":nohlsearch" を実行することをお勧めします。一致がない場合にエラーが発生しないようにするには、'e' フラグを追加します。
:echo strlen(@")改行は 1 バイトとしてカウントされます。
:map <F2> msHmtgg/Last [cC]hange:\s*/e+1<CR>"_D"=strftime("%Y %b %d")<CR>p'tzt`s位置の保存を分割する: ms カーソル位置を 's' マークに保存する H ウィンドウの最初の行に移動する mt この位置を 't' マークに保存する
*.c
を *.bla
に名前変更したいとします。次のようにします。$ vim :r !ls *.c :%s/\(.*\).c/mv & \1.bla :w !sh :q!
:%s/Jones/Smith/g :%s/Allen/Peter/g :update
vim *.let argdo source subs.vim:argdo を参照してください。
if ($?prompt == 0) then exit 0 endifもう 1 つの方法は、'shell' オプションに "-f" フラグを含めることです。例:
:set shell=csh\ -f(バックスラッシュは、オプションにスペースを含めるために必要です)。これにより、csh は .cshrc ファイルの使用を完全にスキップします。ただし、これにより、一部の機能が動作しなくなる可能性があります。
:map ' `シングルクォートをバッククォートのように動作させます。行の最初の空白以外の文字に移動する代わりに、マークの列にカーソルを置きます。
" start of line :cnoremap <C-A> <Home> " back one character :cnoremap <C-B> <Left> " delete character under cursor :cnoremap <C-D> <Del> " end of line :cnoremap <C-E> <End> " forward one character :cnoremap <C-F> <Right> " recall newer command-line :cnoremap <C-N> <Down> " recall previous (older) command-line :cnoremap <C-P> <Up> " back one word :cnoremap <Esc><C-B> <S-Left> " forward one word :cnoremap <Esc><C-F> <S-Right>
:let m = ":map _f :set ai<CR>" " need 'autoindent' set :let m ..= "{O<Esc>" " add empty line above item :let m ..= "}{)^W" " move to text after bullet :let m ..= "i <CR> <Esc>" " add space for indent :let m ..= "gq}" " format text after the bullet :let m ..= "{dd" " remove the empty line :let m ..= "5lDJ" " put text after bullet :execute m |" define the mapping(<> 表記 <>。これはすべて文字通りに入力されることに注意してください。^W は "^" "W" で、
|"
で始まっていることに注意してください。これは、":execute" コマンドがコメントを直接受け入れないためです。:set tw=70ほぼ同じことを行いますが、リストのインデントを最初の行から取得するマッピング (注: このマッピングは、多くのスペースを含む 1 つの長い行です)
:map _f :set ai<CR>}{a <Esc>WWmmkD`mi<CR><Esc>kkddpJgq}'mJO<Esc>j
:map ;b GoZ<Esc>:g/^$/.,/./-j<CR>Gdd :map ;n GoZ<Esc>:g/^[ <Tab>]*$/.,/[^ <Tab>]/-j<CR>Gdd
:%s=\(\t.*\.txt\)\t=\1.gz\t=(3) vimrc に次の行を追加します。
set helpfile={dirname}/help.txt.gzここで、
{dirname}
はヘルプファイルがあるディレクトリです。gzip プラグインは、ファイルの解凍を処理します。圧縮された "doc" ディレクトリと同じ場所にない場合、$VIMRUNTIME が他の Vim ファイルがある場所に設定されていることを確認する必要があります。$VIMRUNTIME を参照してください。" vim -b : edit binary using xxd-format! augroup Binary autocmd! autocmd BufReadPre *.bin set binary autocmd BufReadPost *.bin \ if &binary \ | execute "silent %!xxd -c 32" \ | set filetype=xxd \ | redraw \ | endif autocmd BufWritePre *.bin \ if &binary \ | let s:view = winsaveview() \ | execute "silent %!xxd -r -c 32" \ | endif autocmd BufWritePost *.bin \ if &binary \ | execute "silent %!xxd -c 32" \ | set nomodified \ | call winrestview(s:view) \ | redraw \ | endif augroup END
" This is for automatically adding the name of the file to the menu list. " It uses a self-destroying mapping! " 1. use a line in the buffer to convert the 'dots' in the file name to \. " 2. store that in register '"' " 3. add that name to the Buffers menu list " WARNING: this does have some side effects, like overwriting the " current register contents and removing any mapping for the "i" command. " autocmd BufNewFile,BufReadPre * nmap i :nunmap i<CR>O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><CR><CR> autocmd BufNewFile,BufReadPre * normal iおそらくより良い別の方法は、":execute" コマンドを使用することです。文字列内で、<> 記法の前にバックスラッシュを付けることで使用できます。既存のバックスラッシュの数を 2 倍にし、'"' の前にバックスラッシュを付けることを忘れないでください。
autocmd BufNewFile,BufReadPre * exe "normal O\<C-R>%\<Esc>:.g/\\./s/\\./\\\\./g\<CR>0\"9y$u:menu Buffers.\<C-R>9 :buffer \<C-R>%\<C-V>\<CR>\<CR>"実際のバッファメニューには、ユーザー関数を使用する必要があります(:function を参照)。ただし、その場合は <> 記法は使用されないため、ここでは例として使用できません。
let s:paren_hl_on = 0 function s:Highlight_Matching_Paren() if s:paren_hl_on match none let s:paren_hl_on = 0 endif let c_lnum = line('.') let c_col = col('.') let c = getline(c_lnum)[c_col - 1] let plist = split(&matchpairs, ':\|,') let i = index(plist, c) if i < 0 return endif if i % 2 == 0 let s_flags = 'nW' let c2 = plist[i + 1] else let s_flags = 'nbW' let c2 = c let c = plist[i - 1] endif if c == '[' let c = '\[' let c2 = '\]' endif let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .. \ '=~? "string\\|comment"' execute 'if' s_skip '| let s_skip = 0 | endif' let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip) if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') exe 'match Search /\(\%' .. c_lnum .. 'l\%' .. c_col .. \ 'c\)\|\(\%' .. m_lnum .. 'l\%' .. m_col .. 'c\)/' let s:paren_hl_on = 1 endif endfunction autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren() autocmd InsertEnter * match none
:HelpCurwin
コマンドを試してください。command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>) let s:did_open_help = v:false function s:HelpCurwin(subject) abort let mods = 'silent noautocmd keepalt' if !s:did_open_help execute mods .. ' help' execute mods .. ' helpclose' let s:did_open_help = v:true endif if !empty(getcompletion(a:subject, 'help')) execute mods .. ' edit ' .. &helpfile set buftype=help endif return 'help ' .. a:subject endfunction