This is an old revision of the document!


Table of Contents

Home tmade.de

Home Wiki

VI

^                    #A line beginns with
$                    #A line ends with
\<                   #A word beginns with
\>                   #A word ends with
:set hlsearch        #Highlight spaces

Edit

A                    #Insert text at the end of the current line
O                    #Change to insert mode (if not already in) and enter text in the following line
u                    #Undo
ctrl + r             #Redo
r                    #Replace single character
R                    #Replace mode
cw                   #Change single word (until space, character, special character etc.)
c4w                  #Change 4 words
ct"                  #Change all until tag "
.                    #Repeat last command/ insert etc.
  

Replace

:%s/Novell/NOVELL/g                           #Replace all appearance
:s/Novell/NOVELL/                             #Replace single appearance of "Novell"
:%s/ERROR/error/g   
:%s#/old/path/#/replace/new_path/#            #Replace path      
:%s#/var/lib/named/#/var/lib/bind/#           #Replace path  
:%s/\/old\/path/\/replace\/new_path/g         #Replace path         

Useful Commands

:e                  #Reload file
:e!                 #Reload file, changes are lost
Shift + G           #Jump to end of file
1 + G               #Jump to beginning of file
:se nu              #Show line number
:set number         #Show line number
:se nonu            #Hide line numbers
:set nonumber       #Hide line numbers
:5                  #Jump to line 5
:set list           #Show special caracters
linux/vi.1423136526.txt.gz · Last modified: (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki