2012-05-30 14 views
5

これらは私のフォーマットオプションの.vimrcで以下のようにフォーマットするにはどうすればよいですか?

set formatoptions=tqronw 
set formatlistpat=^\\([\\-\\*]\\\|[0-9]\\+[.)]\\)\\s* 
set textwidth=72 
set autoindent 

1)
マイテキスト:

- This is my text this is my text this is my text this is my text this is my text this is my text. 

出力フォーマット後:

- This is my text this is my text this is my text this is my text this is my 
text this is my text. 

予想される出力:

- This is my text this is my text this is my text this is my text this is my 
    text this is my text. 

2)
マイテキスト:

for Biochemistry, conducted a quality clinical study to determine the effects of microwave cooking on food 

出力フォーマット後:

for Biochemistry, conducted a quality clinical study to determine the 
effects of microwave cooking on food 

予想される出力:

for Biochemistry, conducted a quality clinical study to determine the 
effects of microwave cooking on food 

編集
私の最初の質問のための解決策が見つかりました:)
テキストに(見えない)nbsp(壊れていないスペース)がありました。
通常のスペースで代用すると、フォーマットは期待どおりに行われました。

+1

が非破壊スペースは通常のスペースで区別できるようにするには、 'セットリストLCS =タブを使用します。\ \、NBSP:\ \:_'(それも意味が他の何かそして']タブを使用することができます'ここでもタブを見る)。どのオプションも、幅の異なる他の大規模なUnicode空間を強調表示することはありませんが、すべてが非改行スペースと同じ効果を持つ可能性があります。 – ZyX

答えて

1

2番目の質問には野生の推測をしましょう。追加してみてください:

set nosmartindent 
+0

うれしかったです。昔、私は巨大な.vimrc上でバイナリ検索を行うレベルまで落とさなければならないことを思い出しました。 – PonyEars

関連する問題