From d8aa29893ea0a2284459b496fb51f5d31e21b407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Dubas?= Date: Mon, 12 Feb 2024 23:51:30 +0000 Subject: [PATCH] feat: upgrade kickstart.nvim to latest commit (#28) Also, fix an issue with the dry run patch target and improve the setup of different LSPs for elixir. Reviewed-on: https://gitea.dubas.dev/joao.dubas/ide/pulls/28 --- Dockerfile | 2 +- Makefile | 2 +- patch/kickstart.nvim/updates.patch | 36 +++++++++++++++++------------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3cbc9bf..df0c1d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -158,7 +158,7 @@ COPY ./patch/kickstart.nvim/updates.patch /tmp COPY ./config/nvim/lua/custom/plugins/init.lua /tmp RUN git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME}"/nvim \ && cd ${XDG_CONFIG_HOME}/nvim \ - && git reset --hard b11581491671ed49b1dfdb1ea777932ade7ff2e5 \ + && git reset --hard 7af594fd319fbae6b2aaa06337f3df8acbbb7f18 \ && git apply /tmp/updates.patch \ && cp /tmp/init.lua ${XDG_CONFIG_HOME}/nvim/lua/custom/plugins \ && nvim --headless "+Lazy! sync" +qa diff --git a/Makefile b/Makefile index 3aaea92..3e25d2b 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ patch_init_lua: ## create a patch file with the changes made in kickstart's init .PHONY: patch_init_lua_dry_run patch_init_lua_dry_run: ## show the changes made in kickstart's init.lua file - @cd $(neovim_config_dir) && git --patch init.lua + @cd $(neovim_config_dir) && git diff --patch init.lua .PHONY: help help: ## show help message diff --git a/patch/kickstart.nvim/updates.patch b/patch/kickstart.nvim/updates.patch index 91e9eb5..fafed8c 100644 --- a/patch/kickstart.nvim/updates.patch +++ b/patch/kickstart.nvim/updates.patch @@ -1,8 +1,8 @@ diff --git a/init.lua b/init.lua -index 6c6ae02..233e6b1 100644 +index fd4567d..236fb97 100644 --- a/init.lua +++ b/init.lua -@@ -189,19 +189,19 @@ require('lazy').setup({ +@@ -200,19 +200,19 @@ require('lazy').setup({ }, }, @@ -35,7 +35,7 @@ index 6c6ae02..233e6b1 100644 { -- Set lualine as statusline -@@ -271,7 +271,7 @@ require('lazy').setup({ +@@ -282,7 +282,7 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins @@ -44,7 +44,7 @@ index 6c6ae02..233e6b1 100644 }, {}) -- [[ Setting options ]] -@@ -281,11 +281,12 @@ require('lazy').setup({ +@@ -292,11 +292,12 @@ require('lazy').setup({ -- Set highlight on search vim.o.hlsearch = false @@ -60,7 +60,7 @@ index 6c6ae02..233e6b1 100644 -- Sync clipboard between OS and Neovim. -- Remove this option if you want your OS clipboard to remain independent. -@@ -315,6 +316,14 @@ vim.o.completeopt = 'menuone,noselect' +@@ -326,6 +327,14 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true @@ -75,7 +75,7 @@ index 6c6ae02..233e6b1 100644 -- [[ Basic Keymaps ]] -- Keymaps for better default experience -@@ -428,8 +437,31 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = +@@ -439,8 +448,31 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter @@ -109,7 +109,7 @@ index 6c6ae02..233e6b1 100644 -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, -- Install languages synchronously (only applied to `ensure_installed`) -@@ -573,13 +605,16 @@ require('mason-lspconfig').setup() +@@ -586,13 +618,18 @@ require('mason-lspconfig').setup() -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. local servers = { @@ -129,20 +129,24 @@ index 6c6ae02..233e6b1 100644 + } + }, + gopls = {}, ++ helm_ls = {}, + html = { filetypes = { 'html', 'twig', 'hbs'} }, ++ htmx = {}, lua_ls = { Lua = { workspace = { checkThirdParty = false }, -@@ -588,6 +623,8 @@ local servers = { +@@ -601,6 +638,10 @@ local servers = { -- diagnostics = { disable = { 'missing-fields' } }, }, }, + pyright = {}, ++ templ = {}, ++ terraformls = {}, + tsserver = {}, } -- Setup neovim lua configuration -@@ -606,12 +643,23 @@ mason_lspconfig.setup { +@@ -619,12 +660,25 @@ mason_lspconfig.setup { mason_lspconfig.setup_handlers { function(server_name) @@ -155,12 +159,14 @@ index 6c6ae02..233e6b1 100644 } + if server_name == 'elixirls' then + local version = vim.fn.system('mise current elixir') or '' -+ local match_version_111 = string.match(version, '^1.11') -+ local match_version_112 = string.match(version, '^1.12') -+ if match_version_111 ~= nil then -+ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. '/elixir-ls/release/v0.12.0/language_server.sh' } }) -+ elseif match_version_112 ~= nil then -+ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. '/elixir-ls/release/v0.14.6/language_server.sh' } }) ++ local elixir_servers = { ++ { version = '^1.11', path = '/elixir-ls/release/v0.12.0/language_server.sh' }, ++ { version = '^1.12', path = '/elixir-ls/release/v0.14.6/language_server.sh' }, ++ } ++ for _, server in ipairs(elixir_servers) do ++ if string.match(version, server.version) == nil then goto continue end ++ opts = vim.tbl_extend('keep', opts, { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. server.path } }) ++ ::continue:: + end + end + require('lspconfig')[server_name].setup(opts)