Neovim

ciw = change inner word shift + j appends next line at the end of current create compile_commands.json for c projects find . -name "*.c" -o -name "*.h" | xargs -I{} echo '{"directory":"'$(pwd)'","file":"'$(pwd)'/{}","command":"clang -I'$(pwd)'/unix -c {}"}' > compile_commands.json.entries echo '[' > compile_commands.json cat compile_commands.json.entries | tr '\n' ',' | sed 's/,$//' >> compile_commands.json echo ']' >> compile_commands.json rm compile_commands.json.entries

January 31, 2024 · 1 min

Evil Marks in doom emacs

Basic Mark Operations Setting & Jumping m{a-zA-Z} Set mark {a-zA-Z} at point '{a-zA-Z} Jump to mark {a-zA-Z} `` Jump to position before last jump '. Jump to last change '^ Jump to last insertion Special Jumps '[ Start of last change/yank '] End of last change/yank '< Start of last visual selection '> End of last visual selection Automatic Marks '' Last jump position '" Position when last exiting buffer '0 Position in last edited file '1 through '9 Previous positions in change list Mark Ring C-o Older position in jump list C-i Newer position in jump list :marks List all marks :delmarks {marks} Delete specified marks :delmarks! Delete all buffer marks Visual Operations with Marks v'{mark} Select to mark V'{mark} Select lines to mark d'{mark} Delete to mark y'{mark} Yank to mark Global Marks m{A-Z} Set global mark '{A-Z} Jump to global mark :wshada! Save marks :rshada! Restore marks Tips Lowercase marks (a-z) → local buffer Uppercase marks (A-Z) → global/cross-file Marks persist until deleted/reset Mark ring ≠ jump list ShaDa saves between sessions

1 min · Pranchal Shah

Git Cheatsheet

Git Rebase Guide The Golden Command 🏆 git rebase --onto master $(git merge-base master your-branch) Why It’s Amazing Surgical precision: Only replays commits unique to your branch No duplicate drama: Avoids the “commit déjà vu” syndrome Conflict minimization: Less merge pain = more coffee time Full Safety Protocol # 1. Backup your branch (because paranoia is a virtue) git branch your-branch-backup # 2. Update master (don't build on ancient history) git checkout master git pull upstream master # 3. The magic rebase git checkout your-branch git rebase --onto master $(git merge-base master your-branch) # If things go sideways: git rebase --abort git reset --hard your-branch-backup Remember It By Think “archaeological transplant”: ...

1 min · Pranchal Shah