Editors

Editors :

=======================================================================================
1> nano : user friendly test editor
#nano filename
=======================================================================================
2> vi editor :

It work in 3 different mode

1. command / default mode : It use for cut, copy, paste, delete and read the contects.
2. Insert mode : write / edit data
3. Executive ( ex ) mode : exit, save, find and replace

Switching between diffent mode

insert —–ESC————> command mode ——-shift + ‘:’ ——> Executive
insert <–insert key Or i–   command mdoe <———ESC key ——- Executive

you can not switch between insert to executive mode directly.

:w => write / save
:q => exit
:wq Or :x Or shift + zz => save and exit
:q! ==> forceful exit

=======================================================================================
3> view : readonly permission. However you can edit and save forcefully.
#view filename

=======================================================================================
4> vim : better than vi editor. It provide colouful text, encryption password, cursor movement data at the bottom.

command and function used with vi/vim editors. Run all this options in command mode only.

i> Copy :

1.copy line : yy
2.copy multiple line : any_number + yy
3.copy word : y + w
4.copy multiple words : number + y + w

ii> Cut :

1. cut line : cc
2. cut multiple line : number + cc
3. cut word : c + w
4. cut multiple word : number + c + w

iii> Delete
1. delete line : dd
2. delete multiple line : number + dd
3. delete word : d + w
4. delete multiple words : number + d + w
5. delete sinple charactor : x
6. delete multiple charactor : number + x

iv> Paste : p

v> undo : u

vi> redo : ctrl + r

vii> movement :

1. goto bottom : shift + G
2. goto top : gg
3. goto N number of line => :Number
4. cursor movement : arrow keys.

viii> Search word   /word

ix> search and replace
:%s/old/New/g ———-g(group)
:%s/old/New/gc ———ask for changes.

x>Show number infront of lines   =>   :set nu
Remove number in front of lines => :set nonu

xi> execute other command when vi editor open
:! any command

xii> set password in vim =>
shift + ‘:’ + X ( capital x ) ie. :X
and then enter password

During file creation, also you provide password
#vim -x fileName   ( small x )

xiii> help ==> :help

=======================================================================================
5> gedit : graphical editor

Posted in Fundamental

Leave a Reply