diff options
| -rw-r--r-- | config/zsh/aliases/dev.zsh | 2 | ||||
| -rw-r--r-- | config/zsh/aliases/git.zsh | 12 | ||||
| -rw-r--r-- | config/zsh/init.zsh | 2 | ||||
| -rw-r--r-- | modules/git.home.nix | 46 |
4 files changed, 37 insertions, 25 deletions
diff --git a/config/zsh/aliases/dev.zsh b/config/zsh/aliases/dev.zsh index 2071024..65922a1 100644 --- a/config/zsh/aliases/dev.zsh +++ b/config/zsh/aliases/dev.zsh @@ -37,6 +37,8 @@ calc() { } get_node_script_runner() { + # TODO: Check .engines.* + # jq -r .engines.pnpm package.json if [[ -f ./yarn.json ]]; then echo "yarn"; elif [[ -f ./bun.lockb ]]; then echo "bun run"; elif [[ -f ./pnpm-lock.yaml ]]; then echo "pnpm"; diff --git a/config/zsh/aliases/git.zsh b/config/zsh/aliases/git.zsh index 7dcd621..18f988d 100644 --- a/config/zsh/aliases/git.zsh +++ b/config/zsh/aliases/git.zsh @@ -31,7 +31,7 @@ alias g='git' alias ga='git add' alias gaa='git add --all' -alias gco='git checkout' +# alias gco='git checkout' alias gb='git branch' alias gc='git commit -v' @@ -88,3 +88,13 @@ g_most_edited() { ; } +# Git checkout branch +gco() { + if ! [ "$#" = "0" ]; then + git checkout "$@"; + else + local b="$(git branch | fzf | xargs)"; + [ -n "$b" ] && git switch "$b"; + fi +} + diff --git a/config/zsh/init.zsh b/config/zsh/init.zsh index 1d7825c..5fca111 100644 --- a/config/zsh/init.zsh +++ b/config/zsh/init.zsh @@ -1,7 +1,7 @@ export TRASH_TMP_DIR=/tmp/.trash-cache; -[[ ! -d "$TRASH_TMP_DIR" ]] && mkdir $TRASH_TMP_DIR; +# [[ ! -d "$TRASH_TMP_DR" ]] && mkdir -p $TRASH_TMP_DIR; #export rmrf() { #for var in "$@"; do diff --git a/modules/git.home.nix b/modules/git.home.nix index 963abb4..e1ba8c9 100644 --- a/modules/git.home.nix +++ b/modules/git.home.nix @@ -5,7 +5,7 @@ extensions = with pkgs; [ gh-copilot gh-poi - gh-dash + # gh-dash gh-notify ]; settings = { @@ -17,28 +17,28 @@ }; }; - programs.gh-dash = { - enable = true; - settings = { - defaults = { - preview = { - open = true; - width = 80; - }; - }; - pager = { diff = "delta"; }; - keybindings = { - prs = [ - { key = "m"; command = "echo accident"; } - { key = "x"; command = "echo accident"; } - { key = "a"; command = "echo accident"; } - { key = "A"; command = "echo accident"; } - { key = "W"; command = "echo accident"; } - { key = "X"; command = "echo accident"; } - ]; - }; - }; - }; + # programs.gh-dash = { + # enable = true; + # settings = { + # defaults = { + # preview = { + # open = true; + # width = 80; + # }; + # }; + # pager = { diff = "delta"; }; + # keybindings = { + # prs = [ + # { key = "m"; command = "echo accident"; } + # { key = "x"; command = "echo accident"; } + # { key = "a"; command = "echo accident"; } + # { key = "A"; command = "echo accident"; } + # { key = "W"; command = "echo accident"; } + # { key = "X"; command = "echo accident"; } + # ]; + # }; + # }; + # }; programs.git = { enable = true; |
