2

現在EnhancedCommentify、コメント、特にこれら2つのコマンドを切り替えるためにプラグインを使用しています

map <M-c> <plug>Comment
map <M-d> <plug>DeComment

しかし問題は、次のような行をコメントアウトする代わりに

____#I am a comment (_ in front is white space)

として表示されます

#____I am a comment

EnhancedCommentifyこれを修正する簡単な方法はありますか?またはこれを達成する他の方法は、現在のキーバインディングを変更しないのが最善ですか? ありがとう。

ところでNerdTree私のvimバージョンではうまくいかないようで、私はrootユーザーではないので...

4

1 に答える 1

1

tCommentを試してください。私はそれを使用し、vim 7.0 をサポートしています。gcモーションを使用して複数のファイルタイプにコメントすることができます。

gc{motion}   :: Toggle comments (for small comments within one line 
                the &filetype_inline style will be used, if 
                defined)
gcc          :: Toggle comment for the current line
gC{motion}   :: Comment region
gCc          :: Comment the current line

病原体を使用している場合は、それをインストールできます

cd ~/.vim/bundle; git clone "https://github.com/VimEz/tComment.git"

次に、vim を再起動するだけで準備完了です。

于 2012-08-16T20:02:47.430 に答える