http://thoughtbot.github.io/rcm/lsrc.1.html
- To restore from repository:
git clone git@github.com:rybycy/dotfiles.git
cd dotfiles
rcup -d . from this dir
- install vundle for vim
- vim: PluginInstall
- install tmux-resurrect for tmux: https://github.com/tmux-plugins/tmux-resurrect
- install vundle
- sudo apt-get install vim-nox for ruby support
- mkdir .vim/backups && mkdir .vim/swaps
Theme: Belafonte night
Basic actions: {yank,change,delete, visual selection}{inner,all}{word,tag,paragraph}
-
mark items in order to return to them later - simply hit
m
and thenletter
and then it's possible to go back to this place with *** backticks + letter *** -
use ctrl+add and ctrl+xtract to increase/decrease counters in your text.
-
go to the latest position with `` (two backticks)
-
repeating last command with . and macros!
- start recording with q<register_letter>. Invoke with @<register_letter>. @@ invokes the latest macro
- hit (ctrl + register) + = in insert mode in order to enter an expression mode.
- write an expression, you can include your yanked content with (ctrl + register) + ". Useful when you need to increment or operate on some kind of a variable within the macro.
-
g~/gU/gu to toggle/upper/lower the case - there's no mnemonic for that :<
-
Use find to find a character in current line
-
Move your cursor to the top, mid and bottom of the screen with respectively High, Middle, Low keys in normal mode
-
Yank something to register with simply "y something and then paste with "p
- awesome shortcut - when in INSERT mode just hit ctrl + r and to simply paste register's value, use ctrl + a to paste the last one. Default register is "
-
Use completion modes. Hit ctrl + xpand and then:
- ctrl + line to complete whole lines for file
- ctrl + previous to complete words found backwards in file
- ctrl + filenames to complete filenames
- ctrl + omnicompletion for omnicompletion
- abc</ and then omnicompletion will close html tag
- ctrl + next for keywords in current file
-
za/zclose/zopen to toggle/close/open folding
-
In order to change all existing tab characters to match settings, run :retab
-
To unwrap something, e.g. ([{foo: bar}]) -> {foo: bar} just do:
- ya} to yank content of inner braces (inclusive)
- va( to select everything in () (inclusive)
- p to replace selected content with the yanked one
-
Replacement has some super features:
- :%s//abc will replace all occurences of your last search. Search with /def and then run /%s//abc to replace all def's with abc's
- use global flag to replace all in file occurences
- use confirm flag to confirm every replacement
- :%s/<foo>/bar/gc wrap words in <> in order to search for full words onyl
-
Use ctrl + o(ut)/ctrl + i(n) to go to previous/next file
-
govisual in the visual mode returns to the latest selection
-
ctrl + forwards/backwards to move backward/forward a page; ctrl + up/down to go up/down half a page. ctrl + e/y to move without moving a cursor
-
zz/ztop/zbottom to move screen and place cursor's position at center/top/bottom
-
You can escape insert mode with ctrl + c as well.
-
Xtract in normal mode to remove character backwards.
-
goinsert puts you in insert mode in the last position you were while in insert mode.
-
use :split and :vsplit commands to split the screen horizontally/vertically
-
when you start editing multiple files with vim with e.g. vim a.txt b.txt you can navigate between them with [a/]a keys
-
Use Join to join the current line with line below
Glastmsg
command - run this command while commiting to paste the last msg inside the text. Useful when you want to reuse some piece of information from the previous commit message (jira ticket number for instance)<leader>ss
to remove redundant trailing spaces all over the document<Leader>lx
to lint xml<Leader>sh
to split horizontally,<Leader>sv
to split vertically
- nerdtree -
- ctrl + nerdtree to toggle nerdtree
<leader>
showfile to show the current file (node in NerdTree)- inside the nerdtree hit menu to show menu, where you can create a file or something
- ctrlp - simply hit
ctrl + p
to search through current file's repositoryctrl + d
to enter filename-only search- ctrl + tab to open a selection in a new tab
ctrl + x or v
to open a selection in a new split
- fugitive:
Gblame
- git blame. Hito
when blaming to see the full commit infoGlog
- loads all previous version of the file -cprev
/cnext
/cfirst
/clast
commands allow you to move between version freelyGedit SHA
-Gstatus
- git status in good looking
- vim-surround:
ysw"
for example wraps current word with""
cs"'
from inner quote to change surrounding from"
to'
cst<xyz>
replaces current surrounding tag with new<xyz>
S<tag>
from visual mode to wrap selected items in
- nerdcommenter:
<leader>c<space>
to toggle the comment
- ack.vim:
:Ack <phrase> <dir>
- dir defaults to current if absentt
- open in new tab
- tabularize.vim
:Tab /=
to use a column layout with=
as a separator
- you can write only specific files. Just enter
:15,19 w
to write lines 15,16,17,18,19 only.
ctrl + a
/ctrl + e
- beginning/end of the linectrl + k
- delete to the end of the linectrl + r
/ctrl + s
- search backward/forwardctrl + w
- delete the word behind the cursor
- use
!$
to reuse last word of the last command. - use
!!
to reuse last command ~-
/~+
+TAB
to show the list of recently entered dirs
- pipe your file to
less
if it's too big to fit on screen. Usehead
ortail
(or eventail -f
to follow the end of the file) to see the specific part of the file wc
to count lines, words or characters. Useful if you want to pipe things intowc
in order to e.g. find the number of matching files fromfind
grep
allows you to search a string inside the files.-r
for recursive search.- use
ssh-copy-id
to copy your identity file to a remote host.
- git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- git clone https://github.com/peterhurford/git-it-on.zsh ~/.oh-my-zsh/custom/plugins/git-it-on
- pip install pygments #to make colorize plugin work
- git clone https://github.com/wting/autojump.git && cd autojump && chmod +x install.py && python install.py
- bd - move up in the
pwd
- gitit - open current repo's github
colorize <file> | less
to get colorized file output- autojump - allows to quickly search through visited (at least once) directories. Just type
j <partial_filename>
to see list of possible files/dirs wd
adds tags to directory so afterwd add <dir_name>
in some directory you can dowd <dir_name>
to immediately jump to this dir MORE?take
to create a directory and change to it
- All hotkeys visible via
ctrl + ?
Ctrl+b
is a prefix on a host machineCtrl+j
is a prefix on a remote machine- Most useful ones:
-
n
/p
go to to next/previous window
-
<number>
to go to specified window
-
attach
/detach
-
c
to create a window
-
}
to swap windows
-
<right>
/<left>
to move between panes
-
%
/"
to split windows with panes - horizontally/vertically
-
$
to rename session
-
z
to fullscreen pane
In order to use a config, e.g. for rpi:
scp ~/.rpi.tmux.conf pi@raspberrypi:~/.tmux.conf
ssh pi@raspberrypi -t tmux -2 a
- use
cloc
application in order to reveal the number of lines of code in your project