SlideShare a Scribd company logo
1 of 1
Download to read offline
GoSquared                                                                                                                   VI Help Sheet


Modes & Controls                                                  Inserting Text                                                Other
Command Mode ESC (commands preceded by :)                         i            Insert before cursor                             u
Insertion Mode   Entered on insertion or change                   a            Append after cursor                              Undo last change
Starting VI (command line)                                        I            Insert before line                               J
vi <filename>         Edit filename                                                                                             Join lines
                                                                  A            Append after line
vi -r <filename>      Edit last version of filename after crash
                                                                                                                                nJ
vi + n <filename>     Edit filename at line n
                                                                  o            Add new line after current line
                                                                                                                                Join next n lines
vi + <filename>       Edit filename at end of file                O            Add new line before current line
vi +/str <filename>
                                                                                                                                .
                      Edit filename at first occurance of str     r            Overwrite one character
                                                                                                                                Repeat last command
In insertion mode the following should be preceded by ESC:        R            Overwrite many characters
                                                                                                                                U
:w             Save                                               :r <file>    Reads file and inserts it after this line        Undo all changes to line
:x             Save & Exit                                        p            Put after the position or line
                                                                                                                                :N
:q             Exit if no changes made                                         Put before the position or line
                                                                  P                                                             Open split screen
:q!            Exit & discard any changes                         C            Rewrite the whole line                           v
                                                                                                                                Visual mode
Cursor Navigation                                                 Deleting Text                                                 ctrl + c
h or           Cursor left                                        x             Delete character to right of cursor             Escape insert mode
j or           Cursor down                                        X             Delete character to left of cursor
k or           Cursor up                                          D             Delete the rest of line
l or           Cursor right                                       dd or :d      Delete current line
w              Next word                                          ndw           Deletes the next n words
W              Next blank delimited word                          ndb           Deletes the previous n words
b              Start of word                                      ndd           Deletes n lines starting with current
B              Start of blank delimited word                      :x,yd         Delete lines x through y
e              End of word                                        :r <file>     Reads file and inserts it after this line
E              End of blank delimited word                        d{nav_cmd} Overwrite many characters
(              Back a sentence                                                   Reads file and inserts it after this line
                                                                  :r <file>
)              Forward a sentence
{              Back a paragraph                                   Searching
}              Forward a paragraph                                /string     Search forward for string
0              Beginning of line                                  ?string     Search backwards for string
$              End of the line                                    n           Go to next match
1G             Start of file                                      N           Go to previous match
G              End of file                                        :set ic     Ignore case while searching
:n             nth line of file                                   :set noic   Case-sensitive searching
f<char>        Forward to char                                    :set nu     Turn on line numbers
F<char>        Back to char                                       :x,yg/str   Search for str from line x to line y
H              Top of screen                                      :g/str/cmd Run cmd on lines containing str
M              Middle of screen                                   *           Search for next instance of current word

L              Bottom of screen                                   #           Search for last instance of current word
%              Matching bracket                                   Replacing
gg             Start of document
                                                                  :s/pt/str/flag Replace pattern with string
                                                                  Flags
                                                                  g              Replace all occurrences of pattern
                                                                  c              Confirm replaces
                                                                  &              Repeat last :s command

        Download this Help Sheet now at gosquared.com/liquidicity                                                            © 2010 Go Squared Ltd.
        Put it on your wall Referenced from http://www.lagmonster.org/docs/vi.html

More Related Content

What's hot

NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem niveditJain
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramAbdullah Jan
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFAkunj desai
 
non deterministic finit automata
non  deterministic finit automatanon  deterministic finit automata
non deterministic finit automatamariajan8
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computationkanikkk
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introductionNAMRATA BORKAR
 
push down automata
 push down automata push down automata
push down automatanadiatariq6
 
There, now the format is correct. Thanks Indicate whether the first function...
There, now the format is correct. Thanks  Indicate whether the first function...There, now the format is correct. Thanks  Indicate whether the first function...
There, now the format is correct. Thanks Indicate whether the first function...licservernoida
 
Finite automata
Finite automataFinite automata
Finite automataPusp Sunar
 

What's hot (15)

NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem
 
vim
vimvim
vim
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
 
Finite automata
Finite automataFinite automata
Finite automata
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
 
