feat: more git aliases, nodejs_20
This commit is contained in:
parent
516ec7ca24
commit
3cb6950d84
|
@ -13,7 +13,7 @@ in {
|
|||
gimp
|
||||
inkscape
|
||||
tigervnc
|
||||
nodejs
|
||||
nodejs_20
|
||||
|
||||
signal-desktop
|
||||
tdesktop
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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'"'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue