vim 显示语法_在Vim中禁用语法突出显示

vim 显示语法

vim 显示语法

I’m the type of geek that always has an open ssh session connected to my servers, but ever since I switched to using a Mac running OS X, I noticed a huge annoyance in my terminal… the syntax highlighting makes it impossible to read the files I’m trying to edit.

我是那种总是将开放的ssh会话连接到我的服务器的怪胎,但是自从我改用运行OS X的Mac之后,我注意到我的终端非常烦人……语法突出显示使其无法读取我正在尝试编辑的文件。

Note that this isn’t the fault of OS X, it’s because I’ve got ansi color turned on and my settings configured wrong. So, how to disable syntax highlighting in Vim?

请注意,这不是OS X的问题,这是因为我打开了ansi颜色并且我的设置配置错误。 那么,如何在Vim中禁用语法高亮显示呢?

Look, somebody puked a rainbow into my terminal window…

看,有人把彩虹塞进了我的终端窗口…

image

Disable for Current Session

禁用当前会话

If you type :syntax off into the current editor, it’ll turn the syntax highlighting off immediately:

如果在当前编辑器中键入:syntax off,它将立即关闭语法高亮显示:

image

You could use the opposite command, :syntax on, to turn it back on and make your eyes bleed.

您可以使用相反的命令:syntax on来重新打开它,并使您的眼睛流血。

Turn Off Permanently (for current user)

永久关闭(对于当前用户)

In order to turn off highlighting permanently for your user account, you can edit the .vimrc file in your user directory and add the setting to turn off syntax highlighting. Run this command:

为了永久关闭用户帐户的突出显示,您可以在用户目录中编辑.vimrc文件,并添加设置以关闭语法突出显示。 运行以下命令:

vi ~/.vimrc

vi〜/ .vimrc

Add the following line to disable syntax highlighting for your user account:

添加以下行以禁用用户帐户的语法突出显示:

syntax off

语法关闭

If you wanted to enable highlighting, you could use “syntax on” instead.

如果要启用突出显示,则可以改为使用“ syntax on”。

翻译自: https://www.howtogeek.com/howto/linux/disable-syntax-highlighting-in-vim/

vim 显示语法