flat unit1
flat unit1flat unit1
flat unit1
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
non deterministic finit automata
non  deterministic finit automatanon  deterministic finit automata
non deterministic finit automata
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computation
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
 
push down automata
 push down automata push down automata
push down automata
 
Finite automata
Finite automataFinite automata
Finite automata
 
There, now the format is correct. Thanks Indicate whether the first function...
There, now the format is correct. Thanks  Indicate whether the first function...There, now the format is correct. Thanks  Indicate whether the first function...
There, now the format is correct. Thanks Indicate whether the first function...
 
T0
T0T0
T0
 
Finite automata
Finite automataFinite automata
Finite automata
 

Viewers also liked

Brochure wandel goltermann olp 1 power meter
Brochure wandel goltermann olp 1 power meterBrochure wandel goltermann olp 1 power meter
Brochure wandel goltermann olp 1 power metersamuel valle
 
Tareeq as sawab darood wa salam
Tareeq  as  sawab  darood wa salamTareeq  as  sawab  darood wa salam
Tareeq as sawab darood wa salamMuhammad Tariq
 
Устав
УставУстав
Уставhimbaza
 
WUA! en concept en zo; unieke benchmark
WUA! en concept en zo; unieke benchmarkWUA! en concept en zo; unieke benchmark
WUA! en concept en zo; unieke benchmarkAxel Wessels
 
Atps cco estrutura_e_analise_demonstracoes_financeira
Atps cco estrutura_e_analise_demonstracoes_financeiraAtps cco estrutura_e_analise_demonstracoes_financeira
Atps cco estrutura_e_analise_demonstracoes_financeiraDenilson Bonilha Petelin
 
Craftrevival amit ray
Craftrevival amit rayCraftrevival amit ray
Craftrevival amit rayJyoti Balyan
 
Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013Wooga
 
Ibm and innovation overview 20150326 v15 short
Ibm and innovation overview 20150326 v15 shortIbm and innovation overview 20150326 v15 short
Ibm and innovation overview 20150326 v15 shortISSIP
 

Viewers also liked (17)

Trabajo en clase
Trabajo en claseTrabajo en clase
Trabajo en clase
 
LINTA CV
LINTA CVLINTA CV
LINTA CV
 
Brochure wandel goltermann olp 1 power meter
Brochure wandel goltermann olp 1 power meterBrochure wandel goltermann olp 1 power meter
Brochure wandel goltermann olp 1 power meter
 
Eloy Alfaro
Eloy AlfaroEloy Alfaro
Eloy Alfaro
 
Tareeq as sawab darood wa salam
Tareeq  as  sawab  darood wa salamTareeq  as  sawab  darood wa salam
Tareeq as sawab darood wa salam
 
That Thing
That ThingThat Thing
That Thing
 
Byambaa ocvp fi_g
Byambaa ocvp fi_gByambaa ocvp fi_g
Byambaa ocvp fi_g
 
Tide_animation
Tide_animationTide_animation
Tide_animation
 
Устав
УставУстав
Устав
 
WUA! en concept en zo; unieke benchmark
WUA! en concept en zo; unieke benchmarkWUA! en concept en zo; unieke benchmark
WUA! en concept en zo; unieke benchmark
 
Project α' τετράμηνο ναρκωτικα
Project α' τετράμηνο ναρκωτικαProject α' τετράμηνο ναρκωτικα
Project α' τετράμηνο ναρκωτικα
 
Atps cco estrutura_e_analise_demonstracoes_financeira
Atps cco estrutura_e_analise_demonstracoes_financeiraAtps cco estrutura_e_analise_demonstracoes_financeira
Atps cco estrutura_e_analise_demonstracoes_financeira
 
estrés y ansiedad
estrés y ansiedadestrés y ansiedad
estrés y ansiedad
 
Craftrevival amit ray
Craftrevival amit rayCraftrevival amit ray
Craftrevival amit ray
 
Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013
 
Ibm and innovation overview 20150326 v15 short
Ibm and innovation overview 20150326 v15 shortIbm and innovation overview 20150326 v15 short
Ibm and innovation overview 20150326 v15 short
 
Alimento cerdos
Alimento cerdosAlimento cerdos
Alimento cerdos
 

Similar to Vi help-sheet-011

