私はVIMドキュメントで解決策を見つける前に、同じ質問に対する回答を探していました。だから、私はスレッドを更新し、他の時間を節約すると思った。
私の場合の問題は、デフォルトのftpluginがtextwidthを無効にしていたことでした。
vimrcの後にfpluginsがソースされているため、.vimrcを()で更新するだけでは機能しません。ここで
は私が続く手順は次のとおりです。
1)何をあなたの現在のformatoptionsを見つけるには)vimの内部で(
:set formatoptions?
formatoptions=croql (note no 't')
2)vimdocs(http://vimdoc.sourceforge.net/htmldoc/filetype.html#ftplugin-overruleによって提案されたfiletype.vimファイルを作成します)
Overrule the settings after loading the global plugin.
You must create a new filetype plugin in a directory from the end of
'runtimepath'. For Unix, for example, you could use this file:
vim ~/.vim/after/ftplugin/fortran.vim
In this file you can change just those settings that you want to change.
3)の行を追加します。:set formatoptions+=t
& &そのファイル内の0。
Voila!次回にファイルを開くと、textwidthが目的の文字に設定されます。
デバッグの助けとして、あなたのコマンドに冗長を付けることで、どのファイルがあなたのvimrc設定を無効にしているかをいつでも確認できます。従って、例えば。私は最後のformatoptionsを更新誰がチェックしたい場合は、私は
:verbose set formatoptions?
formatoptions=croqlt
Last set from ~/.vim/after/ftplugin/fortan.vim
の詳細については
:h fo-table
を参照してください。また 'てみてください:セットペーストを'?。それも干渉することができます。 – patrickvacek私にとっては、リーダー配列にマップされたのは ':set paste'でした。ありがとう@patrickvacek – OregonTrail