设置特定列选项卡在Vim中停止

时间:2011-11-03 01:53:50

标签: vim indentation

我非常熟悉Vim对tabstopsofttabstopshiftwidthexpandtabs等的选项。

但是,我想知道Vim是否有办法设置特定的列标签停止。

我需要在以下列中使用制表位:7,11,14,17,...之后每3个。

提前致谢。

1 个答案:

答案 0 :(得分:7)

我找到了这个帖子http://vim.1045645.n5.nabble.com/Arbitrary-tab-stops-td1211888.html。似乎该功能作为补丁存在了一段时间。

+                       *'vartabstop'* *'vts'*
+ 'vartabstop' 'vts'    string  (default 8)
+           local to buffer
+           {only available when compiled with the |+vartabs|
+           feature}
+           {not in Vi}
+   A list of the number of spaces that a  in the file counts for,
+   separated by commas.  Each value corresponds to one tab, with the
+   final value applying to all subsequent tabs. For example: 
+       :set vartabstop=4,20,10,8
+   This will make the first tab 4 spaces wide, the second 20 spaces,
+   the third 10 spaces, and all following tabs 8 spaces.
+ 
+   Note that the value of |'tabstop'| will be ignored while 'vartabstop'
+   is set.
+