Vi Editor Cheat Sheet
Vi Editor Cheat SheetVi Editor Cheat Sheet
Vi Editor Cheat SheetLoiane Groner
 
Vi reference
Vi referenceVi reference
Vi referenceaireddy
 
VI Editors
VI EditorsVI Editors
VI EditorsDeivanai
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarRohit Kumar
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdfssuser584832
 
Emacs Cheat Sheet
Emacs Cheat SheetEmacs Cheat Sheet
Emacs Cheat Sheetguest9ebed9
 
GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfSergioLoaiza11
 
changing and deleting text ,change word and line under vi editor
changing and deleting text ,change word and line under vi editorchanging and deleting text ,change word and line under vi editor
changing and deleting text ,change word and line under vi editorShourya Puri
 

Similar to Vi help-sheet-011 (20)

API TEST
API TESTAPI TEST
API TEST
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
API TEST
API TESTAPI TEST
API TEST
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Vi CheatSheet
Vi CheatSheetVi CheatSheet
Vi CheatSheet
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
 
Vi Editor Cheat Sheet
Vi Editor Cheat SheetVi Editor Cheat Sheet
Vi Editor Cheat Sheet
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vi editor
Vi editorVi editor
Vi editor
 
VI Editors
VI EditorsVI Editors
VI Editors
 
Using vi editor
Using vi editorUsing vi editor
Using vi editor
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit Kumar
 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf
 
Emacs Cheat Sheet
Emacs Cheat SheetEmacs Cheat Sheet
Emacs Cheat Sheet
 
GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdf
 
UNIX - Class2 - vi Editor
UNIX - Class2 - vi EditorUNIX - Class2 - vi Editor
UNIX - Class2 - vi Editor
 
changing and deleting text ,change word and line under vi editor
changing and deleting text ,change word and line under vi editorchanging and deleting text ,change word and line under vi editor
changing and deleting text ,change word and line under vi editor
 

Vi help-sheet-011

  • 1. GoSquared VI Help Sheet Modes & Controls Inserting Text Other Command Mode ESC (commands preceded by :) i Insert before cursor u Insertion Mode Entered on insertion or change a Append after cursor Undo last change Starting VI (command line) I Insert before line J vi <filename> Edit filename Join lines A Append after line vi -r <filename> Edit last version of filename after crash nJ vi + n <filename> Edit filename at line n o Add new line after current line Join next n lines vi + <filename> Edit filename at end of file O Add new line before current line vi +/str <filename> . Edit filename at first occurance of str r Overwrite one character Repeat last command In insertion mode the following should be preceded by ESC: R Overwrite many characters U :w Save :r <file> Reads file and inserts it after this line Undo all changes to line :x Save & Exit p Put after the position or line :N :q Exit if no changes made Put before the position or line P Open split screen :q! Exit & discard any changes C Rewrite the whole line v Visual mode Cursor Navigation Deleting Text ctrl + c h or Cursor left x Delete character to right of cursor Escape insert mode j or Cursor down X Delete character to left of cursor k or Cursor up D Delete the rest of line l or Cursor right dd or :d Delete current line w Next word ndw Deletes the next n words W Next blank delimited word ndb Deletes the previous n words b Start of word ndd Deletes n lines starting with current B Start of blank delimited word :x,yd Delete lines x through y e End of word :r <file> Reads file and inserts it after this line E End of blank delimited word d{nav_cmd} Overwrite many characters ( Back a sentence Reads file and inserts it after this line :r <file> ) Forward a sentence { Back a paragraph Searching } Forward a paragraph /string Search forward for string 0 Beginning of line ?string Search backwards for string $ End of the line n Go to next match 1G Start of file N Go to previous match G End of file :set ic Ignore case while searching :n nth line of file :set noic Case-sensitive searching f<char> Forward to char :set nu Turn on line numbers F<char> Back to char :x,yg/str Search for str from line x to line y H Top of screen :g/str/cmd Run cmd on lines containing str M Middle of screen * Search for next instance of current word L Bottom of screen # Search for last instance of current word % Matching bracket Replacing gg Start of document :s/pt/str/flag Replace pattern with string Flags g Replace all occurrences of pattern c Confirm replaces & Repeat last :s command Download this Help Sheet now at gosquared.com/liquidicity © 2010 Go Squared Ltd. Put it on your wall Referenced from http://www.lagmonster.org/docs/vi.html