SlideShare a Scribd company logo
1 of 2
Download to read offline
Readline VI Editing Mode Cheat Sheet
                              Default Keyboard Shortcuts for Bash


Shortcut                          Description
Switching to Command Mode:
ESC                               Switch to command mode.
Commands for Entering Input mode:
i                                 Insert before cursor.
a                                 Insert after cursor.
I                                 Insert at the beginning of line.
A                                 Insert at the end of line.
c<movement command>               Change text of a movement command <movement command> (see below).
C                                 Change text to the end of line (equivalent to c$).
cc or S                           Change current line (equivalent to 0c$).
s                                 Delete a single character under the cursor and enter input mode (equivalent to
                                  c[SPACE]) .
r                                 Replaces a single character under the cursor (without leaving command mode).
R                                 Replaces characters under the cursor.
v                                 Edit (and execute) the current command in a text editor (an editor in $VISUAL and
                                  $EDITOR variables or vi).
Basic Movement Commands (in command mode):
l or SPACE                        Move   one character right.
h                                 Move   one character left.
w                                 Move   one word or token right.
b                                 Move   one word or token left.
W                                 Move   one non-blank word right.
B                                 Move   one non-blank word left.
e                                 Move   to the end of the current word.
E                                 Move   to the end of the current non-blank word.
0                                 Move   to the beginning of line.
ˆ                                 Move   to the first non-blank character of line.
$                                 Move   to the end of line.
%                                 Move   to the corresponding opening/closing bracket (()’s, []’s and {}’s).
Character Finding Commands (these are also Movement Commands):
fc                                Move right to the next occurance of c.
Fc                                Move left to the previous occurance of c.
tc                                Move right to the next occurance of c, then one char backward.
Tc                                Move left to the previous occurance of c, then one char forward.
;                                 Redo the last character finding command.
,                                 Redo the last character finding command in opposite direction.
|                                 Move to the n-th column (you may specify the argument n by typing it on number
                                  keys, for example, 20|).




A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008.
http://www.catonmat.net - good coders code, great reuse
Released under GNU Free Document License.
Deletion Commands:
 x                                Delete    a single character under the cursor.
 X                                Delete    a character before the cursor.
 d<movement command>              Delete    text of a movement command <movement command> (see above).
 D                                Delete    to the end of the line (equivalent to d$).
 dd                               Delete    current line (equivalent to 0d$).
 CTRL-w                           Delete    the previous word.
 CTRL-u                           Delete    from the cursor to the beginning of line.
 Undo, Redo and Copy/Paste Commands:
 u                                Undo previous text modification.
 U                                Undo all previous text modifications on the line.
 .                                Redo the last text modification.
 y<movement command>              Yank a movement into buffer (copy).
 yy                               Yank the whole line.
 p                                Insert the yanked text at the cursor (paste).
 P                                Insert the yanked text before the cursor.
 Commands for Command History:
 k                                Move backward one command in history.
 j                                Move forward one command in history.
 G                                Move to the history line n (you may specify the argument n by typing it on number
                                  keys, for example, 15G).
 /string or CTRL-r                Search history backward for a command matching string.
 ?string or CTRL-s                Search history forward for a command matching string (remember that on most
                                  machines CTRL-s stops the output to the terminal (CTRL-q starts output) and you
                                  might need to change it with stty command).
 n                                Repeat search in the same direction as previous.
 N                                Repeat search in the opposite direction as previous.
 Completion Commands:
 TAB or CTRL-i or =               List possible completions.
 *                                Insert all possible completions.
 Miscellaneous Commands:
 ∼                                Invert the case of the character under cursor, and move a character right.
 #                                Prepend # (comment character) to the line and send it to the history list.
                                  Inserts the n-th word of the previous command in the current line.
 0, 1, 2, ...                     Sets the numeric argument.
 CTRL-v                           Insert a character literally (quoted insert).
 CTRL-t                           Transpose (exchange) two characters.

                                               Examples and Tips
• Some of the commands take a <movement command>. These commands apply the movement to themselves.
  For example, d$ would use $ as a movement, which moves the cursor to the end of the line, thus, the whole d$
  would delete text from the current cursor position to the end of the line. Another example, a command cfA would
  use fA as a movement, which finds the next occurance of the character A, thus, the whole command would change
  the line up to character A.
