Setting specific column tab stops in Vim

核能气质少年 提交于 2019-12-01 14:33:03

问题


I am reasonably familiar with Vim's option for tabstop, softtabstop, shiftwidth, expandtabs, etc.

However, I'm wondering if there is a way in Vim to set specific column tab stops.

I need tab stops in the following columns: 7, 11, 14, 17, ... every 3 after that.

Thanks in advance.`


回答1:


I found this thread http://vim.1045645.n5.nabble.com/Arbitrary-tab-stops-td1211888.html. Seems like that feature exists for a while as a patch.

+                       *'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.
+ 


来源:https://stackoverflow.com/questions/7989466/setting-specific-column-tab-stops-in-vim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!