diff --git a/users/pbsds/home/profiles/git.nix b/users/pbsds/home/profiles/git.nix index 20da347..b51e93b 100644 --- a/users/pbsds/home/profiles/git.nix +++ b/users/pbsds/home/profiles/git.nix @@ -8,6 +8,7 @@ (pkgs.symlinkJoin { inherit (pkgs.hub) name meta; paths = [ pkgs.hub ]; + # TODO: this could be a pre-command added with makeWrapper postBuild = '' rm $out/bin/hub cat <<"EOF" >$out/bin/hub @@ -26,6 +27,7 @@ tea colordiff + diffnav ]; #programs.gh.enable = true; # adds read-only config to .config @@ -97,6 +99,8 @@ #gb = "git blame"; #gpo = "git push origin"; #gpf = "git push --force-with-lease --force-if-includes"; + + # TODO: use -c commit.template instead gcm = ''git commit --message "$(printf '%s\n' ${lib.concatStringsSep " " [ ''"$(curl -sL https://whatthecommit.com/index.txt)"'' ''""'' diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index 60d5ccc..f1620c4 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -84,7 +84,7 @@ in # "--preview 'bat {}'" # "--preview 'tail -n$LINES {} | bat --file-name {} --paging never --style plain'" # "--preview 'bat {} --paging never --style plain' --preview-window follow" - "--preview 'if [[ -f {} ]]; then tail -n$LINES {} | bat --paging=never --style=plain --color=always --file-name {} ; else file {} ; fi' --preview-window follow" + "--preview 'if [[ -f {} ]]; then tail -n$LINES {} | bat --paging=never --style=plain --color=always --file-name {} ; elif [[ -e {}/.git ]]; then git -C {} status else file {} ; fi' --preview-window follow" # https://github.com/junegunn/fzf/discussions/3363#discussioncomment-6419463 "--bind 'ctrl-a:reload:eval $FZF_DEFAULT_COMMAND --no-ignore'"