vim - 停止 Vim 在单词中间换行

标签 vim

执行 :set wrap 后,Vim 会换行比窗口长的行。

但是 Vim 是否可以仅在空格处换行,而不是在单词的中间换行?

最佳答案

:帮助换行

This option changes how text is displayed. It doesn't change the text in the buffer, see 'textwidth' for that. When on, lines longer than the width of the window will wrap and displaying continues on the next line. When off lines will not wrap and only part of long lines will be displayed. When the cursor is moved to a part that is not shown, the screen will scroll horizontally. The line will be broken in the middle of a word if necessary. See 'linebreak' to get the break at a word boundary.

:帮助换行

If on Vim will wrap long lines at a character in 'breakat' rather than at the last character that fits on the screen.

:帮助破解

'breakat' 'brk' string (default " ^I!@*-+;:,./?")

因此,:set linebreak 应该可以开箱即用。或者您可以将 breakat 限制为仅在空格上中断,而不是空格+标点符号。

关于vim - 停止 Vim 在单词中间换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9692525/

相关文章:

c - 基于 VIM 中 switch/case 语句范围的 cindent 缩进问题

vim - 如何将前导空格转换为制表符?

vim 去 : Can't get autocompletion

vim - 如何在 Vim 中启用 'gx'?我的不能用了

vim - 如何在vim中转到文件末尾同时保留光标下的当前列?

vim - 使用 Vim 的持久撤销?

linux - VIM ( gvim ) 在 Linux 桌面上为 gVIm 存储的颜色设置在哪里?

python - 如何在不锁定 Vim 的情况下运行当前的 python 脚本?

vim - 防止 NERD Tree 在启动时打开缓冲区

perl - 屏幕抓取 : Automating a vim script