How to stop line breaking in vim

前端 未结 11 2030
执笔经年
执笔经年 2020-12-12 10:06

I like that the long lines are displayed over more than one terminal line; I don’t like that vim inserts newlines into my actual text. Which part of .vimrc I should change?

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 10:45

    I like that the long lines are displayed over more than one terminal line

    This sort of visual/virtual line wrapping is enabled with the wrap window option:

    set wrap
    

    I don’t like that vim inserts newlines into my actual text.

    To turn off physical line wrapping, clear both the textwidth and wrapmargin buffer options:

    set textwidth=0 wrapmargin=0
    

提交回复
热议问题