Tech Notes

New neovim key bindings

  • b/e/s/p
  • gcc for comments
  • gsa/gsr/gsd for adding/replacing/deleting surroundings
  • diw/diq/dib for deleting inside of surroundings
  • bve: move to the beginning of a word, and get into visual model, and move the end of the word: this is how to select a word.
  • ]i for moving out of identations
  • <space>sw for search the word under the cursor

Commands I always forget

  • Ditch the last commit
1git reset --hard HEAD~1
  • copy with aws s3
1aws s3 cp s3://bucket-name/folder-name/ local-folder/ --recursive
  • save tmux history
1tmux capture-pane -pS - > tmux-history.txt
  • find out listening ports
1sudo netstat -anvp tcp | grep LISTEN
  • convert to pdf with pandoc
 1# Basic conversion with table of contents
 2pandoc input.md -o output.pdf --toc
 3
 4# With additional options for better formatting
 5pandoc input.md \
 6  -o output.pdf \
 7  --toc \
 8  --pdf-engine=xelatex \
 9  --variable mainfont="DejaVu Sans" \
10  --variable fontsize=12pt \
11  --variable geometry="margin=1in"