vim linux列格式化 - 处理字符串文字

时间:2015-06-17 14:05:33

标签: linux vim multiple-columns

在VIM中进行一些编程我想在列中自动排列一些内容。做:!column -t在很大程度上起作用,但它不知道字符串文字的概念,所以它们也会被修改。是否有任何简短的方法可以将字符串文字视为列的单个单元格?

*编辑*

例如,如果我目前有行

stringType short "Short string" plusSome
otherStringType longStringName "Intentionally do a longer string" plusSomeMore

我希望将其格式化为

stringType      short          "Short string"                     plusSome
otherStringType longStringName "Intentionally do a longer string" plusSomeMore

而不是

stringType      short          "Short         string" plusSome
otherStringType longStringName "Intentionally do      a        longer string" plusSomeMore

1 个答案:

答案 0 :(得分:1)

看看tabular插件,它会做你想要的,还有更多。有关快速介绍,请参阅this screencast