feat: more git aliases, nodejs_20

This commit is contained in:
teutat3s 2024-02-02 23:27:44 +01:00
parent 516ec7ca24
commit 3cb6950d84
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
3 changed files with 22 additions and 1 deletions

View file

@ -13,7 +13,7 @@ in {
gimp
inkscape
tigervnc
nodejs
nodejs_20
signal-desktop
tdesktop

View file

@ -23,6 +23,9 @@ in {
# Show current directory at the top in Alacritty
PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD" | sed "s/${psCfg.user.name}/~/")\e\\"'
# Used for git aliases defined in modules/terminal-life/git/default.nix
export REVIEW_BASE=main
# If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.bash

View file

@ -37,5 +37,23 @@
# delete merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
# list files which have changed since REVIEW_BASE
# (REVIEW_BASE defaults to 'main' in bashrc)
files = ''!git diff --name-only $(git merge-base HEAD "$REVIEW_BASE")'';
# Same as above, but with a diff stat instead of just names
# (better for interactive use)
stat = ''!git diff --stat $(git merge-base HEAD "$REVIEW_BASE")'';
# Open all files changed since REVIEW_BASE in Vim tabs
# Then, run fugitive's :Gdiff in each tab, and finally
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
review = ''!vim -p $(git files) +"tabdo Gdiff $REVIEW_BASE" +"let g:gitgutter_diff_base = '$REVIEW_BASE'"'';
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.js
reviewone = ''!vim -p +"tabdo Gdiff $REVIEW_BASE" +"let g:gitgutter_diff_base = '$REVIEW_BASE'"'';
};
}