• Use CTRL-v to insert character literally, for example, CTRL-v CTRL-r would insert CTRL-r in the command
  line.
• See man bash, man readline, and built in bind command for modifying the default behavior!

A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008.
http://www.catonmat.net - good coders code, great reuse
Released under GNU Free Document License.

More Related Content

Viewers also liked

Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com JavaExercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com JavaLoiane Groner
 
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com JavaExercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com JavaLoiane Groner
 
[Curso Java Basico] Exercicios Aulas 47 a 52
[Curso Java Basico] Exercicios Aulas 47 a 52[Curso Java Basico] Exercicios Aulas 47 a 52
[Curso Java Basico] Exercicios Aulas 47 a 52Loiane Groner
 
[Curso Java Básico] Exercícios Aulas 11 12 13
[Curso Java Básico] Exercícios Aulas 11 12 13[Curso Java Básico] Exercícios Aulas 11 12 13
[Curso Java Básico] Exercícios Aulas 11 12 13Loiane Groner
 
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com JavaExercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com JavaLoiane Groner
 
Introducao ao Ionic 2 na pratica
Introducao ao Ionic 2 na praticaIntroducao ao Ionic 2 na pratica
Introducao ao Ionic 2 na praticaLoiane Groner
 
Loiane - Jornal A Tribuna - Maio 2008
Loiane - Jornal A Tribuna - Maio 2008Loiane - Jornal A Tribuna - Maio 2008
Loiane - Jornal A Tribuna - Maio 2008Loiane Groner
 
[Curso Java Basico] Exercicios Aula 34
[Curso Java Basico] Exercicios Aula 34[Curso Java Basico] Exercicios Aula 34
[Curso Java Basico] Exercicios Aula 34Loiane Groner
 
[Curso Java Basico] Exercicios Aula 35
[Curso Java Basico] Exercicios Aula 35[Curso Java Basico] Exercicios Aula 35
[Curso Java Basico] Exercicios Aula 35Loiane Groner
 
[Curso Java Basico] Exercicios Aulas 28 a 33
[Curso Java Basico] Exercicios Aulas 28 a 33[Curso Java Basico] Exercicios Aulas 28 a 33
[Curso Java Basico] Exercicios Aulas 28 a 33Loiane Groner
 
[Curso Java Basico] Exercicios Aula 20
[Curso Java Basico] Exercicios Aula 20[Curso Java Basico] Exercicios Aula 20
[Curso Java Basico] Exercicios Aula 20Loiane Groner
 
[Curso Java Basico] Exercicios Aulas 16 17
[Curso Java Basico] Exercicios Aulas 16 17[Curso Java Basico] Exercicios Aulas 16 17
[Curso Java Basico] Exercicios Aulas 16 17Loiane Groner
 
[Curso Java Basico] Exercicios Aulas 36 a 43
[Curso Java Basico] Exercicios Aulas 36 a 43[Curso Java Basico] Exercicios Aulas 36 a 43
[Curso Java Basico] Exercicios Aulas 36 a 43Loiane Groner
 
[Curso Java Basico] Exercicios Aulas 44 a 46
[Curso Java Basico] Exercicios Aulas 44 a 46[Curso Java Basico] Exercicios Aulas 44 a 46
[Curso Java Basico] Exercicios Aulas 44 a 46Loiane Groner
 
[Curso Java Basico] Exercicios Aula 36
[Curso Java Basico] Exercicios Aula 36[Curso Java Basico] Exercicios Aula 36
[Curso Java Basico] Exercicios Aula 36Loiane Groner
 
[Curso Java Basico] Exercicios Aulas 25 a 27
[Curso Java Basico] Exercicios Aulas 25 a 27[Curso Java Basico] Exercicios Aulas 25 a 27
[Curso Java Basico] Exercicios Aulas 25 a 27Loiane Groner
 
[Curso Java Basico] Exercicios Aula 24
[Curso Java Basico] Exercicios Aula 24[Curso Java Basico] Exercicios Aula 24
[Curso Java Basico] Exercicios Aula 24Loiane Groner
 
Git e Github para Iniciantes
Git e Github para IniciantesGit e Github para Iniciantes
Git e Github para IniciantesLoiane Groner
 
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exceptionLoiane Groner
 

