From 5c42521234c7346f74db84046583e86f35a86f28 Mon Sep 17 00:00:00 2001 From: Paul-0x5061756c <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Thu, 2 May 2024 11:04:23 +0200 Subject: [PATCH 1/6] added personal preferences --- init.lua | 93 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/init.lua b/init.lua index 036eefb8..15eab4b0 100644 --- a/init.lua +++ b/init.lua @@ -90,7 +90,7 @@ P.S. You can delete this when you're done too. It's your config now! :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Set to true if you have a Nerd Font installed and selected in the terminal +-- Set to true if you have a Nerd Font installed vim.g.have_nerd_font = false -- [[ Setting options ]] @@ -204,6 +204,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Disable auto format on save +vim.g.disable_auto_format = true + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -286,13 +289,7 @@ require('lazy').setup({ ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) end, }, @@ -359,6 +356,10 @@ require('lazy').setup({ -- }, -- }, -- pickers = {} + -- should be below each other stacked vertically + layout_config = { + layout_strategy = 'horizontal', + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), @@ -412,7 +413,7 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim - { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants + 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -507,6 +508,9 @@ require('lazy').setup({ -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + -- only format changed lines on save + vim.api.nvim_buf_set_option(event.buf, 'formatexpr', 'v:lua.vim.lsp.buf.formatting_sync()') + -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed @@ -514,37 +518,16 @@ require('lazy').setup({ -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) if client and client.server_capabilities.documentHighlightProvider then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, - group = highlight_augroup, callback = vim.lsp.buf.document_highlight, }) vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { buffer = event.buf, - group = highlight_augroup, callback = vim.lsp.buf.clear_references, }) end - - -- The following autocommand is used to enable inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) - end, '[T]oggle Inlay [H]ints') - end - 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, }) @@ -592,6 +575,11 @@ require('lazy').setup({ }, }, }, + omnisharp = { + cmd = { 'omnisharp', '--languageserver' }, + filetypes = { 'cs', 'vb', 'cshtml', 'razor', 'html' }, + root_dir = require('lspconfig.util').root_pattern('*.sln', '*.csproj', '*.fsproj'), + }, } -- Ensure the servers and tools above are installed @@ -624,7 +612,29 @@ require('lazy').setup({ } end, }, - + -- Copilot + { + 'github/copilot.vim', + lazy = false, + }, + -- Autopairs + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, + }, + -- LazyGit + { + 'kdheepak/lazygit.nvim', + lazy = false, + keys = { + { + 'lg', + 'LazyGit', + desc = '[L]azy [G]it', + }, + }, + }, { -- Autoformat 'stevearc/conform.nvim', lazy = false, @@ -645,9 +655,14 @@ require('lazy').setup({ -- 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 } + + if vim.g.disable_auto_format or disable_filetypes[vim.bo[bufnr].filetype] then + return false + end + return { timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + lsp_fallback = true, } end, formatters_by_ft = { @@ -673,9 +688,6 @@ require('lazy').setup({ -- Build Step is needed for regex support in snippets. -- This step is not supported in many windows environments. -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end return 'make install_jsregexp' end)(), dependencies = { @@ -729,13 +741,7 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, - - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -850,8 +856,6 @@ require('lazy').setup({ config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - -- Prefer git instead of curl in order to improve connectivity in some environments - require('nvim-treesitter.install').prefer_git = true ---@diagnostic disable-next-line: missing-fields require('nvim-treesitter.configs').setup(opts) @@ -876,9 +880,6 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- 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. From e9e006fb2996cebade2b9dac69c888ae31678ce7 Mon Sep 17 00:00:00 2001 From: Paul <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Wed, 8 May 2024 08:42:22 +0200 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f445b65e..b786e736 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ fork to your machine using one of the commands below, depending on your OS.
Linux and Mac ```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +git clone https://github.com/Paul-0x5061756c/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ```
From d6e13613b3922ed1fb76c2f547297c4c2f077e1c Mon Sep 17 00:00:00 2001 From: Paul-0x5061756c <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Wed, 8 May 2024 13:56:34 +0200 Subject: [PATCH 3/6] omnisharp is no longer used --- init.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 15eab4b0..ab40fd8c 100644 --- a/init.lua +++ b/init.lua @@ -575,11 +575,16 @@ require('lazy').setup({ }, }, }, - omnisharp = { - cmd = { 'omnisharp', '--languageserver' }, - filetypes = { 'cs', 'vb', 'cshtml', 'razor', 'html' }, - root_dir = require('lspconfig.util').root_pattern('*.sln', '*.csproj', '*.fsproj'), - }, + + -- currently using csharp-language-server from mason + + -- omnisharp = { + -- cmd = { 'omnisharp', '--languageserver' }, + -- filetypes = { 'cs', 'vb', 'cshtml', 'razor', 'html' }, + -- root_dir = function(fname) + -- return require('lspconfig').util.root_pattern('*.sln', '*.csproj', '*.fsproj', '*.vbproj', '*.vcxproj')(fname) or vim.fn.getcwd() + -- end, + -- }, } -- Ensure the servers and tools above are installed @@ -872,14 +877,12 @@ require('lazy').setup({ -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart - -- -- Here are some example plugins that I've included in the Kickstart repository. -- 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.lint', + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', -- 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. From 69b568472c87e03cf5de512802abd7fdaacd833a Mon Sep 17 00:00:00 2001 From: Paul-0x5061756c <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Wed, 8 May 2024 16:09:13 +0200 Subject: [PATCH 4/6] theme for telescope dropdown --- init.lua | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index ab40fd8c..a14e0d4b 100644 --- a/init.lua +++ b/init.lua @@ -355,10 +355,59 @@ require('lazy').setup({ -- i = { [''] = 'to_fuzzy_refine' }, -- }, -- }, - -- pickers = {} - -- should be below each other stacked vertically - layout_config = { - layout_strategy = 'horizontal', + -- set all pickers to dropdown + pickers = { + find_files = { + theme = 'dropdown', + }, + live_grep = { + theme = 'dropdown', + }, + grep_string = { + theme = 'dropdown', + }, + file_browser = { + theme = 'dropdown', + }, + old_files = { + theme = 'dropdown', + }, + help_tags = { + theme = 'dropdown', + }, + keymaps = { + theme = 'dropdown', + }, + builtin = { + theme = 'dropdown', + }, + lsp_references = { + theme = 'dropdown', + }, + lsp_definitions = { + theme = 'dropdown', + }, + lsp_implementations = { + theme = 'dropdown', + }, + lsp_code_actions = { + theme = 'dropdown', + }, + lsp_document_diagnostics = { + theme = 'dropdown', + }, + lsp_workspace_diagnostics = { + theme = 'dropdown', + }, + lsp_document_symbols = { + theme = 'dropdown', + }, + lsp_workspace_symbols = { + theme = 'dropdown', + }, + lsp_dynamic_workspace_symbols = { + theme = 'dropdown', + }, }, extensions = { ['ui-select'] = { @@ -880,7 +929,7 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - require 'kickstart.plugins.debug', + -- require 'kickstart.plugins.debug', require 'kickstart.plugins.indent_line', require 'kickstart.plugins.lint', From f5847f269f6d09237b9a06edbd169e6e12408dbd Mon Sep 17 00:00:00 2001 From: Paul-0x5061756c <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:03:47 +0200 Subject: [PATCH 5/6] updates --- init.lua | 11 +++++++++-- lua/kickstart/plugins/debug.lua | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index a14e0d4b..7c705acf 100644 --- a/init.lua +++ b/init.lua @@ -636,6 +636,8 @@ require('lazy').setup({ -- }, } + require("neodev").setup({}) + -- Ensure the servers and tools above are installed -- To check the current status of installed tools and/or manually install -- other tools, you can run @@ -661,11 +663,17 @@ require('lazy').setup({ -- certain features of an LSP (for example, turning off formatting for tsserver) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) require('lspconfig')[server_name].setup(server) + end, }, } end, }, + -- neoconf.nvim + { + 'folke/neoconf.nvim', + lazy = false, + }, -- Copilot { 'github/copilot.vim', @@ -850,7 +858,6 @@ require('lazy').setup({ vim.cmd.hi 'Comment gui=none' end, }, - -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, @@ -929,7 +936,7 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', require 'kickstart.plugins.indent_line', require 'kickstart.plugins.lint', diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7be4abdb..201eb04a 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -35,13 +35,25 @@ return { -- You can provide additional configuration to the handlers, -- see mason-nvim-dap README for more information - handlers = {}, + handlers = { + function (config) + require('mason-nvim-dap').default_setup(config) + end, + coreclr = function (config) + config.adapters = { + type = 'executable', + command = 'dotnet run', + args = { '--watch' }, + } + require('mason-nvim-dap').default_setup(config) + end, + }, -- You'll need to check that you have the required things installed -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want - 'delve', + 'coreclr', }, } From bfeb81005587503e9aa5e9295fbfff2ae8528edd Mon Sep 17 00:00:00 2001 From: Paul-0x5061756c <82609900+Paul-0x5061756c@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:33:09 +0200 Subject: [PATCH 6/6] added primes harpoon --- init.lua | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 7c705acf..c7b9042a 100644 --- a/init.lua +++ b/init.lua @@ -669,6 +669,37 @@ require('lazy').setup({ } end, }, + + -- Prime's Harpoon2 + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + lazy = false, + config = function() + require('harpoon'):setup({}) + end, + keys = { + { + 'a', + function() + require('harpoon'):list():add() + end, + mode = 'n', + desc = '[A]dd to Harpoon', + }, + { + '', + function() + local files = require('harpoon'):list() or {} + require('harpoon').ui:toggle_quick_menu(files) + end, + desc = 'Toggle Harpoon [E]xplorer', + }, + }, + }, -- neoconf.nvim { 'folke/neoconf.nvim', @@ -730,7 +761,7 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + -- pyt,on = { "isort", "black" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found.