当超过textwidth
时,Vim如何确定断行的位置,以及如何控制此行为?例如,输入
a = really_long_function_call(some_super_long_parameter_name_that_i_want_wrapped
以set textwidth=72
结果
a =
really_long_function_call(some_super_long_parameter_name_that_i_want_wrapped
当我想要的是提供更复杂的逻辑时,会破坏呼叫的左括号,例如,
a = really_long_function_call(
some_super_long_parameter_name_that_i_want_wrapped
答案 0 :(得分:1)
这在:help 'textwidth'
解释:
正在插入的文本的最大宽度。更长的路线将是 在空格后断开以获得此宽度。
要解决这个问题,您必须编写一个执行文本分解的函数,并通过'formatexpr'
选项进行安装。到目前为止我还没有看到过这个问题,而且这方面的帮助也很少,所以这里需要付出一些努力。
请注意,对于仅视觉,软包装, 可以通过:set wrap linebreak breakat=...