‏הצגת רשומות עם תוויות key bindings. הצג את כל הרשומות
‏הצגת רשומות עם תוויות key bindings. הצג את כל הרשומות

יום שני, 5 ביולי 2010

Vim CheatSheet

General commands

:vs #vertical split and open filename in new screen
:sb # horizontal split
:s/lala/foo/ #replaces the first instance of lala with foo
:%s/lala/foo/gc # replaces all instances of lala with foo and (due to the c) will ask for permission beforehand
:e #open file
:Explore #guess ;)
:.,.+22s/^// #remove spaces from the begining the next 22 lines
:.,.+11s/$/f/ #replace the end of the next 11 lines with

key binds

Ctrl-c #most of the times will throw you in command mode , closer than esc for the lazy ones
Esc # command mode
v # visual mode
V # visual mode per line
ctrl + v # visual block mode (per char)
y # yank (copy)
p # paste
P # paste before current
hjkl # try those in command mode , just hit the damn keys ! :P
u # undo
> # move to right
< # move to left (the entire line) [ # go to start of doc ] # got to end of doc ( # paragraph up ) # paragraph down . # the best of all , (repeat last command )

tab commands

:tabnew # new blank tab
:tabnew #newtab with open in it
:tabn #next tab
:tabp #previouse tab

clipboard magic

just "+ before you yank or paste , yup its the x clipboard :P (if it doesnt work for ya try to recompile vim with ./configure --with-x)

Screen CheatSheet

Flags


screen -S name # to set the name for the created screen session
screen - r name #reattach to that session with that name
screen -x name #collaborate
screen -x username/ # collaborate in the next available screen for that user
screen -x username/name # collaborate with a set screen name and that specific user

Key bindings


C-a C-d # detaching well duh
C-a C-[ # copy (choose using return and arrows)
C-a C-] # paste
C-a C-" # choose window from list
C-a C-k # kill current window (y/n option)
C-a C-\ # kill all windows (y/n option)
C-a a #create new window
C-a A # name the window