vim:在文本宽度位置插入'\'时自动缩进

时间:2013-02-27 10:54:29

标签: vim

使用vim我希望在#define,string和其他所有其他情况下使用'\'时,在自动识别(在文本宽度位置)功能时,使用'\'来忽略换行符。

这是例子(text-width = 78):

 /* '\' at maximum text-width */
 #define HELLO "I Think this feature already exist but I wasn't able to find \
               it so far.


 /* usual situation */
 #define HELLO \
         "I Think this feature already exist but I wasn't able ..."


 /* what i would like to have (without identing it myself) */
 #define HELLO                                                               \
         "I Think this feature already exist but I wasn't able ..."

1 个答案:

答案 0 :(得分:0)

我没有自动解决方案,但至少你可以使用我的AlignFromCursor plugin快速手动右对齐延续字符,{{3}}具有<Leader>ri映射,可以对齐光标右侧的文本在'textwidth'