Viewers also liked (20)

Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com JavaExercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
 
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com JavaExercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
 
[Curso Java Basico] Exercicios Aulas 47 a 52
[Curso Java Basico] Exercicios Aulas 47 a 52[Curso Java Basico] Exercicios Aulas 47 a 52
[Curso Java Basico] Exercicios Aulas 47 a 52
 
[Curso Java Básico] Exercícios Aulas 11 12 13
[Curso Java Básico] Exercícios Aulas 11 12 13[Curso Java Básico] Exercícios Aulas 11 12 13
[Curso Java Básico] Exercícios Aulas 11 12 13
 
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com JavaExercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
 
Introducao ao Ionic 2 na pratica
Introducao ao Ionic 2 na praticaIntroducao ao Ionic 2 na pratica
Introducao ao Ionic 2 na pratica
 
Loiane - Jornal A Tribuna - Maio 2008
Loiane - Jornal A Tribuna - Maio 2008Loiane - Jornal A Tribuna - Maio 2008
Loiane - Jornal A Tribuna - Maio 2008
 
[Curso Java Basico] Exercicios Aula 34
[Curso Java Basico] Exercicios Aula 34[Curso Java Basico] Exercicios Aula 34
[Curso Java Basico] Exercicios Aula 34
 
[Curso Java Basico] Exercicios Aula 35
[Curso Java Basico] Exercicios Aula 35[Curso Java Basico] Exercicios Aula 35
[Curso Java Basico] Exercicios Aula 35
 
[Curso Java Basico] Exercicios Aulas 28 a 33
[Curso Java Basico] Exercicios Aulas 28 a 33[Curso Java Basico] Exercicios Aulas 28 a 33
[Curso Java Basico] Exercicios Aulas 28 a 33
 
[Curso Java Basico] Exercicios Aula 20
[Curso Java Basico] Exercicios Aula 20[Curso Java Basico] Exercicios Aula 20
[Curso Java Basico] Exercicios Aula 20
 
[Curso Java Basico] Exercicios Aulas 16 17
[Curso Java Basico] Exercicios Aulas 16 17[Curso Java Basico] Exercicios Aulas 16 17
[Curso Java Basico] Exercicios Aulas 16 17
 
[Curso Java Basico] Exercicios Aulas 36 a 43
[Curso Java Basico] Exercicios Aulas 36 a 43[Curso Java Basico] Exercicios Aulas 36 a 43
[Curso Java Basico] Exercicios Aulas 36 a 43
 
[Curso Java Basico] Exercicios Aulas 44 a 46
[Curso Java Basico] Exercicios Aulas 44 a 46[Curso Java Basico] Exercicios Aulas 44 a 46
[Curso Java Basico] Exercicios Aulas 44 a 46
 
[Curso Java Basico] Exercicios Aula 36
[Curso Java Basico] Exercicios Aula 36[Curso Java Basico] Exercicios Aula 36
[Curso Java Basico] Exercicios Aula 36
 
[Curso Java Basico] Exercicios Aulas 25 a 27
[Curso Java Basico] Exercicios Aulas 25 a 27[Curso Java Basico] Exercicios Aulas 25 a 27
[Curso Java Basico] Exercicios Aulas 25 a 27
 
[Curso Java Basico] Exercicios Aula 24
[Curso Java Basico] Exercicios Aula 24[Curso Java Basico] Exercicios Aula 24
[Curso Java Basico] Exercicios Aula 24
 
Exceptions Em Java UFF
Exceptions Em Java UFFExceptions Em Java UFF
Exceptions Em Java UFF
 
Git e Github para Iniciantes
Git e Github para IniciantesGit e Github para Iniciantes
Git e Github para Iniciantes
 
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception
[Curso Java Basico - Exceptions] Aula 52: criando sua propria exception
 

Similar to vi cheat sheet

