GVIM

From HotDec

Jump to: navigation, search

here is my .vimrc files (_vimrc in windows):
put this in your home directory (the Vim program file folder in windows)

set nu!
color murphy
set tabstop=4
set shiftwidth=4
set ai 
set si
set cindent
syntax enable


Gvim Cheatsheet

============== Basics =================|============== Search =================|
hjkl    Movement  | :w [file]   save   |/[pattern]  searches for pattern       |
:q      quit      | :h          help   |n (N)       goto next (previous) match |
u (CTRL-R)  undo (redo)                |:%s/1/2/g   replace every 1 with 2     |
i (CTRL-C)  enter (exit) insert mode   |                                       |
                                       |============== Buffers ================|
============== Motion =================|:e file     edit "file" in a buffer    |
(press 'v' before motion to highlight) |:bn (:bp)   goto next (previous) buffer|
w (W)   next word (space-seperated)    |:sp [file]  split and open file        |
e (E)   end of word (space-seperated)  |:ls         list all buffers           |
b (B)   word before (space-seperated)  |                                       |
0 HOME  beginning of line              |============== Windows ================|
$ END   end of line                    |CTRL-W s(v)     split the window (vert)|
g#      goto line #                    |CTRL-W c        close window           |
gg      goto beginning of file         |CTRL-W CTRL-W   goto next window       |
G       goto end of file               |                                       |
ggXG    perform 'X' on whole file      |=========== Indentation ===============|
                                       |<{motion}       shift {motion} left    |
============ Inserting ================|<<              shift line left        |
i (gI)  inserts (at start of line)     |>{motion}, >>   same as '<'            |
a (A)   appends (at end of line)       |                                       |
o (O)   open new line below (above)    |=============== Make ==================|
r       replaces single letter         |:make [arguments]       run make       |
                                       |:cn (:cp)    goto next (previous) error|
=========== "Delete" (Cut) ============|                                       |
x (X)       delete (before) cursor     |=============== Misc ==================|
d{motion}   "delete" cuts over {motion}|J                   join lines         |
dd          cut whole line             |CTRL-A (CTRL-X)     add (subtract) to #|
D           cut to end of line         |~                   switch case        |
c,cc,C      "change" delete & insert   |:!{cmd}             shell command {cmd}|
y,yy,Y      "yank" copy without delete |                                       |
                                       |                                       |
=============== Paste =================|                                       |
(all deletes go to clipboard too)      |                                       |
p (P)   pastes after (before) cursor   |======= File-Specific Settings ========|
gP      Windows-style paste            |vim:set et nu ai si cin ts=4 co=88:    |