Example: bachelor of science

vi Editor Cheat Sheet - SCU

Vi Editor Cheat SheetMovement CommandsCharacterh, j, k, lLeft, down, up, rightTextw, W, b, BForward, backward by worde, E End of word(, )Beginning of next, previous sentence{, }Beginning of next, previous paragraph[[, ]]Beginning of next, previous sectionLines0, $First, last position of current line^First non blank character of current line+, -First character of next, previous lineHTop line of screenMMiddle line of screenLLast line of screennH, nLLine n from top, bottom of screenScrolling[Ctrl]F, [Ctrl]B Scroll forward, backward one screen[Ctrl]D, [Ctrl]U Scroll down, up one half screen[Ctrl]E, [Ctrl]Y Show one more line at bottom, top of windowz[Enter]

Vi Editor Cheat Sheet Movement Commands Character h, j, k, l Left, down, up, right Text w, W, b, B Forward, backward by word e, E End of word (, ) Beginning of next, previous sentence{, } Beginning of next, previous paragraph[[, ]] Beginning of next, previous sectionLines 0, $ First, last position of current line ^ First non­blank character of current line

Tags:

  Sheet, Teach, Editor, Vi editor cheat sheet

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of vi Editor Cheat Sheet - SCU

1 Vi Editor Cheat SheetMovement CommandsCharacterh, j, k, lLeft, down, up, rightTextw, W, b, BForward, backward by worde, E End of word(, )Beginning of next, previous sentence{, }Beginning of next, previous paragraph[[, ]]Beginning of next, previous sectionLines0, $First, last position of current line^First non blank character of current line+, -First character of next, previous lineHTop line of screenMMiddle line of screenLLast line of screennH, nLLine n from top, bottom of screenScrolling[Ctrl]F, [Ctrl]B Scroll forward, backward one screen[Ctrl]D, [Ctrl]U Scroll down, up one half screen[Ctrl]E, [Ctrl]Y Show one more line at bottom, top of windowz[Enter]

2 Scroll until line with cursor is at top of until line with cursor is at middle of screenz-Scroll until line with cursor is at bottom of screenSearches/patter nSearch forward for patter n?patter nSearch backward for patter nn, NRepeat last search in same, opposite direction/, ?Repeat previous search forward, backwardfxsearch forward for character x in current lineFxsearch backward for character x in current linetxsearch forward for character before x in current lineTxsearch backward for character after x in current line;Repeat previous current line search,Repeat previous current line search in opposite directionLine Number[Ctrl]GDisplay current line numbernGMove to line number nGMove to last line in file.

3 Nmove to line number nMarking PositionmxMark current position as x`xMove cursor to x``Return to previous mark or context'xMove to beginning of line containing mark x''Return to beggining of line containing previous markEditing CommandsInserti, aInsert text before, after cursorI, AInsert text at beginning, end of lineo, OOpen new line for text below, above cursorChangerReplace with next typed characer~Change between uppercase and lowercasecmChange text block defined by movement command m ( , cw changes next word)ccChange current lineCChange to end of lineRType over characterssDelete character and continue typingSDelete current line and continue typingDelete, MovexDelete characterXDelete character to the left of the cursordmDelete text block defined by movement command m ( , dw deletes next word)ddDelete current lineDDelete to end of linep, PPut deleted text before, after cursor"npPut text from delete buffer number n after cursor (for last nine deletions)Yank (copy)ymYank (copy) text block defined by movement command m ( , yw yanks next word)

4 Yy, YYank current line"ayyYank current line into named buffer ap, PPut yanked text before, after cursor"aPPut text from buffer a before cursorOther last edit commanduUndo last editUUndo changes to current lineJJoin two lines[Ctrl]L, [Ctrl]R Redraw screenInvoking vivi fileInvoke vi Editor on filevi file1 file2 Invoke vi Editor on files sequentiallyview fileInvoke vi Editor on file in read only modevi -R fileInvoke vi Editor on file in read only modevi -r fileRecover file and recent edits after system crashvi + fileOpen file at last linevi +n fileOpen file at line number nvi +/patter n file Open file at patter nExit and Save CommandsZZSave file and quit:xSave file and quit:wqSave ("write") file and quit:wSave file:w!

5 Save file (overriding protection):30,60w ne w file Save lines 30 through 60 as file ne w file:30,60w>> file Append lines 30 through 60 to file file:w %.ne wSave current buffer named file as w:qQuit:q!Quit, discarding any changesQQuit vi and invoke ex:e file2 Edit file2 without leaving vi:e! file2 Discard changes to current file, then edit file2 without leaving vi:nEdit next file:e!Discard all changes since last save:e#Edit alternate fil


Related search queries