From e2f3ffcc02321f5224b6472add79a693fd88ff3f Mon Sep 17 00:00:00 2001 From: TheSoeren Date: Tue, 25 Jun 2024 22:34:00 +0200 Subject: [PATCH] Generic changes, notably adding git-blame --- README.md | 4 ++-- lua/custom/plugins/csharpls-extended-lsp.lua | 1 + lua/custom/plugins/git-blame.lua | 9 +++++++++ lua/custom/plugins/harpoon.lua | 16 +++++++++++----- lua/plugins.lua | 20 +------------------- lua/remap.lua | 8 -------- 6 files changed, 24 insertions(+), 34 deletions(-) create mode 100644 lua/custom/plugins/csharpls-extended-lsp.lua create mode 100644 lua/custom/plugins/git-blame.lua diff --git a/README.md b/README.md index 15e94dc1..f988688b 100644 --- a/README.md +++ b/README.md @@ -131,8 +131,8 @@ examples of adding popularly requested plugins. same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) + * [Restructure the configuration](https://github.com/TheSoeren/kickstart.nvim/issues/218) + * [Reorganize init.lua into a multi-file setup](https://github.com/TheSoeren/kickstart.nvim/pull/473) ### Install Recipes diff --git a/lua/custom/plugins/csharpls-extended-lsp.lua b/lua/custom/plugins/csharpls-extended-lsp.lua new file mode 100644 index 00000000..f0cc03ab --- /dev/null +++ b/lua/custom/plugins/csharpls-extended-lsp.lua @@ -0,0 +1 @@ +return { 'Decodetalkers/csharpls-extended-lsp.nvim' } diff --git a/lua/custom/plugins/git-blame.lua b/lua/custom/plugins/git-blame.lua new file mode 100644 index 00000000..fbc9867e --- /dev/null +++ b/lua/custom/plugins/git-blame.lua @@ -0,0 +1,9 @@ +return { + 'FabijanZulj/blame.nvim', + config = function() + local blame = require 'blame' + blame.setup() + + vim.keymap.set('n', 'gb', ':BlameToggle') + end, +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index 88956d13..54ef1559 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -33,6 +33,7 @@ return { vim.keymap.set('n', 'a', function() harpoon:list():add() end) + vim.keymap.set('n', '', function() harpoon:list():select(1) end) @@ -46,12 +47,17 @@ return { harpoon:list():select(4) end) - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set('n', '', function() - harpoon:list():prev() + vim.keymap.set('n', '', function() + harpoon:list():replace_at(1) end) - vim.keymap.set('n', '', function() - harpoon:list():next() + vim.keymap.set('n', '', function() + harpoon:list():replace_at(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():replace_at(3) + end) + vim.keymap.set('n', '', function() + harpoon:list():replace_at(4) end) end, } diff --git a/lua/plugins.lua b/lua/plugins.lua index a7c60b41..0035bb1d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -359,16 +359,6 @@ 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 = {}, - -- ... 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: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`tsserver`) will work just fine tsserver = {}, csharp_ls = {}, netcoredbg = {}, @@ -404,12 +394,9 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code - 'clangd', 'clang-format', - 'csharp_ls', 'lua_ls', 'omnisharp', - 'tsserver', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -447,7 +434,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = { c = true } return { timeout_ms = 500, lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], @@ -683,11 +670,6 @@ require('lazy').setup({ -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- This is the easiest way to modularize your config. - -- - -- 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' }, }, { ui = { diff --git a/lua/remap.lua b/lua/remap.lua index 0ba1bf50..137d9835 100644 --- a/lua/remap.lua +++ b/lua/remap.lua @@ -26,14 +26,6 @@ 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. --- See `:help wincmd` for a list of all window commands --- THIS WOULD CLASH WITH HARPOON BUFFER SELECTION --- vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) --- vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) --- vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) --- vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - -- Enable moving highlighted lines vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '<-2gv=gv")