diff --git a/config/default.nix b/config/default.nix index a894c07..0cb0312 100644 --- a/config/default.nix +++ b/config/default.nix @@ -15,7 +15,7 @@ ./lualine.nix ./neo-tree.nix ./nvim-cmp.nix - # ./project.nix + ./project.nix ./rainbow-delimiters.nix ./telescope.nix ./toggleterm.nix diff --git a/config/lsp/conform.nix b/config/lsp/conform.nix deleted file mode 100644 index 4a459b6..0000000 --- a/config/lsp/conform.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ helpers, pkgs, ... }: { - plugins.conform-nvim = { - enable = true; - formatAfterSave = '' - { - format_after_save = { - lsp_format = "fallback", - }, - } - ''; - formattersByFt = { - python = [ "black" ]; - c = [ "clang-format" ]; - cpp = [ "clang-format" ]; - cmake = [ "cmake_format" ]; - nix = [ "nixfmt" ]; - # Standalone scalafmt is too slow, so we use it as a fallback - scala = helpers.mkRaw '' - { scalafmt, lsp_format = "prefer" } - ''; - toml = [ "taplo" ]; - yaml = [ "yq" ]; - json = [ "jq" ]; - }; - }; - - extraPackages = with pkgs; [ - black - clang-tools - cmake-format - jq - nixfmt-rfc-style - scalafmt - taplo - yq - ]; -} diff --git a/config/lsp/default.nix b/config/lsp/default.nix index 4bda908..5ea86d0 100644 --- a/config/lsp/default.nix +++ b/config/lsp/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./conform.nix ./lsp.nix ./lsp-format.nix ./lspkind.nix diff --git a/config/lsp/lsp.nix b/config/lsp/lsp.nix index e3058cf..1b2061d 100644 --- a/config/lsp/lsp.nix +++ b/config/lsp/lsp.nix @@ -1,4 +1,4 @@ -{ pkgs, helpers, ... }: +{ helpers, ... }: { plugins.lsp = { @@ -69,14 +69,6 @@ }; }; }; - onAttach = '' - require("lsp_signature").on_attach({ - bind = true, - handler_opts = { - border = "rounded" - }; - }, bufnr) - ''; }; keymaps = [ @@ -93,20 +85,4 @@ }; } ]; - - extraConfigLua = '' - require("lspconfig").asm_lsp.setup { - filetypes = { "asm", "s", "S" } - } - require("lspconfig").verible.setup { } - ''; - - extraPlugins = with pkgs.vimPlugins; [ - lsp_signature-nvim - ]; - - extraPackages = with pkgs; [ - asm-lsp - verible - ]; } diff --git a/config/lsp/nvim-metals.nix b/config/lsp/nvim-metals.nix index fa8e983..ddb8077 100644 --- a/config/lsp/nvim-metals.nix +++ b/config/lsp/nvim-metals.nix @@ -8,28 +8,12 @@ extraPackages = [ pkgs.metals - pkgs.scalafmt ]; autoGroups.nvim_metals_group = { clear = true; }; - extraConfigLua = '' - metals_config = require("metals").bare_config() - metals_config.init_options.statusBarProvider = "off" - metals_config.settings = { - showInferredType = true, - showImplicitArguments = false, - showImplicitConversionsAndClasses = false, - metalsBinaryPath = "${pkgs.lib.getExe pkgs.metals}", - excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, - useGlobalExecutable = true, - verboseCompilation = true - } - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() - ''; - autoCmd = [ { event = "FileType"; @@ -37,10 +21,18 @@ desc = "Initialize nvim-metals"; callback = helpers.mkRaw '' function() + metals_config = require("metals").bare_config() + metals_config.init_options.statusBarProvider = "off" + metals_config.settings = { + showInferredType = true, + showImplicitArguments = false, + showImplicitConversionsAndClasses = false, + metalsBinaryPath = "${pkgs.lib.getExe pkgs.metals}", + useGlobalExecutable = true + } require("metals").initialize_or_attach(metals_config) end ''; - pattern = [ "scala" "sbt" ]; } ]; diff --git a/config/project.nix b/config/project.nix index 3f73680..3930ecf 100644 --- a/config/project.nix +++ b/config/project.nix @@ -5,7 +5,7 @@ enable = true; enableTelescope = true; silentChdir = false; - manualMode = true; + scopeChdir = "tab"; }; autoGroups.project_nvim_group = {