Monday, January 4, 2016

VIM EDITOR RHEL7

editing in vi

from command mode to insert mode::
i = switch to insert mode and start inserting before the current position

a = switch to insert mode and start inserting afer the current position
A =move the cursor end of the current line switch to insert mode
I = switch to the end of the line nd  also inser mode
O= open a new line above the current one and switch to insert mode
o = open a new line below the current one and switch to insert mode


h = cursor left one position
l = cursor right one position
j =cursor one down position
k = cursor one line up
^ = move to the beginning of the current line
$ = move to the end of the current line
gg = move to the first line of the document
G = move to the last line of the document
w = move cursor to the beginning of next word ( incudes punctuation)
W= move cursor to the beginning of next word( escapes punctuation)
b= move cursor to the beginning of previous word ( includes punctuation)
B = move cursor to the beginning of previous word ( doesnt include punctuation as a word)
( = move cursor to the beginning of previous/current  sentence
) = move cursor to the beginning of next sentence
{ = move cursor to the beginning of current/previous paragraph
} = move cursor to the beginning of the next paragraph
x = to delete the character where cursor is placed
X = to delete the one character ahead of cursor
R = to replace the entire word
r = just to replace a single character
cw = to change from the current cursor position to the end of the file
cc = replace the entire line ( multiples lines if prefixed with the number)

No comments:

Post a Comment