This time will be seeing about vi editor. Vi is not the only editor available we have other editors such as "ed", but Vi is the most commonly used editor across.
We know that file can be created by using "cat" ,"touch" commands it can also be created using vi editor
vi filename eg: vi test.txt
We can also use the above command to view the file
We need to press esc key every time we try to execute the below commands
Vi commands
The above commands are the most commonly used which should be sufficient for any developer working in Vi editor
Hope this article helps in understanding basic concepts of vi editor
We know that file can be created by using "cat" ,"touch" commands it can also be created using vi editor
vi filename eg: vi test.txt
We can also use the above command to view the file
We need to press esc key every time we try to execute the below commands
Vi commands
Command | Description |
i | Inserts text before current cursor location. |
I | Inserts text at beginning of current line. |
a | Inserts text after current cursor location. |
A | Inserts text at end of current line. |
x | Deletes the character under the cursor location. |
X | Deletes the character before the cursor location |
dd | Deletes the line the cursor is on. |
yy | Copies the current line. |
p | Puts the copied text after the cursor. |
P | Puts the yanked text before the cursor. |
:wq | Save and quite file |
:q! | quit without saving file |
:s/search/replace/g | replace text globally |
The above commands are the most commonly used which should be sufficient for any developer working in Vi editor
Hope this article helps in understanding basic concepts of vi editor
Comments
Post a Comment