質問

vimの中の関数を倍にする方法やツールは、Visual StudioやEclipseのような、ありますか?

役に立ちましたか?

解決

    Vim folding commands
---------------------------------
zf#j creates a fold from the cursor down # lines.
zf/ string creates a fold from the cursor to string .
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
za toggle a fold at the cursor.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zc closes a fold under cursor. 
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.

ソース:vimのドキュメント

他のヒント

はい。 VIMは、例外的な折りたたみ機能を備えています。私はあまりにも多くのコントロールを学ぶように、私はここで私は個人的に使用するもので、自動化を好まない:

私の.vimrcで

set foldmethod=indent
set foldlevel=1
set foldclose=all

これは自動的に1つの以上のレベルのインデントすべてのために、インデントに基づいて、あなたが開いたファイルを折ります。 foldcloseオプションは、私は倍のうち移動した後に再接近自動的に倍になります。

でファイルコントロール:

zo - opens folds
zc - closes fold
zm - increases auto fold depth
zr - reduces auto fold depth

そして、あなたがこれまでに折り目とイライラ場合は、使用

: set foldmethod=syntax

またはを押します:

zR

彼らはすべて離れて行くようにします。

:set foldmethod=syntax

あなたはあなたの言語の構文ファイルがある場合は、自動的にすべての関数と他のブロックを折る必要があります。

Vimは優れた折りたたみをサポートしています。 vimのヘルプシステムの良いドキュメントがあります。ただ、オープンのvimてみませんか。

:help usr_28.txt 

あなたも読むことができることを読んだ後、

:help folding

いくつかのより多くの情報のため。

はい、それは「Z」キーにバインドされ、例えばZOは、すべての折り目を開きます。参照「:ヘルプはフォールド」詳細については、vimの中で。あなたはインデントのような、非常に単純なルールに基づいて折りたたみ、またはコードの構文に従って行うことができます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top