VI/VIM Essential Command Reference by Donald Raymond and Mary Piper

VI/VIM Essential Command Reference by Donald Raymond and Mary Piper

VI/VIM Essential Command Reference By Donald Raymond https://github.com/hbc/NGS_Data_Analysis_Course/blob/master/VI_CommandReference.pdf and Mary Piper Basic Controls & Commands Editing and Saving Files Esc - Basic command mode (Default mode) :e filename - Edit a new file (add to buffer) i - Insert mode (for inserting text) :enew - New empty file gg/G - Move to top/bottom of file :read !command - Insert command output 0/$ - Move to begin/end of line :x or ZZ - Save and quit if file was changed w/b - Move to next/previous word :w >> file2 - Append contents of file to file2 dw/dd - Delete word/line . - Repeat last command u/Ctrl + r - Undo/Redo V/v - Visual mode for selecting lines/char :set number/set nonumber - add/remove line #s :%s/search/replace/gc - Search and replace :w file - Write file :f newname - Change file name to newname :wq - Write and quit (:wq! to enforce) i/a - Insert text before/after char :q! - Quit without saving I/A - Insert text at start/end of line Navigation and Searching O/o - Insert new line above/below cursor r - Replace char :n - Move cursor to line n cw/cc - Replace word/line Ctrl + u/d - Move down/up half page R - Replace text (typeover) Ctrl + f/b - Move down/up a full page s/S - Delete char/line and insert text e - Move to end of word ~/g~~ - Reverse case of char/line h/j/k/l - Move cursor left/down/up/right H/M/L - Jump to top/middle/bottom of page Deleting and Copying Text :n - Move cursor to line n x/X - Delete current/previous char fn - Search forward for next n nd - Delete line #n /pattern ?pattern - Search pattern forward/back D or d$ - Delete rest of line n/N - Next/previous occurrence of search pattern d0 - Delete from here to beginning of line # - Search for word under cursor Y or yy - Copy to register :help topic - Show documentation for topic y0/y$ - Copy to beginning/end of line Buffers & Windows p/P - Paste register after/before cursor :ls or :files - Display list of opened files Other Useful Commands :b n - Open file n in current window view file - Open file in read-only mode :bdn - Delete file n# from buffer :sh - open shell (exit to re-enter vi) :next/previous - Move to next/previous file : !command - Run system command in VI :first/last - Switch to first/last file :e . - Browse a directory and display file explorer :e! - Reload current file :command - Execute command in vi Ctrl + wn or :new - New empty window :cd path/to/dir - Change directory Ctrl + ws or :sp - Split window horizontally :noh - Disable search highlighting Ctrl + wv or :vsp - Split window vertically :Sex - Split window and show file explorer (Hor) Ctrl + wc or :close - Close window :Sex! - Split window and show file explorer (Ver) Ctrl + wo or :only - Close all but current window vimdiff file1 file2 - Compare two files Ctrl + ww - Jump to next window n| - Move cursor to column n Ctrl + w[hjkl] - Move window focus * - Go to next occurrence of word under cursor Ctrl + w[HJKL] - Move window nG - Go to line n :resize/vertical resize +n - Resize window (Hor/ver).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us