From 33abae2b6e1e658cb97cd7c532775fff770ede12 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sun, 17 Mar 2024 20:30:34 +0000 Subject: [PATCH] feat: upgrade kickstart.nvim --- Dockerfile | 2 +- patch/kickstart.nvim/updates.patch | 119 ++++++++++++++++------------- 2 files changed, 69 insertions(+), 52 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6411122..bdd8d76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -169,7 +169,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 e6710a461ab08513af80c213929ff64e75b5e456 \ + && git reset --hard ea4335f5af2fabbf063f8bf946f05583f215f904 \ && git apply /tmp/updates.patch \ && cp /tmp/init.lua ${XDG_CONFIG_HOME}/nvim/lua/custom/plugins \ && nvim --headless "+Lazy! sync" +qa diff --git a/patch/kickstart.nvim/updates.patch b/patch/kickstart.nvim/updates.patch index 1f5dfc0..c4bff39 100644 --- a/patch/kickstart.nvim/updates.patch +++ b/patch/kickstart.nvim/updates.patch @@ -1,22 +1,31 @@ diff --git a/init.lua b/init.lua -index 292ec07..284e1dc 100644 +index 506bbaf..b8d0561 100644 --- a/init.lua +++ b/init.lua -@@ -101,8 +101,12 @@ vim.opt.number = true - -- Experiment for yourself to see if you like it! - -- vim.opt.relativenumber = true +@@ -91,7 +91,7 @@ vim.g.mapleader = ' ' + vim.g.maplocalleader = ' ' -+-- Make relative line numbers default -+vim.wo.number = true -+vim.wo.relativenumber = true -+ - -- Enable mouse mode, can be useful for resizing splits for example! + -- Set to true if you have a Nerd Font installed +-vim.g.have_nerd_font = false ++vim.g.have_nerd_font = true + + -- [[ Setting options ]] + -- See `:help vim.opt` +@@ -102,10 +102,10 @@ vim.g.have_nerd_font = false + vim.opt.number = true + -- You can also add relative line numbers, for help with jumping. + -- Experiment for yourself to see if you like it! +--- vim.opt.relativenumber = true ++vim.opt.relativenumber = true + +--- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' ++-- Disable mouse mode +vim.opt.mouse = '' -- Don't show the mode, since it's already in status line vim.opt.showmode = false -@@ -148,6 +152,14 @@ vim.opt.cursorline = true +@@ -154,6 +154,14 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 @@ -31,7 +40,7 @@ index 292ec07..284e1dc 100644 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` -@@ -249,6 +261,66 @@ require('lazy').setup { +@@ -255,6 +263,66 @@ require('lazy').setup({ topdelete = { text = '‾' }, changedelete = { text = '~' }, }, @@ -98,7 +107,15 @@ index 292ec07..284e1dc 100644 }, }, -@@ -544,6 +616,18 @@ require('lazy').setup { +@@ -283,6 +351,7 @@ require('lazy').setup({ + require('which-key').register { + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, ++ ['h'] = { name = 'Git [h]unk', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, +@@ -552,6 +621,18 @@ require('lazy').setup({ -- tsserver = {}, -- @@ -117,7 +134,7 @@ index 292ec07..284e1dc 100644 lua_ls = { -- cmd = {...}, -- filetypes { ...}, -@@ -570,6 +654,10 @@ require('lazy').setup { +@@ -566,6 +647,10 @@ require('lazy').setup({ }, }, }, @@ -128,7 +145,7 @@ index 292ec07..284e1dc 100644 } -- Ensure the servers and tools above are installed -@@ -596,6 +684,21 @@ require('lazy').setup { +@@ -592,6 +677,21 @@ require('lazy').setup({ -- by the server configuration above. Useful when disabling -- certain features of an LSP (for example, turning off formatting for tsserver) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) @@ -150,40 +167,40 @@ index 292ec07..284e1dc 100644 require('lspconfig')[server_name].setup(server) end, }, -@@ -781,7 +884,31 @@ require('lazy').setup { - - ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup { -- ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, -+ ensure_installed = { -+ 'css', -+ 'dockerfile', -+ 'eex', -+ 'elixir', -+ 'erlang', -+ 'gitcommit', -+ 'go', -+ 'heex', -+ 'html', -+ 'http', -+ 'javascript', -+ 'json', -+ 'lua', -+ 'markdown', -+ 'markdown_inline', -+ 'python', -+ 'sql', -+ 'toml', -+ 'tsx', -+ 'typescript', -+ 'vim', -+ 'vimdoc', -+ 'yaml', -+ }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { enable = true }, -@@ -807,14 +934,14 @@ require('lazy').setup { +@@ -793,7 +893,31 @@ require('lazy').setup({ + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + opts = { +- ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, ++ ensure_installed = { ++ 'css', ++ 'dockerfile', ++ 'eex', ++ 'elixir', ++ 'erlang', ++ 'gitcommit', ++ 'go', ++ 'heex', ++ 'html', ++ 'http', ++ 'javascript', ++ 'json', ++ 'lua', ++ 'markdown', ++ 'markdown_inline', ++ 'python', ++ 'sql', ++ 'toml', ++ 'tsx', ++ 'typescript', ++ 'vim', ++ 'vimdoc', ++ 'yaml', ++ }, + -- Autoinstall languages that are not installed + auto_install = true, + highlight = { +@@ -830,14 +954,14 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', @@ -197,6 +214,6 @@ index 292ec07..284e1dc 100644 -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, - } - - -- The line beneath this is called `modeline`. See `:help modeline` + }, { + ui = { + -- If you have a Nerd Font, set icons to an empty table which will use the