Vim
This isn't a cheatsheet and doesn't replace one. It's the useful commands I would personally forget before I wrote them here, as well as the set of modules and config I use across all installations.
Command | |
---|---|
C | Replace to end of line |
dG | Delete to end of file |
:sort | Sort selected lines |
:sort u | Sort, keeping unique entries |
:sort n | Sort by first number seen |
:noh | Remove highlights from previous search |
:set nu | Numbers on left (nu! to toggle off) |
:set rnu | Relative numbers on left (useful to know how much to yy) |
:set paste | Avoid strange indentation when pasting from clipboard |
A good .vimrc (I prefer to keep it as default as possible)
set tags=./tags,tags;
set path+=**
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
How to install plugins I have enabled at the moment:
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/pack/dist/start/nerdtree
git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
⁂