Miscellaneous odds and ends

Miscellaneous tips

vim

    My .vimrc:
1
set tabstop=4
2
set shiftwidth=4
3
set expandtab
4
highlight ExtraWhitespace ctermbg=red guibg=red
5
match ExtraWhitespace /\s\+$/
6
7
augroup trailing_whitespace
8
autocmd!
9
autocmd BufWritePre *.c :%s/\s\+$//e
10
autocmd BufWritePre *.h :%s/\s\+$//e
11
autocmd BufWritePre *.cxx :%s/\s\+$//e
12
autocmd BufWritePre *.hxx :%s/\s\+$//e
13
augroup END
14
15
nmap <silent> <A-Up> :wincmd k<CR>
16
nmap <silent> <A-Down> :wincmd j<CR>
17
nmap <silent> <A-Left> :wincmd h<CR>
18
nmap <silent> <A-Right> :wincmd l<CR>
Copied!

git

    To show all branches in a tree like structure, run: git config --global alias.logtree "log --graph --simplify-by-decoration --all --branches --oneline --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" Then you just use git logtree

Document Liberation Project

Last modified 4mo ago