- Vim Version
vim --version
-
View Runtimepath (inside Vim)
:echo &runtimepath
-
Which scripts are loaded
:scriptnames
-
View where a setting was loaded from
:verbose set <setting name>
(for example::verbose set background
)
- Navigating
- Move to top of screen (Higher)
shft-h
- Move to Middle of screen
shift-m
- Move to Lower of screen
- Move to top of screen (Higher)
shift-l
-
What Line # am I on?
:set number
-
GOTO Line #
<esc>
#
shift-g
-
GOTO Line #
:#
-
GOTO Last Line
shift-g
-
Input Mode
[ESC]
- to end inut.
- repeat last editing command# command
- repeat command, # times/string/
- find patterna
- append character modeA
- append at EOLcw
- change wordd
- delete one characterdd
- deline linedw
- delete wordG
- End of Filei
- insertO
- open/insert linep
- paste/put buffer (re: paste a yanked line)r
- replace characterR
- Replace Charactersx
- delete one charactery
- yank (copy) a lineyy
- copy line in buffer
-
Command Mode
:n
- goto line n:q
- quit:q!
- quit, no save:r file
- import file:u
- Undo last command:redo
- redo:w
- write:wq
- write & quit
-
Line Numbering
- ON
:set number | nu
- OFF
:set nonumber | nonu
- ON
-
Copy Selection, with Mouse
- In the vim command line to enable copy/paste of text selected using the mouse.
:set mouse&
-
Copy from-to lines, to current cursor position
- Example:
:81,91t.<enter>
- This will paste the lines 81-91 under the line the cursor is on.
- Example:
-
Replace text
- http://vim.wikia.com/wiki/Search_and_replace
:%/original_text/new_text/
- http://vim.wikia.com/wiki/Search_and_replace