myyou
V2EX  ›  Vim

如何禁止 vim 自动换行?

  •  
  •   myyou · Jul 5, 2016 · 14392 views
    This topic created in 3636 days ago, the information mentioned may be changed or developed.

    电脑屏幕小, vim 在一行文字比较长是会自动换行,这样会把原本一行的文字变为两行。如何不让 vim 自动换行?

    5 replies    2016-07-06 14:03:53 +08:00
    htfy96
        1
    htfy96  
       Jul 5, 2016 via Android
    记得是 set linebreak!
    xuboying
        2
    xuboying  
       Jul 5, 2016 via Android
    wrap 相关的设置
    vinceguo
        3
    vinceguo  
       Jul 5, 2016 via Android
    自动换行只是显示而已,实际还是一行吧
    你也许需要 set number
    SpicyCat
        4
    SpicyCat  
       Jul 5, 2016   ❤️ 1
    :h wrap

    :set nowrap

    猜测楼主的 vimrc 是用别人的吧? vim 默认是不换行的。
    ashfinal
        5
    ashfinal  
       Jul 6, 2016
    setlocal nowrap
    setlocal textwidth=0

    仅对当前 buffer 起作用,不影响全局。

    无耻滴加个广告,我的 vimrc 配置: https://github.com/ashfinal/vimrc-config
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2582 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 09:11 · PVG 17:11 · LAX 02:11 · JFK 05:11
    ♥ Do have faith in what you're doing.