Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@deqing
Created October 4, 2018 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deqing/db40e43763e56a295b3226d6dcf22bba to your computer and use it in GitHub Desktop.
Save deqing/db40e43763e56a295b3226d6dcf22bba to your computer and use it in GitHub Desktop.
my linux cheatsheet

Table of Contents

ag

ag pattern
ag -G 'h$' -w pattern
ag -G '\.(cc|h)$' pattern

gdb

Step out of function

finish

cgdb - a gdb with syntax highlights

  1. esc and i: switch between windows
  2. Resize window: +/- (try using shift)
  3. can use reverse-i-search

vim

highlight multilines

:highlight currawong ctermbg=darkred guibg=darkred
:match currawong /\%12l\|\%34l\|\%5l/
:match currawong /\v.*(%'a|%'b|%'c|%'d).*/

highlight multi-words

:match Search /\<GetMetadata\>\|\<BuildEnum\>\|\<FindFileByName\>/
tip: use ctrl-R then / to paste current search pattern

vimdiff

Go to next/pre diff

]c
[c

Turn off read-only

:set ro!

To avoid whitespace comparison

:set diffopt+=iwhite

set color scheme in .vimrc:

if &diff
  colorscheme elflord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment