Vim Syntax Highlighting

From UCLUG
Jump to: navigation, search

Syntax Highlighting[edit]

What it is[edit]

  • indicating syntax of language via coloring, font altering, etc

How to activate in Vim[edit]

  • Just Works option
  • Doesn't work option
    • verify Vim compiled with +syntax
      • :version
      • vim --version or gvim --version
      • if not, check if package is vim-minimal; get vim-enhanced
    • file type not correctly detected
      • Check: :set filetype
      • Change: :se ft=c

What syntaxes supported?[edit]

  • Look in Vim syntax directory (eg, /usr/share/vim/vim72/syntax/)

Other info[edit]

:syntax 
shows what matches
:highlight 
shows color scheme
:set background 
changes contrast based on terminal, alters color scheme slightly
:hardcopy 
creates printout
:TOhtml 
if :ha doesn't work, launch in web browser, then print

Demo[edit]