Similar to vi cheat sheet (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 v 1 00
Vi Cheat Sheet v 1 00Vi Cheat Sheet v 1 00
Vi Cheat Sheet v 1 00
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
 
Using vi editor
Using vi editorUsing vi editor
Using vi editor
 
UNIX - Class2 - vi Editor
UNIX - Class2 - vi EditorUNIX - Class2 - vi Editor
UNIX - Class2 - vi Editor
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
101 3.8.2 vim reference card
101 3.8.2 vim reference card101 3.8.2 vim reference card
101 3.8.2 vim reference card
 
3.8.b vim reference card
3.8.b vim reference card3.8.b vim reference card
3.8.b vim reference card
 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
 
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 editor
Vi editorVi editor
Vi editor
 
Vim 1
Vim 1Vim 1
Vim 1
 
vim
vimvim
vim
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vi reference
Vi referenceVi reference
Vi reference
 

Recently uploaded

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

vi cheat sheet

  • 1. Readline VI Editing Mode Cheat Sheet Default Keyboard Shortcuts for Bash Shortcut Description Switching to Command Mode: ESC Switch to command mode. Commands for Entering Input mode: i Insert before cursor. a Insert after cursor. I Insert at the beginning of line. A Insert at the end of line. c<movement command> Change text of a movement command <movement command> (see below). C Change text to the end of line (equivalent to c$). cc or S Change current line (equivalent to 0c$). s Delete a single character under the cursor and enter input mode (equivalent to c[SPACE]) . r Replaces a single character under the cursor (without leaving command mode). R Replaces characters under the cursor. v Edit (and execute) the current command in a text editor (an editor in $VISUAL and $EDITOR variables or vi). Basic Movement Commands (in command mode): l or SPACE Move one character right. h Move one character left. w Move one word or token right. b Move one word or token left. W Move one non-blank word right. B Move one non-blank word left. e Move to the end of the current word. E Move to the end of the current non-blank word. 0 Move to the beginning of line. ˆ Move to the first non-blank character of line. $ Move to the end of line. % Move to the corresponding opening/closing bracket (()’s, []’s and {}’s). Character Finding Commands (these are also Movement Commands): fc Move right to the next occurance of c. Fc Move left to the previous occurance of c. tc Move right to the next occurance of c, then one char backward. Tc Move left to the previous occurance of c, then one char forward. ; Redo the last character finding command. , Redo the last character finding command in opposite direction. | Move to the n-th column (you may specify the argument n by typing it on number keys, for example, 20|). A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.
  • 2. Deletion Commands: x Delete a single character under the cursor. X Delete a character before the cursor. d<movement command> Delete text of a movement command <movement command> (see above). D Delete to the end of the line (equivalent to d$). dd Delete current line (equivalent to 0d$). CTRL-w Delete the previous word. CTRL-u Delete from the cursor to the beginning of line. Undo, Redo and Copy/Paste Commands: u Undo previous text modification. U Undo all previous text modifications on the line. . Redo the last text modification. y<movement command> Yank a movement into buffer (copy). yy Yank the whole line. p Insert the yanked text at the cursor (paste). P Insert the yanked text before the cursor. Commands for Command History: k Move backward one command in history. j Move forward one command in history. G Move to the history line n (you may specify the argument n by typing it on number keys, for example, 15G). /string or CTRL-r Search history backward for a command matching string. ?string or CTRL-s Search history forward for a command matching string (remember that on most machines CTRL-s stops the output to the terminal (CTRL-q starts output) and you might need to change it with stty command). n Repeat search in the same direction as previous. N Repeat search in the opposite direction as previous. Completion Commands: TAB or CTRL-i or = List possible completions. * Insert all possible completions. Miscellaneous Commands: ∼ Invert the case of the character under cursor, and move a character right. # Prepend # (comment character) to the line and send it to the history list. Inserts the n-th word of the previous command in the current line. 0, 1, 2, ... Sets the numeric argument. CTRL-v Insert a character literally (quoted insert). CTRL-t Transpose (exchange) two characters. Examples and Tips • Some of the commands take a <movement command>. These commands apply the movement to themselves. For example, d$ would use $ as a movement, which moves the cursor to the end of the line, thus, the whole d$ would delete text from the current cursor position to the end of the line. Another example, a command cfA would use fA as a movement, which finds the next occurance of the character A, thus, the whole command would change the line up to character A. • Use CTRL-v to insert character literally, for example, CTRL-v CTRL-r would insert CTRL-r in the command line. • See man bash, man readline, and built in bind command for modifying the default behavior! A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.