2015-07-13 55 views
2

錯誤我在~/.vim/after/indent/sml.vim標準ML註釋的格式是VIM

set comments=s1:(*,mb:*,ex:*) 
set comments=sr:(*,mb:*,ex:*) 
set comments=s1:(*,mb:\ *,ex:*) 
set comments=sr:(*,mb:*,ex:*) 

與各種組合嘗試下面的命令格式化的意見等。我似乎無法實現C風格的評論,其中中間評論行縮進了1個空格。取而代之的是

(* Text 
* More text 
* even more text *) 

我得到這個

(* 
* Some misaligned text 
* etc. *) 

有什麼建議? :h format-options comments fo-table不建議任何看起來有用的替代方案。

回答

0

當我使用這些設置,

set comments=s1:(*,mb:*,ex:*) 
set comments=sr:(*,mb:*,ex:*) 
set comments=s1:(*,mb:\ *,ex:*) 
set comments=sr:(*,mb:*,ex:*) 

我得到下面的結果,

(* blah blah blah blah blah adsf blah blah blah blah blah blah blah blah 
* blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
* blah blah blah blah blah blah ... 

這個工作無論我

  • set formatoptions+=tset textwidth=80並超過行,
  • set formatoptions+=r並按下回車鍵,
  • set formatoptions+=o並在命令模式下打到o/O,或
  • set formatoptions+=q,打gq

在我的〜/ .vimrc au Filetype sml source ~/.vim/after/indent/sml.vim

這是在Ubuntu 15.04的默認Vim的:

:version 
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:32) 
Included patches: 1-52 
Modified by [email protected] 
Compiled by [email protected] 
Huge version without GUI. Features included (+) or not (-): 
... 

也許你有一個影響這種行爲其他一些設置或插件。

+0

我試圖禁用我的所有插件和使用裸配置的最小值: '設置nocompatible 類型插件縮進上 語法enable' 並得到了相同result.This是(G)的Vim在Windows,版本7.4。 – neoDaedalus