3

vim(およびvi)では、コマンドモードで入力[[すると、ファイルの先頭に移動するように見え、入力すると]]、ファイルの末尾に移動するように見えます。しかし、私はそれをファイルコマンドの開始/終了だと思ったので、gg何か違うことをしているのでしょうか? G[[]]

私の推測では、[[それ]]は何かの次のインスタンスに進むでしょうが、私は何を理解することができません。

4

4 に答える 4

4

試してみてください:help ]]

]][count]セクションは、最初の列の次の'{'に進みます。

さらに読む::help section

プロのヒント:コマンドを検索して組み込みをナビゲートする方法を学びます:help。それは包括的であり、多くのヒントを提供します。他のエディターほど速くVimを学ぶことはできませんが、継続的な学習に取り組むと、非常に強力で効率的なエディターになるでしょう。

于 2013-03-26T11:45:50.137 に答える
4

このヒントを見るまで、のデフォルトの動作[[]]便利なものは見つかりませんでした:help section

If your '{' or '}' are not in the first column, and you would like to use "[["
and "]]" anyway, try these mappings:

   :map [[ ?{<CR>w99[{
   :map ][ /}<CR>b99]}
   :map ]] j0[[%/{<CR>
   :map [] k$][%?}<CR>
于 2017-01-23T20:03:12.803 に答える
3

から:help [[

[[          [count] sections backward or to the previous '{' in
            the first column.  |exclusive|
            Note that |exclusive-linewise| often applies.
于 2013-03-26T11:44:46.173 に答える
2

私の知る限り、

[[ : jump to function start
]] : jump to function end

編集:私はまた、以下を定義するチートシートを見つけました:

(  [count] : sentences backward
)  [count] : sentences forward
{  [count] : paragraphs backward
}  [count] : paragraphs forward
]] [count] : sections forward or to the next '{' in the first column. When used after an operator, then the '}' in the first column.
][ [count] : sections forward or to the next '}' in the first column
[[ [count] : sections backward or to the previous '{' in the first column
]] [count] : sections backward or to the previous '}' in the first column
于 2013-03-26T11:42:31.457 に答える