From 60eec41447535f9b6f289040b5038c4bd99c4d17 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 25 Jun 2024 09:24:27 +0200 Subject: [PATCH] nvim: use otter --- home/config/nvim/plugins/cmp.fnl | 3 ++- home/config/nvim/plugins/otter.fnl | 14 ++++++++++++++ home/programs/nvim/default.nix | 7 +++++++ home/programs/nvim/plugins.nix | 17 ++++++++++++++--- home/programs/nvim/plugins.yaml | 1 + 5 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 home/config/nvim/plugins/otter.fnl diff --git a/home/config/nvim/plugins/cmp.fnl b/home/config/nvim/plugins/cmp.fnl index 4856433..dcdefa5 100644 --- a/home/config/nvim/plugins/cmp.fnl +++ b/home/config/nvim/plugins/cmp.fnl @@ -6,7 +6,8 @@ (let [maybe-tabnine (if (pcall require :cmp_tabnine.config) [{:name :cmp_tabnine}] [])] - (vim.list_extend (vim.list_extend [{:name :nvim_lsp}] maybe-tabnine) + (vim.list_extend (vim.list_extend [{:name :nvim_lsp} {:name :otter}] + maybe-tabnine) [{:name :async_path} {:name :luasnip}]))) (fn comparator-list [] diff --git a/home/config/nvim/plugins/otter.fnl b/home/config/nvim/plugins/otter.fnl new file mode 100644 index 0000000..4d95ec3 --- /dev/null +++ b/home/config/nvim/plugins/otter.fnl @@ -0,0 +1,14 @@ +(let [otter (require :otter) + languages [:bash :lua] + completion true + diagnostics true + tsquery nil + enabled-filetypes [:elixir :nix] + augroup (vim.api.nvim_create_augroup :NifocOtter {:clear true}) + aucmd vim.api.nvim_create_autocmd] + (each [_ ft (pairs enabled-filetypes)] + (aucmd :FileType {:pattern ft + :callback #(otter.activate languages completion + diagnostics tsquery) + :group augroup + :desc "Setup Otter"}))) diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 54f725f..0783e92 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -32,6 +32,7 @@ in elixir-ls fennel-ls #lexical + lua-language-server nil nodePackages.dockerfile-language-server-nodejs nodePackages.svelte-language-server @@ -162,6 +163,12 @@ in type = "fennel"; } + { + plugin = otter-nvim; + config = builtins.readFile ../../config/nvim/plugins/otter.fnl; + type = "fennel"; + } + # Linter { plugin = nvim-lint; diff --git a/home/programs/nvim/plugins.nix b/home/programs/nvim/plugins.nix index c212059..84f470e 100644 --- a/home/programs/nvim/plugins.nix +++ b/home/programs/nvim/plugins.nix @@ -40,7 +40,7 @@ in }; wezterm-nvim = buildVimPlugin { pname = "wezterm.nvim"; - version = "2024-06-01"; + version = "2024-06-02"; src = fetchFromGitHub { owner = "willothy"; repo = "wezterm.nvim"; @@ -128,7 +128,7 @@ in }; rainbow-delimiters-nvim = buildVimPlugin { pname = "rainbow-delimiters.nvim"; - version = "2024-06-13"; + version = "2024-06-14"; src = fetchFromGitHub { owner = "HiPhish"; repo = "rainbow-delimiters.nvim"; @@ -247,6 +247,17 @@ in fetchSubmodules = false; }; }; + otter-nvim = buildVimPlugin { + pname = "otter.nvim"; + version = "2024-06-09"; + src = fetchFromGitHub { + owner = "jmbuhr"; + repo = "otter.nvim"; + rev = "cbb1be0586eae18cbea38ada46af428d2bebf81a"; + sha256 = "085lx5z7abbn7rq23pma5xmymzgjajp0slg0g42wafxpn7rby9kv"; + fetchSubmodules = false; + }; + }; nvim-lint = buildVimPlugin { pname = "nvim-lint"; version = "2024-06-07"; @@ -370,7 +381,7 @@ in }; nvim-autopairs = buildVimPlugin { pname = "nvim-autopairs"; - version = "2024-05-19"; + version = "2024-05-20"; src = fetchFromGitHub { owner = "windwp"; repo = "nvim-autopairs"; diff --git a/home/programs/nvim/plugins.yaml b/home/programs/nvim/plugins.yaml index bbadb27..0a71938 100644 --- a/home/programs/nvim/plugins.yaml +++ b/home/programs/nvim/plugins.yaml @@ -26,6 +26,7 @@ - src: onsails/lspkind.nvim - src: SmiteshP/nvim-navic - src: RRethy/vim-illuminate +- src: jmbuhr/otter.nvim # Linter - src: mfussenegger/nvim-lint # Comments