From c4bd15f7bbd5987dd5186fbbbdb49f40ea6b68a1 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 26 Oct 2023 09:46:39 -0500 Subject: [PATCH] Update helix, fix git autocomplete in fish --- flake.lock | 8 +-- flake.nix | 2 +- modules/home-manager/broot.nix | 96 +------------------------------- modules/home-manager/cargo.nix | 9 +++ modules/home-manager/common.nix | 1 + modules/home-manager/default.nix | 1 + modules/home-manager/git.nix | 17 +++--- modules/home-manager/helix.nix | 2 +- 8 files changed, 29 insertions(+), 107 deletions(-) create mode 100644 modules/home-manager/cargo.nix diff --git a/flake.lock b/flake.lock index 323fd5e..fa03511 100644 --- a/flake.lock +++ b/flake.lock @@ -143,17 +143,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1696295907, - "narHash": "sha256-GFeo5NpbFQjVeu2lv/B/pfZY/+SIt0KRHjh26s0bXAY=", + "lastModified": 1698251847, + "narHash": "sha256-JACu3mKrGJuViAoyNDHVDuHXwWkmibXxu6j0JOmNhT4=", "owner": "helix-editor", "repo": "helix", - "rev": "75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b", + "rev": "f6021dd0cdd8cf6795f024e396241cb0af2ca368", "type": "github" }, "original": { "owner": "helix-editor", + "ref": "23.10", "repo": "helix", - "rev": "75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b", "type": "github" } }, diff --git a/flake.nix b/flake.nix index c279c42..3e780b9 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager/master"; - helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b"; + helix.url = "github:helix-editor/helix/23.10"; disko.url = "github:nix-community/disko/master"; sops-nix.url = "github:Mic92/sops-nix"; hardware.url = "github:nixos/nixos-hardware"; diff --git a/modules/home-manager/broot.nix b/modules/home-manager/broot.nix index 5d0dfb9..d8a0bc5 100644 --- a/modules/home-manager/broot.nix +++ b/modules/home-manager/broot.nix @@ -1,101 +1,9 @@ -{colors, ...}: { +{...}: { programs.broot = { enable = true; enableFishIntegration = true; settings = { - modal = true; - skin = with colors.withHashPrefix; { - # this is a crappy copy of broot's catppuccin mocha theme - input = "ansi(1) none"; - selected_line = "${bg} ansi(4)"; - default = "rgb(205, 214, 244) none"; - tree = "rgb(108, 112, 134) none"; - parent = "rgb(116, 199, 236) none"; - file = "none none"; - - perm__ = "rgb(186, 194, 222) none"; - perm_r = "rgb(250, 179, 135) none"; - perm_w = "rgb(235, 160, 172) none"; - perm_x = "rgb(166, 227, 161) none"; - owner = "rgb(148, 226, 213) none"; - group = "rgb(137, 220, 235) none"; - - dates = "rgb(186, 194, 222) none"; - - directory = "rgb(180, 190, 254) none Bold"; - exe = "rgb(166, 227, 161) none"; - link = "rgb(249, 226, 175) none"; - pruning = "rgb(166, 173, 200) none Italic"; - - preview_title = "rgb(205, 214, 244) rgb(24, 24, 37)"; - preview = "rgb(205, 214, 244) rgb(24, 24, 37)"; - preview_line_number = "rgb(108, 112, 134) none"; - - char_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - content_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - preview_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - - count = "rgb(249, 226, 175) none"; - sparse = "rgb(243, 139, 168) none"; - content_extract = "rgb(243, 139, 168) none Italic"; - - git_branch = "rgb(250, 179, 135) none"; - git_insertions = "rgb(250, 179, 135) none"; - git_deletions = "rgb(250, 179, 135) none"; - git_status_current = "rgb(250, 179, 135) none"; - git_status_modified = "rgb(250, 179, 135) none"; - git_status_new = "rgb(250, 179, 135) none Bold"; - git_status_ignored = "rgb(250, 179, 135) none"; - git_status_conflicted = "rgb(250, 179, 135) none"; - git_status_other = "rgb(250, 179, 135) none"; - staging_area_title = "rgb(250, 179, 135) none"; - - flag_label = "rgb(243, 139, 168) none"; - flag_value = "rgb(243, 139, 168) none Bold"; - - status_normal = "none rgb(24, 24, 37)"; - status_italic = "rgb(243, 139, 168) rgb(24, 24, 37) Italic"; - status_bold = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - status_ellipsis = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - status_error = "rgb(205, 214, 244) rgb(243, 139, 168)"; - status_job = "rgb(235, 160, 172) rgb(40, 38, 37)"; - status_code = "rgb(235, 160, 172) rgb(24, 24, 37) Italic"; - mode_command_mark = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - - help_paragraph = "rgb(205, 214, 244) none"; - help_headers = "rgb(243, 139, 168) none Bold"; - help_bold = "rgb(250, 179, 135) none Bold"; - help_italic = "rgb(249, 226, 175) none Italic"; - help_code = "rgb(166, 227, 161) rgb(49, 50, 68)"; - help_table_border = "rgb(108, 112, 134) none"; - - hex_null = "rgb(205, 214, 244) none"; - hex_ascii_graphic = "rgb(250, 179, 135) none"; - hex_ascii_whitespace = "rgb(166, 227, 161) none"; - hex_ascii_other = "rgb(148, 226, 213) none"; - hex_non_ascii = "rgb(243, 139, 168) none"; - - file_error = "rgb(251, 73, 52) none"; - - purpose_normal = "none none"; - purpose_italic = "rgb(177, 98, 134) none Italic"; - purpose_bold = "rgb(177, 98, 134) none Bold"; - purpose_ellipsis = "none none"; - - scrollbar_track = "rgb(49, 50, 68) none"; - scrollbar_thumb = "rgb(88, 91, 112) none"; - - good_to_bad_0 = "rgb(166, 227, 161) none"; - good_to_bad_1 = "rgb(148, 226, 213) none"; - good_to_bad_2 = "rgb(137, 220, 235) none"; - good_to_bad_3 = "rgb(116, 199, 236) none"; - good_to_bad_4 = "rgb(137, 180, 250) none"; - good_to_bad_5 = "rgb(180, 190, 254) none"; - good_to_bad_6 = "rgb(203, 166, 247) none"; - good_to_bad_7 = "rgb(250, 179, 135) none"; - good_to_bad_8 = "rgb(235, 160, 172) none"; - good_to_bad_9 = "rgb(243, 139, 168) none"; - }; + modal = false; # vim mode? verbs = [ { diff --git a/modules/home-manager/cargo.nix b/modules/home-manager/cargo.nix new file mode 100644 index 0000000..0ad1c45 --- /dev/null +++ b/modules/home-manager/cargo.nix @@ -0,0 +1,9 @@ +{config, ...}: { + home.file."${config.xdg.configHome}/cargo/config.toml" = { + enable = true; + text = '' + [build] + rustdocflags = ["--default-theme=ayu"]; + ''; + }; +} diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix index a086ec5..89d5dce 100644 --- a/modules/home-manager/common.nix +++ b/modules/home-manager/common.nix @@ -17,6 +17,7 @@ iex zellij broot + cargo ]; # TODO: specify an email? diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 3d05e55..d758982 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -6,6 +6,7 @@ common = import ./common.nix; melee = import ./melee.nix; linux = import ./linux.nix; + cargo = import ./cargo.nix; macos = import ./macos.nix; iex = import ./iex.nix; mako = import ./mako.nix; diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix index 11712ee..a9f9d61 100644 --- a/modules/home-manager/git.nix +++ b/modules/home-manager/git.nix @@ -70,12 +70,15 @@ in { }; programs.fish.functions = { - g = '' - if test (count $argv) -gt 0 - git $argv - else - git status - end - ''; + g = { + wraps = "git"; + body = '' + if test (count $argv) -gt 0 + git $argv + else + git status + end + ''; + }; }; } diff --git a/modules/home-manager/helix.nix b/modules/home-manager/helix.nix index 3a69201..4241a08 100644 --- a/modules/home-manager/helix.nix +++ b/modules/home-manager/helix.nix @@ -164,7 +164,7 @@ editor = { soft-wrap.enable = true; - auto-pairs = false; + auto-pairs = true; auto-save = false; completion-trigger-len = 1; color-modes = false;