You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Vim Goyo模式下移除波浪线与脱字符?

How to Hide Tildes (~) and Trailing Whitespace Carets (^) in Vim Goyo Mode

Absolutely! You can absolutely make both the tilde characters (shown at the end of the buffer) and the caret markers for trailing whitespace disappear when Goyo mode is active. Here's a clean, non-intrusive way to set this up in your Vim configuration:

Step-by-Step Configuration

Add these lines to your ~/.vimrc (or init.vim if you're using Neovim):

" Hide tildes and trailing whitespace carets when entering Goyo
autocmd! User GoyoEnter
autocmd User GoyoEnter setlocal fillchars+=eob:\  listchars-=trail:^

" Restore original settings when exiting Goyo
autocmd! User GoyoLeave
autocmd User GoyoLeave setlocal fillchars-=eob:\  listchars+=trail:^

What This Does

Let's break down the key parts:

  • Tilde (~) removal: The fillchars option controls how Vim draws special characters. By setting eob:\ (note the space after the backslash), we replace the default tilde for "end of buffer" lines with an invisible space.
  • Caret (^) removal: The listchars option defines markers for whitespace characters. Removing trail:^ tells Vim not to show a caret for trailing spaces at the end of lines.
  • Autocmd triggers: We use Goyo's built-in GoyoEnter and GoyoLeave events to apply these changes only when Goyo is active, and revert them when you exit the mode. This way your normal Vim setup stays intact.

Optional: If You Want to Disable All List Markers

If you don't need any whitespace markers at all in Goyo mode, you can simplify the configuration:

autocmd! User GoyoEnter
autocmd User GoyoEnter setlocal fillchars+=eob:\  nolist

autocmd! User GoyoLeave
autocmd User GoyoLeave setlocal fillchars-=eob:\  list

This turns off Vim's list mode entirely while in Goyo, hiding all whitespace markers including tabs or non-breakable spaces.

内容的提问来源于stack exchange,提问作者cgg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 08:28:37