sudo apt-get install vim , to install the vim package
>> vi text.txt use this command at the termimal
>> vi -r text.txt open recovery unsaved file from previous work
Turn on color syntax for vi/vim permanent
$ cd ~ go to home directory
$ vi .vimrc
in editing of file ".vimrc"
#---------------------------
syntax on
colorscheme morning
#-------
Options: morning, peachpuff, blue, murphy, ron, zellner, darkblue, desert, koehler, and shine
vi is case-sensitive
Main/ Command Mode
Esc to escape from editor mode
: to move the cursor to the bottom of the screen
: set nu
: set number to show the line numbers
: set nonumber to hiden the line numbers
: syntax on turn on syntax highlight in editor
: syntax off turn off syntax highlight in editor
: colorscheme elflord change colorscheme
Options: morning, peachpuff, blue, murphy, ron, zellner, darkblue, desert, koehler, and shine
0 move cursor to the beginning of the line
$ move cursor to the end of the line
1G move cursor to the beginning of the file, line 1
:0 + Enter move cursor to the beginning of the file, line 1
NG move cursor to the N number of lines of the file
:N + Enter move cursor to the N number of lines of the file
G move cursor to the end of the file, the last line
:$ + Enter move cursor to the end of the file, the last line
: f display current file name and line number
k move cursor up
j move cursor down
h move cursor up
l move cursor to the right
w move cursor to the beginning letter of the next word
b move cursor to the beginning letter of the previous word
u undo previous
dd delete current line
dNd or Ndd delete current and next N (number) lines
D delete the rest of the line from the current cursor
dw delete the word within cursor
yy copy current line
yNy or Nyy copy current and next N (number) lines
p paste
EDITOR / INSER mode :
press "i" to go to this mode
press "Esc" to go back to the command mode
i to go to editor mode at the current cursor position
I to go to editor mode at the beginning of the line content a cursor
:q! + Enter to quit or exit without saving
:wq! + Enter to save and exit
:x + Enter to quit and write
No comments:
Post a Comment