|
" general |
|
m = mark position (eg ma then 'a will go back to that position) |
|
cW/cw = change word |
|
cB/cb = change till begining of word |
|
C = change till end of line (delete from curser to end and go into insert mode) |
|
A = insert at end of line |
|
dd = del line |
|
D = delete till end of line |
|
I = go into insert mode at begining of line (before first non-whitespace chars) |
|
L = goto bottom of screen |
|
H = goto top of screen |
|
M = goto middle of screen |
|
S = change whole line (substitude) |
|
U = undo all line changes (since cursor moved into line) |
|
|
|
leader="," |
|
:[v]sp " ([vertical] split window) |
|
:bd "(buffer delete) |
|
:tabnew filename? " (open new tab [with file?]) |
|
line# G (go to line number) |
|
gt " (switch tab) |
|
:only " (close all tabs/panes except active one) |
|
leter q " record in buffer (leter) (use @leter to replay) |
|
. " replay last command |
|
visual->select(j,k,$,^...)->y/c(yank)->ctrl+r/p " (copy/paste) |
|
:w !diff % - " (diff current buffer with file..) |
|
|
|
" folding |
|
zc (close fold) |
|
zo (open fold) |
|
za (toggle fold) |
|
zr (reduce fold by one [open/close all at this level of indentation...]) |
|
|
|
|
|
|
|
<leader>ig " (toggle indent gutter) show indent lines |
|
<leader>ci " (toggle comment line) |
|
<leader>cc " (comment out line) |
|
<leader>c$ " (comment here till end of line) |
|
|
|
|
|
" find/replace |
|
Ack -i --{filetype} string_to_search_for "(find case insansitive the search string in files of type filetype [can have multiple file types] ex: --coffee --json) |
|
:%s/string_to_find/string_to_replace_width/ic "(find string in file [case-in-sensitive] replace with second string [c=interactive: it asks Y, N]) |
|
Ggrep 'find me' " (search git for string find me [with no args the benefit is it only looks in tracked files]) |
|
:Grep --cached findMe " (search for findMe in the index) |
|
:Grep findMe branchName/tagName/SHA " (...) |
|
:Glog --grep=findme -- " (search for ‘findme’ in all ancestral commit messages) |
|
:Glog --grep=findme -- % " (only commits that touched the currently active file) |
|
:Glog -Sfindme -- " (search for ‘findme’ in the diff for each ancestral commit) |
|
:Glog -Sfindme -- % " (search for ‘findme’ in the diff for each ancestral commit that touches the currently active file) |
|
|
|
|
|
" fugitive |
|
Gstatus " (fugitive git status) |
|
ctrl n, p " (move to next/prev files in status) |
|
Gdiff " (fugitive git diff) |
|
diffget " (pull the change from other file) |
|
diffput " (push the changes to other file) |
|
Glog -10 " (fugitive git log last 10 changes [width :cnext ]q to show next cprev [q ?]) |
|
Glog -- " (all changes [use file path to filter for file...]) |
|
Glog -- % " (all changes in parent commits to this file..) |
|
Ggrep " look at find_and_replace |
|
|
|
" maps |
|
ctrl h, j, k, l, (navigate between panes) |
|
* (find next instance of word under cursor) |