commit 0ae854867ca7409ef0ed80cbe9c59f824aba3c55
parent 44a34bf73ee1826b263158b34ff647230e14d5c8
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sun, 10 Aug 2025 14:34:55 +0200
parent 44a34bf73ee1826b263158b34ff647230e14d5c8
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sun, 10 Aug 2025 14:34:55 +0200
config/home-manager/zaphyra/programs/micro: add some plugins and configure them
1 file changed, 63 insertions(+), 1 deletion(-)
M
|
64
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
diff --git a/config/home-manager/zaphyra/programs/micro.nix b/config/home-manager/zaphyra/programs/micro.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, ... }: +{ + config, + systemConfig, + pkgs, + lib, + ... +}: { @@ -9,6 +15,8 @@ programs.micro = { enable = true; + package = + if systemConfig.modules.presets.graphical.enable then pkgs.micro-with-wl-clipboard else pkgs.micro; settings = { "*.nix".tabstospaces = true; "*.nix".tabmovement = true; @@ -25,6 +33,60 @@ ignorecase = true; savehistory = false; + + "lsp.formatOnSave" = true; + "lsp.tabcompletion" = true; + "lsp.autocompleteDetails" = false; + "lsp.server" = if systemConfig.modules.presets.graphical.enable != true then "" else ( + lib.concatMapAttrsStringSep "," + ( + name: value: + lib.concatStringsSep "=" ( + [ + name + value.command + ] + ++ (lib.optionals (lib.hasAttr "options" value) [ + (builtins.toJSON (value.options)) + ]) + ) + ) + { + js.command = lib.getExe pkgs.typescript-language-server; + nim.command = lib.getExe pkgs.nimlangserver; + go.command = lib.getExe pkgs.gopls; + nix.command = lib.getExe pkgs.nixd; + nix.options = { + config = builtins.toJSON { + formatting.command = [ (lib.getExe pkgs.nixfmt-rfc-style) ]; + }; + }; + } + ); + }; + }; + + # plugins + home.file = { + "${config.xdg.configHome}/micro/plug/lsp".source = pkgs.fetchFromGitHub { + owner = "AndCake"; + repo = "micro-plugin-lsp"; + rev = "v0.6.3"; + sha256 = "sha256-rZ9Vw9WPGNaJBGHKU40F6cBIYQ1JFtSKPDrheazKkPY="; + }; + + "${config.xdg.configHome}/micro/plug/detectindent".source = pkgs.fetchFromGitHub { + owner = "dmaluka"; + repo = "micro-detectindent"; + rev = "v1.1.0"; + sha256 = "sha256-5bKEkOnhz0pyBR2UNw5vvYiTtpd96fBPTYW9jnETvq4="; + }; + + "${config.xdg.configHome}/micro/plug/wc".source = pkgs.fetchFromGitHub { + owner = "adamnpeace"; + repo = "micro-wc-plugin"; + rev = "b2c9957e521770eadc1ecae9d54c0a30f40a0a3d"; + sha256 = "sha256-Z6MC2cet8+7XHv41G+SlAZViCqlh/9dk0CSt7HklnTg="; }; };