From 2981a118ae620c9614bf5733cd6c8b90ee7be2e8 Mon Sep 17 00:00:00 2001 From: 4o1x5 <4o1x5@4o1x5.dev> Date: Thu, 19 Dec 2024 19:16:51 +0100 Subject: [PATCH] Lps: added lsp and formatter for protobuf - added lsp and formatter for lua --- config/plugins/lang/default.nix | 2 ++ config/plugins/lang/lua.nix | 23 +++++++++++++++++++++++ config/plugins/lang/protobuf.nix | 23 +++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 config/plugins/lang/lua.nix create mode 100644 config/plugins/lang/protobuf.nix diff --git a/config/plugins/lang/default.nix b/config/plugins/lang/default.nix index 2d2a478..0e9aeaa 100644 --- a/config/plugins/lang/default.nix +++ b/config/plugins/lang/default.nix @@ -6,7 +6,9 @@ ./docker.nix ./html.nix ./json.nix + ./lua.nix ./nix.nix + ./protobuf.nix ./rust.nix ./ts.nix ./yaml.nix diff --git a/config/plugins/lang/lua.nix b/config/plugins/lang/lua.nix new file mode 100644 index 0000000..1c1556d --- /dev/null +++ b/config/plugins/lang/lua.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + plugins = { + lsp.servers.lua_ls.enable = true; + + conform-nvim.settings = { + formatters_by_ft = { + lua = [ "stylua" ]; + }; + + formatters = { + stylua = { + command = "${pkgs.stylua}/bin/stylua"; + }; + }; + }; + + lint = { + lintersByFt.lua = [ "luacheck" ]; + linters.luacheck.cmd = "${pkgs.lua54Packages.luacheck}/bin/luacheck"; + }; + }; +} diff --git a/config/plugins/lang/protobuf.nix b/config/plugins/lang/protobuf.nix new file mode 100644 index 0000000..971b7b1 --- /dev/null +++ b/config/plugins/lang/protobuf.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + + # Enable language server for protbuf files (.proto) + plugins = { + lsp.servers.protols = { + enable = true; + }; + + lint = { + lintersByFt = { + protobuf = [ "protobuf" ]; + }; + + linters = { + protobuf = { + cmd = "${pkgs.protolint}/bin/protolint"; + }; + }; + }; + }; +} +