diff --git a/conf/yabai/yabairc b/conf/yabai/yabairc index 12db97cc..63bca062 100755 --- a/conf/yabai/yabairc +++ b/conf/yabai/yabairc @@ -47,7 +47,7 @@ yabai -m config display_arrangement_order vertical # yabai -m config window_animation_duration 0 yabai -m config window_animation_easing ease_in_sine yabai -m config window_origin_display cursor -yabai -m config split_type horizontal +yabai -m config split_type vertical yabai -m config auto_balance x-axis yabai -m config window_opacity off @@ -82,21 +82,21 @@ yabai -m rule --add app="(Finder|访达|DevTools|模拟器|Kap|Bartender|Trading # stackline specific tweaks -yabai -m signal --add event=window_created action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=window_destroyed action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=application_terminated action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=window_deminimized action='~/.config/yabai/yabai-panes.sh; yabai -m window --warp first' -yabai -m signal --add event=window_minimized action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=application_hidden action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=application_visible action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=space_destroyed action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=space_changed action='~/.config/yabai/yabai-panes.sh' -yabai -m signal --add event=display_changed action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=window_created action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=window_destroyed action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=application_terminated action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=window_deminimized action='~/.config/yabai/yabai-panes.sh; yabai -m window --warp first' +# yabai -m signal --add event=window_minimized action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=application_hidden action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=application_visible action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=space_destroyed action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=space_changed action='~/.config/yabai/yabai-panes.sh' +# yabai -m signal --add event=display_changed action='~/.config/yabai/yabai-panes.sh' ## final yabai -m rule --apply ## run the panel layout -~/.config/yabai/yabai-panes.sh +# ~/.config/yabai/yabai-panes.sh echo "yabai configuration loaded.." diff --git a/flake.lock b/flake.lock index 33a660ee..18e88b20 100644 --- a/flake.lock +++ b/flake.lock @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1740755725, - "narHash": "sha256-amZbqP84H/ApugaT+TADXTB3NbjkVHI9Vac1saIk0kE=", + "lastModified": 1741229100, + "narHash": "sha256-0HwrTDXp9buEwal/1ymK9uQmzUD5ozIA7CJGqnT/gLs=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "5d6e0851b60508cffd66b4a6982440a40720338d", + "rev": "adf5c88ba1fe21af5c083b4d655004431f20c5ab", "type": "github" }, "original": { @@ -65,11 +65,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1740724364, - "narHash": "sha256-D1jLIueJx1dPrP09ZZwTrPf4cubV+TsFMYbpYYTVj6A=", + "lastModified": 1741329193, + "narHash": "sha256-niB60+AZBnp535cwvu5jU+K/cKfJeaWqt3GtrDMlLU0=", "owner": "nix-community", "repo": "fenix", - "rev": "edf7d9e431cda8782e729253835f178a356d3aab", + "rev": "232581de4261157f316848773574d1f5895805f3", "type": "github" }, "original": { @@ -87,11 +87,11 @@ "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { - "lastModified": 1738391509, - "narHash": "sha256-TC3xA++KgprECm/WPsLUd+a77MObZPElCW6eAsjVW1k=", + "lastModified": 1740810935, + "narHash": "sha256-6RzWfxENGlO73jQb3uQNgOvubUFwvveeIg+PZxhAu6s=", "owner": "nix-community", "repo": "fenix", - "rev": "de3ea31eb651b663449361f77d9c1e8835290470", + "rev": "f44d7c3596ff028ad9f7fcc31d1941ed585f11b3", "type": "github" }, "original": { @@ -390,7 +390,9 @@ "cl-nix-lite": "cl-nix-lite", "flake-compat": "flake-compat", "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems_2" }, "locked": { @@ -430,17 +432,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732617236, - "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=", - "owner": "NixOS", + "lastModified": 1741037377, + "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", + "rev": "02032da4af073d0f6110540c8677f16d4be0117f", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", - "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", "type": "github" } }, @@ -464,11 +466,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1740743217, - "narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=", + "lastModified": 1741332913, + "narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c", + "rev": "20755fa05115c84be00b04690630cb38f0a203ad", "type": "github" }, "original": { @@ -478,54 +480,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1740547748, - "narHash": "sha256-Ly2fBL1LscV+KyCqPRufUBuiw+zmWrlJzpWOWbahplg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3a05eebede89661660945da1f151959900903b6a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1708161998, - "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "84d981bae8b5e783b3b548de505b22880559515f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1717696253, - "narHash": "sha256-1+ua0ggXlYYPLTmMl3YeYYsBXDSCqT+Gw3u6l4gvMhA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9b5328b7f761a7bbdc0e332ac4cf076a3eedb89b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "darwin": "darwin", @@ -534,7 +488,7 @@ "gitu": "gitu", "home-manager": "home-manager", "mac-app-util": "mac-app-util", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", "zig": "zig", "zls": "zls" @@ -543,11 +497,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1740691488, - "narHash": "sha256-Fs6vBrByuiOf2WO77qeMDMTXcTGzrIMqLBv+lNeywwM=", + "lastModified": 1741300343, + "narHash": "sha256-Engmn908XKEy/hmriudPQbX1QWr7ySpmQg9HbTigiME=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "fe3eda77d3a7ce212388bda7b6cec8bffcc077e5", + "rev": "21a88a3767c4a6b3f211ed12174b923be851e1c6", "type": "github" }, "original": { @@ -560,11 +514,11 @@ "rust-analyzer-src_2": { "flake": false, "locked": { - "lastModified": 1738224931, - "narHash": "sha256-1zhfA5NBqin0Z79Se85juvqQteq7uClJMEb7l2pdDUY=", + "lastModified": 1740737930, + "narHash": "sha256-2AW/FJQI/i6bbRB/8HR9l9SjxjuiukJpHdMPgwApPKA=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "3c2aca1e5e9fbabb4e05fc4baa62e807aadc476a", + "rev": "fe8444616679f8e50ff9696f4750df1f10e7433d", "type": "github" }, "original": { @@ -670,14 +624,16 @@ "inputs": { "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1740744710, - "narHash": "sha256-VwZd6L6oOpMlynP0aw9nd5a0qnpJrdQW4G+El50mFXE=", + "lastModified": 1741263138, + "narHash": "sha256-qlX8tgtZMTSOEeAM8AmC7K6mixgYOguhl/xLj5xQrXc=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "8f4184dcad59fac2ab06faf08371b6fb4288f619", + "rev": "627055069ee1409e8c9be7bcc533e8823fb87b18", "type": "github" }, "original": { @@ -714,7 +670,9 @@ "flake-utils": "flake-utils_4", "gitignore": "gitignore", "langref": "langref", - "nixpkgs": "nixpkgs_4", + "nixpkgs": [ + "nixpkgs" + ], "zig-overlay": "zig-overlay" }, "locked": { diff --git a/flake.nix b/flake.nix index 19e47d46..d4f0ab0c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Towry de dotfiles"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.11"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; @@ -12,13 +12,22 @@ url = "github:LnL7/nix-darwin/master"; inputs.nixpkgs.follows = "nixpkgs"; }; - mac-app-util.url = "github:hraban/mac-app-util"; + mac-app-util = { + url = "github:hraban/mac-app-util"; + inputs.nixpkgs.follows = "nixpkgs"; + }; git-smash = { url = "github:towry/nix-flakes?dir=git-smash"; inputs.nixpkgs.follows = "nixpkgs"; }; - zig.url = "github:mitchellh/zig-overlay"; - zls.url = "github:zigtools/zls?ref=refs/tags/0.13.0"; + zig = { + url = "github:mitchellh/zig-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zls = { + url = "github:zigtools/zls?ref=refs/tags/0.13.0"; + inputs.nixpkgs.follows = "nixpkgs"; + }; gitu = { url = "github:pze/gitu?ref=master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -134,7 +143,7 @@ "https://dots.cachix.org" "https://nix-community.cachix.org" "https://towry.cachix.org" - "https://mirrors.ustc.edu.cn/nix-channels/store" + # "https://mirrors.ustc.edu.cn/nix-channels/store" "https://cache.nixos.org" ]; extra-trusted-public-keys = [ diff --git a/nix/darwin/configuration.nix b/nix/darwin/configuration.nix index dcfbf8e0..d22869e6 100644 --- a/nix/darwin/configuration.nix +++ b/nix/darwin/configuration.nix @@ -58,6 +58,7 @@ }; programs.fish.enable = true; + programs.fish.package = pkgs.fish; homebrew = { enable = true; @@ -83,7 +84,7 @@ "https://dots.cachix.org" "https://nix-community.cachix.org" "https://towry.cachix.org" - "https://mirrors.ustc.edu.cn/nix-channels/store" + # "https://mirrors.ustc.edu.cn/nix-channels/store" "https://cache.nixos.org" ]; trusted-users = [ diff --git a/nix/hm/fish.nix b/nix/hm/fish.nix index 8431e67e..3030e2ef 100644 --- a/nix/hm/fish.nix +++ b/nix/hm/fish.nix @@ -18,6 +18,7 @@ carapace.enableFishIntegration = true; kitty.shellIntegration.enableFishIntegration = true; fish = { + package = pkgs.fish; enable = true; plugins = [ { diff --git a/nix/hm/git.nix b/nix/hm/git.nix index 38c0f4f4..be015bba 100644 --- a/nix/hm/git.nix +++ b/nix/hm/git.nix @@ -1,7 +1,7 @@ { pkgs, lib, - theme, + # theme, ... }: let @@ -25,11 +25,10 @@ in home.packages = with pkgs; [ # github cli, manage repo, gists etc. gh - stgit + # stgit git-smash - # difftastic gnupg - # gitu + # git-sim ]; programs.git = { enable = true; @@ -44,127 +43,121 @@ in background = "light"; }; - aliases = - { - co = "checkout"; - ad = "add"; - ada = "add -A"; - sw = "switch"; - # apply patch with commit text only (no committee info) - apply-diff-patch = "apply --allow-empty"; - # amend without edit, not use ca because sometimes we should use git sm instead. - amend = "commit --amend --no-edit"; - ci = "commit"; - cne = "commit --no-edit"; - cm = "commit -m"; - st = "status"; - add-note = ''branch --edit-description''; - note = ''!git config --get branch.$(git rev-parse --abbrev-ref HEAD).description''; - sh = "show"; - default-branch = "!git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4"; - ss = ''!f() { if [ $# -eq 0 ]; then git stash list; else git stash $@; fi; }; f''; - # stash and name with "wip" - ss-wip = "stash -m wip"; - # stash staged changes - ss-staged = "stash --staged"; - up = ''!git push -u origin HEAD:$(git rev-parse --abbrev-ref HEAD)''; - fu = ''!git status --short && git push -u --force-with-lease''; - pr = "pull --rebase"; - pp = ''!git pull --no-tags --prune --ff origin $(git rev-parse --abbrev-ref HEAD)''; - px = ''pull --all --prune --no-tags''; - pp-theirs = ''!git pull -X theirs --no-tags --ff origin $(git rev-parse --abbrev-ref HEAD)''; - pp-ours = ''!git pull -X ours --no-tags --ff origin $(git rev-parse --abbrev-ref HEAD)''; - ps = ''!git pull --autostash --no-tags origin $(git rev-parse --abbrev-ref HEAD)''; - pf = ''!git pull --no-tags --ff-only $(git-rev-parse --abbrev-ref HEAD)''; - fa = "fetch --all --no-tags"; - # fz = "fuzzy"; - ff = "fetch --no-tags"; - fp = "fetch --prune --prune-tags"; - mg = "merge --no-edit --ff"; - mg-theirs = "merge --no-edit --ff -X theirs"; - kill-merge = "merge --abort"; - br = "branch --sort=-committerdate"; - br-gone = "!git branch -vv | grep -F ': gone]' | awk '{ print $1 }' | grep -vF '*'"; - br-prune-gone = "!git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"; - df = "diff"; - dt = "difftool"; - dfc = "diff --cached"; - dfh = "diff HEAD"; - dfs = "diff --stat"; - wc = "whatchanged"; - wc1 = "whatchanged -1"; - wcl = "whatchanged -3"; - cat = "cat-file -p"; - undo = "reset --soft"; - sm = "!git-smash"; - sn = "!git-smash --no-rebase"; - fixup = "commit --fixup"; - autofixup = "!git commit --fixup $1 && git rebase -i --autosquash --rebase-merges $1~1"; - reset-remote = "!git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)"; - unstage = "restore --staged"; - changed-files = "!sh -c 'default_branch=master; if git rev-parse --verify master >/dev/null 2>/dev/null; then default_branch=master; elif git rev-parse --verify main >/dev/null 2>/dev/null; then default_branch=main; else echo \"Neither master nor main branches found.\"; exit 1; fi; git fetch origin $default_branch >/dev/null 2>&1; git diff --name-only origin/$default_branch...'"; - add-remote-branches = "remote set-branches --add"; - ls-remote-heads = "!git ls-remote -h -q | awk '{print $2}' | sed 's/refs\\/heads\\///'"; - lg = "log --graph --pretty=format:'%Cred%h%Creset %s %C(white)%ad%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short"; - lg1 = "log --oneline --date=relative --pretty=format:'%Cred%h%Creset %s %C(white)%ad%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset'"; - lt = "log --oneline --date=relative -n3 --pretty=format:'%Cred%h%Creset %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset - %C(white)%ad%Creset'"; - yesterday = "log --since yesterday --until=midnight --color --graph \ + aliases = { + co = "checkout"; + ad = "add"; + ada = "add -A"; + sw = "switch"; + # apply patch with commit text only (no committee info) + apply-diff-patch = "apply --allow-empty"; + # amend without edit, not use ca because sometimes we should use git sm instead. + amend = "commit --amend --no-edit"; + ci = "commit"; + cne = "commit --no-edit"; + cm = "commit -m"; + st = "status"; + add-note = ''branch --edit-description''; + note = ''!git config --get branch.$(git rev-parse --abbrev-ref HEAD).description''; + sh = "show"; + default-branch = "!git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4"; + ss = ''!f() { if [ $# -eq 0 ]; then git stash list; else git stash $@; fi; }; f''; + # stash and name with "wip" + ss-wip = "stash -m wip"; + # stash staged changes + ss-staged = "stash --staged"; + up = ''!git push -u origin HEAD:$(git rev-parse --abbrev-ref HEAD)''; + fu = ''!git status --short && git push -u --force-with-lease''; + pr = "pull --rebase"; + pp = ''!git pull --no-tags --prune --ff origin $(git rev-parse --abbrev-ref HEAD)''; + px = ''pull --all --prune --no-tags''; + pp-theirs = ''!git pull -X theirs --no-tags --ff origin $(git rev-parse --abbrev-ref HEAD)''; + pp-ours = ''!git pull -X ours --no-tags --ff origin $(git rev-parse --abbrev-ref HEAD)''; + ps = ''!git pull --autostash --no-tags origin $(git rev-parse --abbrev-ref HEAD)''; + pf = ''!git pull --no-tags --ff-only $(git-rev-parse --abbrev-ref HEAD)''; + fa = "fetch --all --no-tags"; + # fz = "fuzzy"; + ff = "fetch --no-tags"; + fp = "fetch --prune --prune-tags"; + mg = "merge --no-edit --ff"; + mg-theirs = "merge --no-edit --ff -X theirs"; + kill-merge = "merge --abort"; + br = "branch --sort=-committerdate"; + br-gone = "!git branch -vv | grep -F ': gone]' | awk '{ print $1 }' | grep -vF '*'"; + br-prune-gone = "!git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"; + df = "diff"; + dt = "difftool"; + dfc = "diff --cached"; + dfh = "diff HEAD"; + dfs = "diff --stat"; + wc = "whatchanged"; + wc1 = "whatchanged -1"; + wcl = "whatchanged -3"; + cat = "cat-file -p"; + undo = "reset --soft"; + sm = "!git-smash"; + sn = "!git-smash --no-rebase"; + fixup = "commit --fixup"; + autofixup = "!git commit --fixup $1 && git rebase -i --autosquash --rebase-merges $1~1"; + reset-remote = "!git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)"; + unstage = "restore --staged"; + changed-files = "!sh -c 'default_branch=master; if git rev-parse --verify master >/dev/null 2>/dev/null; then default_branch=master; elif git rev-parse --verify main >/dev/null 2>/dev/null; then default_branch=main; else echo \"Neither master nor main branches found.\"; exit 1; fi; git fetch origin $default_branch >/dev/null 2>&1; git diff --name-only origin/$default_branch...'"; + add-remote-branches = "remote set-branches --add"; + ls-remote-heads = "!git ls-remote -h -q | awk '{print $2}' | sed 's/refs\\/heads\\///'"; + lg = "log --graph --pretty=format:'%Cred%h%Creset %s %C(white)%ad%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short"; + lg1 = "log --oneline --date=relative --pretty=format:'%Cred%h%Creset %s %C(white)%ad%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset'"; + lt = "log --oneline --date=relative -n3 --pretty=format:'%Cred%h%Creset %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset - %C(white)%ad%Creset'"; + yesterday = "log --since yesterday --until=midnight --color --graph \ --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)[%an]%Creset' \ --abbrev-commit"; - clone1 = "clone --depth=1"; - des = "describe"; - wt = "worktree"; - mt = "mergetool"; - mt-code = "mergetool --tool=code"; - mt-cursor = "mergetool --tool=cursor"; - bi = "bisect"; - rp = "rev-parse"; - rl = "rev-list"; - rn = "name-rev"; - rb = "rebase"; - rbk = "rebase --skip"; - rbc = "rebase --continue"; - rba = "rebase --abort"; - rbi = "rebase -i"; - # autosquash previous fixup! commits - close-fixup = "!git rebase -i --autosquash --autostash"; - "re3" = "rerere"; - latest-tag = "describe --tags"; - alias = "! git config --get-regexp '^alias\\.' | sed 's/^alias\\.//' | fzf"; - ignore = "!gi() { curl -sL https://www.gitignore.io/api/$@ ;}; gi"; - config-fetch-origin = ''config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"''; - clone-bare = ''!f() { git clone --bare $@ && cd $@ && git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"; }; f''; - ahead = "rev-list --left-right --count"; - # count commit diff between two branches - commit-diff-count = ''!f() { git rev-list --count HEAD ^$1; }; f''; - # create feat branch in format of feat/YYYYMMDD-short-description, also accept other git arguments - br-feat = "!f() { git checkout -b feat/$(date +%Y%m)-$1 $2; }; f"; - br-fix = "!f() { git checkout -b fix/$(date +%Y%m)-$1 $2; }; f"; - br-refactor = "!f() { git checkout -b refactor/$(date +%Y%m)-$1 $2; }; f"; - # sync and rebase, for example: git sync-rebase origin master do: git fetch origin master && git rebase origin/master - sync-rebase = "!f() { git fetch $1 $2 && git rebase $1/$2; }; f"; - # commit convention - it-wip = ''!f() { git commit -m "wip: [skip ci] $([[ -z $@ ]] && date || echo $@ )"; }; f''; - it-fix = ''!f() { git commit -m "fix: $(echo $@)"; }; f''; - it-fmt = ''!f() { git commit -m "style: $(echo $@)"; }; f''; - it-test = ''!f() { git commit -m "test: $(echo $@)"; }; f''; - it-ref = ''!f() { git commit -m "refactor: $(echo $@)"; }; f''; - it-doc = ''!f() { git commit -m "doc: $(echo $@)"; }; f''; - it-feat = ''!f() { git commit -m "feat: $(echo $@)"; }; f''; - it-perf = ''!f() { git commit -m "perf: $(echo $@)"; }; f''; - it-chore = ''!f() { git commit -m "chore: $(echo $@)"; }; f''; - it-revert = ''!f() { git commit -m "revert: $(echo $@)"; }; f''; - it-build = ''!f() { git commit -m "build: $(echo $@)"; }; f''; - it-ci = ''!f() { git commit -m "ci: $(echo $@)"; }; f''; - it-skip = ''!f() { git commit -m "[skip ci]: $(echo $@)"; }; f''; - it-deps = ''!f() { git commit -m "deps: $(echo $@)"; }; f''; - it-rm = ''!f() { git commit -m "cleanup: $(echo $@)"; }; f''; - } - // { - # alias for stg - refresh = "!f() { stg refresh $@; }; f"; - list = "!f() { stg series $@; }; f"; - }; + clone1 = "clone --depth=1"; + des = "describe"; + wt = "worktree"; + mt = "mergetool"; + mt-code = "mergetool --tool=code"; + mt-cursor = "mergetool --tool=cursor"; + bi = "bisect"; + rp = "rev-parse"; + rl = "rev-list"; + rn = "name-rev"; + rb = "rebase"; + rbk = "rebase --skip"; + rbc = "rebase --continue"; + rba = "rebase --abort"; + rbi = "rebase -i"; + # autosquash previous fixup! commits + close-fixup = "!git rebase -i --autosquash --autostash"; + "re3" = "rerere"; + latest-tag = "describe --tags"; + alias = "! git config --get-regexp '^alias\\.' | sed 's/^alias\\.//' | fzf"; + ignore = "!gi() { curl -sL https://www.gitignore.io/api/$@ ;}; gi"; + config-fetch-origin = ''config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"''; + clone-bare = ''!f() { git clone --bare $@ && cd $@ && git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"; }; f''; + ahead = "rev-list --left-right --count"; + # count commit diff between two branches + commit-diff-count = ''!f() { git rev-list --count HEAD ^$1; }; f''; + # create feat branch in format of feat/YYYYMMDD-short-description, also accept other git arguments + br-feat = "!f() { git checkout -b feat/$(date +%Y%m)-$1 $2; }; f"; + br-fix = "!f() { git checkout -b fix/$(date +%Y%m)-$1 $2; }; f"; + br-refactor = "!f() { git checkout -b refactor/$(date +%Y%m)-$1 $2; }; f"; + # sync and rebase, for example: git sync-rebase origin master do: git fetch origin master && git rebase origin/master + sync-rebase = "!f() { git fetch $1 $2 && git rebase $1/$2; }; f"; + # commit convention + it-wip = ''!f() { git commit -m "wip: [skip ci] $([[ -z $@ ]] && date || echo $@ )"; }; f''; + it-fix = ''!f() { git commit -m "fix: $(echo $@)"; }; f''; + it-fmt = ''!f() { git commit -m "style: $(echo $@)"; }; f''; + it-test = ''!f() { git commit -m "test: $(echo $@)"; }; f''; + it-ref = ''!f() { git commit -m "refactor: $(echo $@)"; }; f''; + it-doc = ''!f() { git commit -m "doc: $(echo $@)"; }; f''; + it-feat = ''!f() { git commit -m "feat: $(echo $@)"; }; f''; + it-perf = ''!f() { git commit -m "perf: $(echo $@)"; }; f''; + it-chore = ''!f() { git commit -m "chore: $(echo $@)"; }; f''; + it-revert = ''!f() { git commit -m "revert: $(echo $@)"; }; f''; + it-build = ''!f() { git commit -m "build: $(echo $@)"; }; f''; + it-ci = ''!f() { git commit -m "ci: $(echo $@)"; }; f''; + it-skip = ''!f() { git commit -m "[skip ci]: $(echo $@)"; }; f''; + it-deps = ''!f() { git commit -m "deps: $(echo $@)"; }; f''; + it-rm = ''!f() { git commit -m "cleanup: $(echo $@)"; }; f''; + }; extraConfig = { user = { @@ -271,43 +264,42 @@ in options = { kanagawa-dragon = { dark = true; - green = "#7aa89f"; - greenDarker = "#6998cc"; - red = "#990017"; - line-numbers-right-style = "green"; + green = "#b7d0ae"; + darkgreen = "#6f894e"; + red = "#d9a594"; + darkred = "#e82424"; file-style = ''blue bold''; - line-numbers-minus-style = "red normal"; - line-numbers-plus-style = "green normal"; - line-numbers-zero-style = "blue normal"; - minus-style = "bold red"; - minus-emph-style = "bold darkred"; - minus-non-emph-style = "bold"; - plus-style = "bold green"; - plus-emph-style = "bold darkgreen"; - plus-non-emph-style = "bold"; + minus-style = "kanagawa-dragon.red"; + minus-emph-style = "kanagawa-dragon.darkred bold italic"; + minus-non-emph-style = "normal"; + plus-style = "kanagawa-dragon.green"; + plus-emph-style = "kanagawa-dragon.darkgreen bold italic"; + plus-non-emph-style = "normal"; zero-style = "syntax"; blame-code-style = "syntax"; }; dark = true; - # allow easy copy - side-by-side = true; + side-by-side = false; keep-plus-minus-markers = false; syntax-theme = "none"; file-decoration-style = "blue box"; hunk-header-decoration-style = "blue ul"; - line-numbers = true; - line-numbers-left-format = "{nm:>4} "; - line-numbers-right-format = "│ {np:>4} "; + line-numbers = false; + line-numbers-left-format = "{nm:>4} │"; + line-numbers-right-format = "{np:>4} │"; navigate = true; + tabs = 4; features = "kanagawa-dragon"; hyperlinks = true; diff-stat-align-width = 48; wrap-left-symbol = "↵"; wrap-right-symbol = "↴"; wrap-right-prefix-symbol = "…"; - hunk-label = " 󰡏 "; - wrap-max-lines = 2; - wrap-right-percent = "37.0"; + hunk-label = "󰡏 "; + hunk-header-style = "file line-number syntax"; + file-style = "omit"; + wrap-max-lines = 3; + wrap-right-percent = 1; }; }; diff --git a/nix/hm/jj.nix b/nix/hm/jj.nix index 741b44aa..8d02aa21 100644 --- a/nix/hm/jj.nix +++ b/nix/hm/jj.nix @@ -175,6 +175,15 @@ in sq = [ "squash" ]; + mv-changes = [ + "squash" + "-k" + "-u" + ]; + new-node = [ + "new" + "--no-edit" + ]; usq = [ "unsquash" ]; @@ -193,10 +202,11 @@ in }; default-command = [ - "log" - "--no-pager" - "-n" - "5" + "status" + # "log" + # "--no-pager" + # "-n" + # "5" ]; # diff.tool = [ # "${lib.getExe pkgs.difftastic}" diff --git a/nix/hm/lazygit.nix b/nix/hm/lazygit.nix index e8ddf72b..5f627ccc 100644 --- a/nix/hm/lazygit.nix +++ b/nix/hm/lazygit.nix @@ -39,8 +39,8 @@ autoRefresh = true; fetchAll = false; paging = { - colorArg = "always"; - externalDiffCommand = "difft --color=always"; + # colorArg = "always"; + # externalDiffCommand = "difft --color=always"; }; }; update = { diff --git a/nix/hm/shared.nix b/nix/hm/shared.nix index 23216e02..d619804d 100644 --- a/nix/hm/shared.nix +++ b/nix/hm/shared.nix @@ -58,6 +58,7 @@ in # ocamlPackages.ocaml-lsp asdf-vm docker-credential-helpers + # harper uv neofetch ]) diff --git a/nix/home.nix b/nix/home.nix index bbd88666..f299187e 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -150,13 +150,13 @@ in # ./hm/alacritty.nix # ./hm/wezterm.nix ./hm/kitty.nix - ./hm/zellij.nix + # ./hm/zellij.nix ./hm/rust.nix # ./hm/go.nix ./hm/skhd.nix ./hm/yabai.nix ./hm/dark-mode-notify.nix - ./hm/lazygit.nix + # ./hm/lazygit.nix ./hm/jj.nix ./hm/autoraise.nix ];