From 6f6f38a6b5059787d8d92b313f6e1b2c722389b0 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 2 May 2024 22:53:07 +0200 Subject: [PATCH 01/10] Move LspDetach handler near kickstart-lsp-highlight group (#900) Moved to make sure the kickstart-lsp-highlight group exists when the LspDetach handler is invoked. The LspDetach handler is used to clean up any lsp highlights that were enabled by CursorHold if the LSP is stopped or crashed. --- init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 036eefb..457ad21 100644 --- a/init.lua +++ b/init.lua @@ -526,6 +526,14 @@ require('lazy').setup({ group = highlight_augroup, callback = vim.lsp.buf.clear_references, }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) end -- The following autocommand is used to enable inlay hints in your @@ -540,14 +548,6 @@ require('lazy').setup({ end, }) - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf } - end, - }) - -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. From f86f18f27afeef1952272e212bef886e58ffd04c Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 5 May 2024 18:01:39 -0700 Subject: [PATCH 02/10] Add diff to treesitter's ensure_installed languages (#908) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 457ad21..88658ef 100644 --- a/init.lua +++ b/init.lua @@ -835,7 +835,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From b9bd02d55b77293291a38fac9abe46acad9ab91d Mon Sep 17 00:00:00 2001 From: Smig <89040888+smiggiddy@users.noreply.github.com> Date: Wed, 8 May 2024 10:55:49 -0400 Subject: [PATCH 03/10] fix: debug.lua (#918) --- lua/kickstart/plugins/debug.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7be4abd..d4d1465 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -31,7 +31,7 @@ return { require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations - automatic_setup = true, + automatic_installation = true, -- You can provide additional configuration to the handlers, -- see mason-nvim-dap README for more information From 5aeddfdd5d0308506ec63b0e4f8de33e2a39355f Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Fri, 10 May 2024 19:43:22 +0200 Subject: [PATCH 04/10] Automatically set detached state as needed. (#925) * Automatically set detached state as needed. * Use vim.fn.has instead. * Fix int vs bool. --- lua/kickstart/plugins/debug.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index d4d1465..31dfecf 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -85,6 +85,12 @@ return { dap.listeners.before.event_exited['dapui_config'] = dapui.close -- Install golang specific config - require('dap-go').setup() + require('dap-go').setup { + delve = { + -- On Windows delve must be run attached or it crashes. + -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring + detached = vim.fn.has 'win32' == 0, + }, + } end, } From 7a2ebf4d3a1d28885ad9305b44bfad85719039de Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:02:21 +0200 Subject: [PATCH 05/10] Flash.nvim --- init.lua | 2 +- lua/custom/plugins/flash.lua | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lua/custom/plugins/flash.lua diff --git a/init.lua b/init.lua index 88658ef..0e98646 100644 --- a/init.lua +++ b/init.lua @@ -885,7 +885,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua new file mode 100644 index 0000000..a8d36f4 --- /dev/null +++ b/lua/custom/plugins/flash.lua @@ -0,0 +1,14 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} From 90822016b8c739f66d951f3041934aae64830dd1 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:02:44 +0200 Subject: [PATCH 06/10] Configure some lsp servers --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 0e98646..f0cdbbb 100644 --- a/init.lua +++ b/init.lua @@ -565,10 +565,10 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + clangd = {}, + gopls = {}, + pyright = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: From 697dca25dc9b364a83fd28fc6034092319832f82 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:02:58 +0200 Subject: [PATCH 07/10] Indent_line --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f0cdbbb..dd54dc2 100644 --- a/init.lua +++ b/init.lua @@ -874,7 +874,7 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', From c5e88df78285cc6ded948b2aba7851c9bc48dc78 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:03:20 +0200 Subject: [PATCH 08/10] Remember.nvim --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index dd54dc2..7429e08 100644 --- a/init.lua +++ b/init.lua @@ -228,6 +228,8 @@ require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + -- Remember position + { 'vladdoster/remember.nvim', opts = {} }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. From 5e4b4f8d606a228e7e9b3ef2741049a31430c030 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:03:31 +0200 Subject: [PATCH 09/10] Disable arrow keys --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 7429e08..45cc321 100644 --- a/init.lua +++ b/init.lua @@ -176,10 +176,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows From c7946a839e5a6cf2f3f01900d8db39b3f108db82 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 11 Jul 2024 22:03:56 +0200 Subject: [PATCH 10/10] move.nvim with keymaps --- init.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/init.lua b/init.lua index 45cc321..19978f2 100644 --- a/init.lua +++ b/init.lua @@ -190,6 +190,20 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Normal-mode commands +vim.keymap.set('n', '', ':MoveLine(1)') +vim.keymap.set('n', '', ':MoveLine(-1)') +vim.keymap.set('n', '', ':MoveHChar(-1)') +vim.keymap.set('n', '', ':MoveHChar(1)') +vim.keymap.set('n', 'wf', ':MoveWord(1)') +vim.keymap.set('n', 'wb', ':MoveWord(-1)') + +-- Visual-mode commands +vim.keymap.set('v', '', ':MoveBlock(1)') +vim.keymap.set('v', '', ':MoveBlock(-1)') +vim.keymap.set('v', '', ':MoveHBlock(-1)') +vim.keymap.set('v', '', ':MoveHBlock(1)') + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -230,6 +244,10 @@ require('lazy').setup({ -- Remember position { 'vladdoster/remember.nvim', opts = {} }, + + -- Move lines + { 'fedepujol/move.nvim', opts = { noremap = true, silent = true } }, + -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc.