From 206970723893ecdc5f2801f56058252035d7f330 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Wed, 20 Mar 2024 16:58:03 -0500 Subject: [PATCH] added a few tools, including carapace completer. --- nix/home.nix | 18 ++++++++++------ nix/justfile | 3 --- nix/nushell/config.nu | 36 ++++++++++++++++---------------- nix/nushell/nushell.nix | 1 + nix/nvim/lsp/lsp.nix | 46 ++++++++++++++++++++--------------------- nix/zsh.nix | 1 + 6 files changed, 55 insertions(+), 50 deletions(-) diff --git a/nix/home.nix b/nix/home.nix index ffea625..60763dc 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -14,6 +14,8 @@ home.packages = with pkgs; [ zellij sshfs + just + espeak ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -36,7 +38,6 @@ home.shellAliases = { say = "espeak -p 10 -s 150 -a 200"; - tmux = "tmux -u"; pdfmk = "latexmk -lualatex -pvc"; doc2pdf = "loffice --convert-to-pdf --headless *.docx"; sshmnt = "sshfs -o idmap=user,compression=no,reconnect,follow_symlinks,dir_cache=yes,ServerAliveInterval=15"; @@ -50,11 +51,16 @@ ./nvim/nvim.nix ]; - programs.yazi.enable = true; - - programs.zoxide.enable = true; - - programs.fzf.enable = true; + programs = { + yazi.enable = true; + zoxide.enable = true; + fzf.enable = true; + ripgrep.enable = true; + bat.enable = true; + tealdeer.enable = true; + btop.enable = true; + carapace.enable = true; + }; services.ssh-agent.enable = true; diff --git a/nix/justfile b/nix/justfile index 0228ac3..e932fba 100644 --- a/nix/justfile +++ b/nix/justfile @@ -3,6 +3,3 @@ switch: bootstrap: nix run --extra-experimental-features "nix-command flakes" --no-write-lock-file github:nix-community/home-manager/ -- --extra-experimental-features "nix-command flakes" --flake . switch - -check: - home-manager --flake . build diff --git a/nix/nushell/config.nu b/nix/nushell/config.nu index 9aa3c17..33aca84 100644 --- a/nix/nushell/config.nu +++ b/nix/nushell/config.nu @@ -136,24 +136,24 @@ let light_theme = { shape_vardecl: purple } -let fish_completer = {|spans| - fish --command $'complete "--do-complete=($spans | str join " ")"' - | $"value(char tab)description(char newline)" + $in - | from tsv --flexible --no-infer -} - -let carapace_completer = {|spans: list| - carapace $spans.0 nushell ...$spans - | from json - | if ($in | default [] | where value =~ '^-.*ERR$' | is-empty) { $in } else { null } -} - -let zoxide_completer = {|spans| - $spans | skip 1 | zoxide query -l $in | lines | where {|x| $x != $env.PWD} -} - -# This completer will use carapace by default -let external_completer = $fish_completer +# let fish_completer = {|spans| +# fish --command $'complete "--do-complete=($spans | str join " ")"' +# | $"value(char tab)description(char newline)" + $in +# | from tsv --flexible --no-infer +# } +# +# let carapace_completer = {|spans: list| +# carapace $spans.0 nushell ...$spans +# | from json +# | if ($in | default [] | where value =~ '^-.*ERR$' | is-empty) { $in } else { null } +# } +# +# let zoxide_completer = {|spans| +# $spans | skip 1 | zoxide query -l $in | lines | where {|x| $x != $env.PWD} +# } +# +# # This completer will use carapace by default +let external_completer = null # The default config record. This is where much of your global configuration is setup. $env.config = { show_banner: true # true or false to enable or disable the welcome banner at startup diff --git a/nix/nushell/nushell.nix b/nix/nushell/nushell.nix index 8a66a80..c7f6bd4 100644 --- a/nix/nushell/nushell.nix +++ b/nix/nushell/nushell.nix @@ -17,4 +17,5 @@ programs.yazi.enableNushellIntegration = true; programs.zoxide.enableNushellIntegration = true; programs.starship.enableNushellIntegration = true; + programs.carapace.enableNushellIntegration = true; } diff --git a/nix/nvim/lsp/lsp.nix b/nix/nvim/lsp/lsp.nix index a8bde56..482c69e 100644 --- a/nix/nvim/lsp/lsp.nix +++ b/nix/nvim/lsp/lsp.nix @@ -4,32 +4,32 @@ ... }: { programs.nixvim = { - plugins.lsp={ - enable=true; - servers={ - bashls.enable=true; - clangd.enable=true; - lua-ls.enable=true; - nil_ls.enable=true; - nushell.enable=true; - pyright.enable=true; - ruff-lsp.enable=true; - rust-analyzer={ - enable=true; - installCargo=true; - installRustc=true; + plugins.lsp = { + enable = true; + servers = { + bashls.enable = true; + clangd.enable = true; + lua-ls.enable = true; + nil_ls.enable = true; + nushell.enable = true; + pyright.enable = true; + ruff-lsp.enable = true; + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; }; - texlab.enable=true; - typst-lsp.enable=true; - taplo.enable=true; - yamlls.enable=true; - marksman.enable=true; - jsonls.enable=true; - hls.enable=true; + texlab.enable = true; + typst-lsp.enable = true; + taplo.enable = true; + yamlls.enable = true; + marksman.enable = true; + jsonls.enable = true; + hls.enable = true; }; }; - plugins.cmp.settings.sources=[ - {name="nvim_lsp";} + plugins.cmp.settings.sources = [ + {name = "nvim_lsp";} ]; plugins.which-key.registrations = { "l" = "+lsp"; diff --git a/nix/zsh.nix b/nix/zsh.nix index de58f58..38f35c3 100644 --- a/nix/zsh.nix +++ b/nix/zsh.nix @@ -7,6 +7,7 @@ programs.fzf.enableZshIntegration = true; programs.zoxide.enableZshIntegration = true; programs.yazi.enableZshIntegration = true; + programs.carapace.enableZshIntegration = true; programs.zsh = { enable = true; enableCompletion = true;