Настройка определенных вкладок столбцов в Vim - PullRequest
9 голосов
/ 03 ноября 2011

Я достаточно знаком с опцией Vim для tabstop, softtabstop, shiftwidth, expandtabs и т. Д.

Тем не менее, мне интересно, есть ли способ в Vim установить определенные столбцы табуляции.

Мне нужны табуляции в следующих столбцах: 7, 11, 14, 17, ... каждые 3 после этого.

Заранее спасибо.

1 Ответ

7 голосов
/ 03 ноября 2011

Я нашел эту тему 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.
+ 
...