Vi: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Linux =Overview= =Syntax Highlight= To turn syntax highlight on or of interactively: :syntax on|off")
 
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:


=Overview=
=Overview=
=Installation=
==With apt-get==
apt-get install vim


=Syntax Highlight=
=Syntax Highlight=
==All Parsers==


To turn syntax highlight on or of interactively:
To turn syntax highlight on or of interactively:


  :syntax on|off
  :syntax on|off
To make the change permanent, edit  ~/.vimrc and append:
syntax on|off
==Just the YAML Parser==
autocmd BufRead,BufNewFile {*.yaml} set filetype=yaml
autocmd FileType yaml setlocal syntax=off
=In-Line Editing=
==Substitution==
<syntaxhighlight lang='text'>
:1,$s/regex/replacement/g
</syntaxhighlight>

Latest revision as of 18:52, 22 February 2021

Internal

Overview

Installation

With apt-get

apt-get install vim

Syntax Highlight

All Parsers

To turn syntax highlight on or of interactively:

:syntax on|off

To make the change permanent, edit ~/.vimrc and append:

syntax on|off

Just the YAML Parser

autocmd BufRead,BufNewFile {*.yaml} set filetype=yaml
autocmd FileType yaml setlocal syntax=off

In-Line Editing

Substitution

:1,$s/regex/replacement/g