What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Vim, run :syntax enable to turn on syntax highlighting for the current session, or :syntax off to turn it off. To make highlighting start automatically, add syntax enable to your vimrc.

Turn syntax highlighting on or off for this session

Enter these commands in Vim’s command-line mode: press Esc, type the command, then press Enter.

Goal Command Effect
Enable highlighting while keeping most current color settings :syntax enable Loads Vim’s syntax support while preserving most existing highlight colors.
Enable highlighting with standard syntax setup :syntax on Turns on syntax highlighting; it may override colors you have already set.
Disable highlighting :syntax off Turns off syntax highlighting for the current session.

The Vim Reference Manual describes :syntax enable as the command that switches on syntax highlighting. It loads Vim’s syntax support; :syntax off loads the no-syntax setup. If you have customized highlight groups or loaded a colorscheme, prefer :syntax enable to avoid replacing most of those settings.

Make highlighting permanent at startup

Put this line in your vimrc so it runs whenever Vim starts:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
excovip Mouse Pad for Vim, 31.4x11.7x0.07 inch Extended Large Cheat Sheet Mousepad PC Office Spreadsheet Keyboard Shortcut Mouse Mat with Non-Slip Stitched Edge 0326
  • 【Large Mouse Pad】Our extra-large mouse pad 31.4×11.8×0.07 inch(800×300×2 mm) is perfect for use as a desk mat, keyboard and mouse pad, or keyboard mat, offering you unparalleled comfort and support during long gaming sessions or work days.
  • 【Shortcut Rference to VIM】Extensive compilation of commonly used command lines for VIM.This quick reference guide is designed to reduce programming time on VIM.Perfect for beginners and experienced programmer.
  • 【Highly durable design】-The small office&gaming mouse pad is designed with high stretch silk precision locking edges to avoid loose threads on the cloth. Ensure Prolonged Use Without Deformation And Degumming.
  • 【 Non-slip Rubber Base】-Dense shading and anti-slip natural rubber base can firmly grip the desktop. Premium soft material for your comfort and mouse-control.
  • 【Ultra Smooth Surface】 Mouse Pad Designed With Superfine Fiber Braided Material, Smooth Surface Will Provide Smooth Mouse Control And Pinpoint Accuracy. Optimized For Fast Movement While Maintaining Excellent Speed And Control During Your Work Or Game.
syntax enable

On Unix-like systems, the usual user configuration file is ~/.vimrc. Other platforms use their own vimrc location. Vim’s User Guide recommends this setting for users who always want syntax highlighting: put :syntax enable in your vimrc.

Check filetype detection when highlighting is missing

Vim needs to identify the buffer’s language so it can apply the matching syntax rules. Check the current settings with :filetype; the output reports whether filetype detection, plugins, and indent support are on or off.

  1. Run :filetype to inspect filetype detection.
  2. If detection is off, run :filetype on.
  3. Ask Vim to identify the current buffer with :filetype detect, or close and reopen the file.
  4. Check the result with :set filetype?.
  5. If Vim has not identified the language correctly, set it explicitly, for example :set filetype=python.

The Vim filetype reference explains how filetype detection and syntax support work together. Filetype plugins and indentation are separate options: :filetype plugin on enables filetype-specific plugins, and :filetype indent on enables filetype-specific indentation; neither is required just to switch syntax highlighting on.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Toggle highlighting with one command

To switch between enabled and disabled states interactively, enter:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Online-Welcome Vi and Vim Editor Keyboard Shortcut (11.5 x 13 mm)
  • vi and vim keyboard sticker
  • VI VIM EDITOR KEYBOARD SHORTCUT
  • vi and vim editor
  • vi/vim editor
  • vi vim mgedit software
if exists('g:syntax_on')
  syntax off
else
  syntax enable
endif

This checks Vim’s syntax-on state and turns highlighting off if it is active; otherwise, it enables it.

Best Value
Programming Language Shortcut Mouse Pad for Excel,Python,Vim,PyCharm,Linux,C++,Java,Blender,SQL,Stock Transaction-Non-Slip, Large Desk Mat(300*800mm/400*900mm, 2mm/3mm Thickness)(SQL(300*800*2mm))
  • VERSATILE PROGRAMMING SHORTCUT DESIGN - Featuring essential shortcuts for Excel, Python, Vim, PyCharm, Linux, C++, Java, Java Programming, Blender, SQL, and Stock Transaction, this mousepad is perfect for coders, developers, and traders to boost productivity.
  • LARGE & COMFORTABLE SIZE - Available in 300mm800mm and 400mm900mm, this oversized mouse pads provide ample space for your mouse, keyboard, and laptop, enhancing your workspace setup
  • DURABLE THICKNESS OPTIONS - Choose between 2mm or 3mm thickness for a sturdy, smooth surface that ensures precise mouse control and long-lasting use.
  • NON-SLIP & WATER-RESISTANT - Engineered with a non-slip rubber base and a water-resistant coating, this large mouse pad for desk stays firmly in place and protects your desk from spills.
  • BOOST EFFICIENCY FOR CODERS & PROFESSIONALS - Ideal for software developers, data analysts, and stock traders, this shortcut mouse pad simplifies workflows and enhances multitasking with clear, easy-to-read shortcuts.
Rank #4
Vi/Vim Reference Keyboard Hotkeys Labels for Mac OS Black, White Background
  • Features essential hotkey shortcuts to increase productivity. Conveniently organized sections. Simple formatting.
  • Includes basic commands as well as other useful tools.
  • Decals available for most common Operation Systems. Legend for commonly-used symbols.
  • Appropriately sized to accommodate most surfaces.

Fix incorrect colors or slow editing

  • Colors changed unexpectedly: Run :syntax enable rather than :syntax on if you want to preserve most existing colors. Review your active colorscheme with :colorscheme and any custom :highlight commands.
  • No language-specific colors appear: Verify the detected type with :set filetype?. Turn on detection with :filetype on, run :filetype detect, or set the correct type manually.
  • Long lines make editing slow: Reduce the maximum column Vim scans for syntax with the 'synmaxcol' option. For example, :set synmaxcol=200 limits syntax processing to the first 200 columns of a line. Choose a limit that suits your files; text beyond it may not receive syntax highlighting. See the syntax reference for details.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.