From 83b65a1c7d4a5ae9454426e88be823c203d14a73 Mon Sep 17 00:00:00 2001 From: Luiz Antonio Calliari Filho Date: Thu, 25 May 2023 22:09:34 -0300 Subject: [PATCH 001/191] FIX: Conflict with vimdiff keybinding --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index fb0252cc654..ca2da6e161e 100644 --- a/init.lua +++ b/init.lua @@ -122,8 +122,8 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) - vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, From cdaa750c86cfc0c8f2fc1c8638b7296c327bf5a9 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sat, 3 Jun 2023 10:11:10 -0400 Subject: [PATCH 002/191] Refactor theme and status line into their own file --- init.lua | 29 ++++++---------------------- lua/kickstart/plugins/autoformat.lua | 14 +++----------- lua/kickstart/plugins/statusline.lua | 14 ++++++++++++++ lua/kickstart/plugins/theme.lua | 10 ++++++++++ 4 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 lua/kickstart/plugins/statusline.lua create mode 100644 lua/kickstart/plugins/theme.lua diff --git a/init.lua b/init.lua index ca2da6e161e..5e9e5679c90 100644 --- a/init.lua +++ b/init.lua @@ -122,35 +122,18 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) - vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) + vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) + vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, + -- Theme related configs go here + require 'kickstart.plugins.theme', - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, + -- Status line related configs go here + require 'kickstart.plugins.statusline', { -- Add indentation guides even on blank lines diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index bc56b15b027..855f350f319 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,6 +5,7 @@ return { 'neovim/nvim-lspconfig', + config = function() -- Switch for controlling whether you want autoformatting. -- Use :KickstartFormatToggle to toggle autoformatting on or off @@ -28,11 +29,9 @@ return { return _augroups[client.id] end - -- Whenever an LSP attaches to a buffer, we will run this function. - -- - -- See `:help LspAttach` for more information about this autocmd event. vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), + -- This is where we attach the autoformatting for reasonable clients callback = function(args) local client_id = args.data.client_id @@ -50,8 +49,6 @@ return { return end - -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. vim.api.nvim_create_autocmd('BufWritePre', { group = get_augroup(client), buffer = bufnr, @@ -60,12 +57,7 @@ return { return end - vim.lsp.buf.format { - async = false, - filter = function(c) - return c.id == client.id - end, - } + vim.lsp.buf.format { async = false } end, }) end, diff --git a/lua/kickstart/plugins/statusline.lua b/lua/kickstart/plugins/statusline.lua new file mode 100644 index 00000000000..f54393fa37d --- /dev/null +++ b/lua/kickstart/plugins/statusline.lua @@ -0,0 +1,14 @@ +return { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'tokyonight', + component_separators = '|', + section_separators = '', + }, + }, +} + diff --git a/lua/kickstart/plugins/theme.lua b/lua/kickstart/plugins/theme.lua new file mode 100644 index 00000000000..794aa4d2637 --- /dev/null +++ b/lua/kickstart/plugins/theme.lua @@ -0,0 +1,10 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + vim.cmd.colorscheme 'tokyonight-storm' + end, +} + From 5e4d24cb2faf37d341bc906affcc2cac21919c51 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sun, 4 Jun 2023 16:10:59 +0000 Subject: [PATCH 003/191] Revert "Refactor theme and status line into their own file" This reverts commit cdaa750c86cfc0c8f2fc1c8638b7296c327bf5a9. --- init.lua | 29 ++++++++++++++++++++++------ lua/kickstart/plugins/autoformat.lua | 14 +++++++++++--- lua/kickstart/plugins/statusline.lua | 14 -------------- lua/kickstart/plugins/theme.lua | 10 ---------- 4 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 lua/kickstart/plugins/statusline.lua delete mode 100644 lua/kickstart/plugins/theme.lua diff --git a/init.lua b/init.lua index 5e9e5679c90..ca2da6e161e 100644 --- a/init.lua +++ b/init.lua @@ -122,18 +122,35 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) - vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, }, - -- Theme related configs go here - require 'kickstart.plugins.theme', + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + config = function() + vim.cmd.colorscheme 'onedark' + end, + }, - -- Status line related configs go here - require 'kickstart.plugins.statusline', + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, + }, + }, { -- Add indentation guides even on blank lines diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index 855f350f319..bc56b15b027 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,7 +5,6 @@ return { 'neovim/nvim-lspconfig', - config = function() -- Switch for controlling whether you want autoformatting. -- Use :KickstartFormatToggle to toggle autoformatting on or off @@ -29,9 +28,11 @@ return { return _augroups[client.id] end + -- Whenever an LSP attaches to a buffer, we will run this function. + -- + -- See `:help LspAttach` for more information about this autocmd event. vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), - -- This is where we attach the autoformatting for reasonable clients callback = function(args) local client_id = args.data.client_id @@ -49,6 +50,8 @@ return { return end + -- Create an autocmd that will run *before* we save the buffer. + -- Run the formatting command for the LSP that has just attached. vim.api.nvim_create_autocmd('BufWritePre', { group = get_augroup(client), buffer = bufnr, @@ -57,7 +60,12 @@ return { return end - vim.lsp.buf.format { async = false } + vim.lsp.buf.format { + async = false, + filter = function(c) + return c.id == client.id + end, + } end, }) end, diff --git a/lua/kickstart/plugins/statusline.lua b/lua/kickstart/plugins/statusline.lua deleted file mode 100644 index f54393fa37d..00000000000 --- a/lua/kickstart/plugins/statusline.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'tokyonight', - component_separators = '|', - section_separators = '', - }, - }, -} - diff --git a/lua/kickstart/plugins/theme.lua b/lua/kickstart/plugins/theme.lua deleted file mode 100644 index 794aa4d2637..00000000000 --- a/lua/kickstart/plugins/theme.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - vim.cmd.colorscheme 'tokyonight-storm' - end, -} - From e6cb90b2b33127dafdee351cc84a1d4ae06ce71f Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Wed, 7 Jun 2023 20:41:30 -0400 Subject: [PATCH 004/191] Fixes #336 - Enabale treesitter indent for Python Tested in my local configuratoin. Indenting works great. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5e9e5679c90..200bfe7ce21 100644 --- a/init.lua +++ b/init.lua @@ -295,7 +295,7 @@ require('nvim-treesitter.configs').setup { auto_install = false, highlight = { enable = true }, - indent = { enable = true, disable = { 'python' } }, + indent = { enable = true }, incremental_selection = { enable = true, keymaps = { From ac07c5c59cb57688f0c63fa74a28bcc3d7795ecd Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 14 Jun 2023 17:21:15 -0400 Subject: [PATCH 005/191] Add legacy tag to fidget to avoid deprecation warning --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 57c9af42b47..c62174516e5 100644 --- a/init.lua +++ b/init.lua @@ -84,7 +84,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', From be90f025de58b08871d866eab8e4d3baeb9f4f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Fri, 16 Jun 2023 21:12:11 -0700 Subject: [PATCH 006/191] Use call_parentheses --- .stylua.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stylua.toml b/.stylua.toml index 5d12dbdfb00..139e9397d90 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -3,4 +3,4 @@ line_endings = "Unix" indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" -no_call_parentheses = true +call_parentheses = "None" From c45b17ebab9da4913baa09f37c393a1a6962119b Mon Sep 17 00:00:00 2001 From: Juan Giordana Date: Sun, 18 Jun 2023 00:10:49 -0300 Subject: [PATCH 007/191] Add descriptions for debugging keybindings. Add descriptions for debugging key bindings. Improve formatting by changing double quotes to single quotes in order to keep compatibility with the rest of the kickstart.nvim project. --- lua/kickstart/plugins/debug.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index deeda564a22..7fc783fabd4 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -43,14 +43,14 @@ return { } -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue) - vim.keymap.set('n', '', dap.step_into) - vim.keymap.set('n', '', dap.step_over) - vim.keymap.set('n', '', dap.step_out) - vim.keymap.set('n', 'b', dap.toggle_breakpoint) + vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) + vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) + vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) + vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) + vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) vim.keymap.set('n', 'B', function() dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end) + end, { desc = 'Debug: Set Breakpoint' }) -- Dap UI setup -- For more information, see |:help nvim-dap-ui| @@ -69,13 +69,14 @@ return { step_back = 'b', run_last = '▶▶', terminate = '⏹', - disconnect = "⏏", + disconnect = '⏏', }, }, } - -- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception. - vim.keymap.set("n", "", dapui.toggle) - + + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From d8b3b774bb642a9bdb2930f2ef0dd09e29a2f00c Mon Sep 17 00:00:00 2001 From: ilian Date: Sun, 18 Jun 2023 16:20:34 +0200 Subject: [PATCH 008/191] Fix typo in ignorecase comment In order to perform a case-sensitive search with ignorecase, the pattern should contain `\C` instead of `/C`. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c62174516e5..fd36919c23e 100644 --- a/init.lua +++ b/init.lua @@ -229,7 +229,7 @@ vim.o.breakindent = true -- Save undo history vim.o.undofile = true --- Case insensitive searching UNLESS /C or capital in search +-- Case-insensitive searching UNLESS \C or capital in search vim.o.ignorecase = true vim.o.smartcase = true From 957655ddb8be837a37c8e1fd0dd7f5c49705986e Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sat, 1 Jul 2023 12:34:20 -0400 Subject: [PATCH 009/191] Make init.lua copy-paste friendly --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index fd36919c23e..f8d9383f7ad 100644 --- a/init.lua +++ b/init.lua @@ -197,12 +197,13 @@ require('lazy').setup({ -- require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', - -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping -- up-to-date with whatever is in the kickstart repo. + -- 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 - { import = 'custom.plugins' }, + -- { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] From a73b2e5f57059aeff4f6a4cc5ea15f9b012ec9b8 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sat, 1 Jul 2023 11:21:10 -0400 Subject: [PATCH 010/191] =?UTF-8?q?docs:=20Update=20README.md=20?= =?UTF-8?q?=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 64f386c6c07..99914cf1fbe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # kickstart.nvim +https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b + ### Introduction A starting point for Neovim that is: From 93ef2e8078900d2a19936beb8cd37706cdb7dbdb Mon Sep 17 00:00:00 2001 From: Andres Lowrie Date: Fri, 7 Jul 2023 08:37:12 -0500 Subject: [PATCH 011/191] correct typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hey y'all 👋 I think there may have been a typo? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64f386c6c07..e0b0470a332 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A starting point for Neovim that is: * Documented * Modular -This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. +This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. From 31f867a69947f96f7b3ae1a9d49d2a12a3220a8f Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Mon, 17 Jul 2023 10:21:44 -0400 Subject: [PATCH 012/191] Remove timeout --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index f8d9383f7ad..859d9d2a6c7 100644 --- a/init.lua +++ b/init.lua @@ -239,7 +239,6 @@ vim.wo.signcolumn = 'yes' -- Decrease update time vim.o.updatetime = 250 -vim.o.timeout = true vim.o.timeoutlen = 300 -- Set completeopt to have a better completion experience From 78ab7ee09411676d01138faafc03a3e638d5f560 Mon Sep 17 00:00:00 2001 From: Dennis-Rall <56480601+Dennis-Rall@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:56:15 +0200 Subject: [PATCH 013/191] Add hint to uncomment line to autodetect plugins --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a128bcf503..b38867ddc9c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Additional system requirements: * Inside of your copy, feel free to modify any file you like! It's your copy! * Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` + * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment line 206 in init.lua therefore) * Modify `init.lua` with additional plugins. * Include the `lua/kickstart/plugins/*` files in your configuration. From c151235551781459fdb60af17c8d5c5f3ee94170 Mon Sep 17 00:00:00 2001 From: Dennis-Rall <56480601+Dennis-Rall@users.noreply.github.com> Date: Thu, 20 Jul 2023 16:42:46 +0200 Subject: [PATCH 014/191] Remove fixed line number and describe line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b38867ddc9c..ef5976007ab 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Additional system requirements: * Inside of your copy, feel free to modify any file you like! It's your copy! * Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment line 206 in init.lua therefore) + * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) * Modify `init.lua` with additional plugins. * Include the `lua/kickstart/plugins/*` files in your configuration. From 29aa5bf42df01c6983c5ea7b464e0535de46f628 Mon Sep 17 00:00:00 2001 From: Numkil Date: Mon, 24 Jul 2023 20:41:14 +0200 Subject: [PATCH 015/191] setup more language servers i use + allow customizing filetypes --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 859d9d2a6c7..e5cbed988c5 100644 --- a/init.lua +++ b/init.lua @@ -424,12 +424,16 @@ end -- -- Add any additional override configuration in the following tables. They will be passed to -- the `settings` field of the server config. You must look up that documentation yourself. +-- +-- 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 = { -- clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- tsserver = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs'} }, lua_ls = { Lua = { @@ -459,8 +463,9 @@ mason_lspconfig.setup_handlers { capabilities = capabilities, on_attach = on_attach, settings = servers[server_name], + filetypes = servers[server_name].filetypes, } - end, + end } -- [[ Configure nvim-cmp ]] From 734cc4e94aec64c8cb3504711978c51b092f2542 Mon Sep 17 00:00:00 2001 From: Merel Jossart Date: Tue, 25 Jul 2023 17:06:04 +0200 Subject: [PATCH 016/191] Fix bug when server not explicitely defined in configuration but installed --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e5cbed988c5..c6e7a981557 100644 --- a/init.lua +++ b/init.lua @@ -463,7 +463,7 @@ mason_lspconfig.setup_handlers { capabilities = capabilities, on_attach = on_attach, settings = servers[server_name], - filetypes = servers[server_name].filetypes, + filetypes = (servers[server_name] or {}).filetypes, } end } From c2fb482ec14041f4537d2269b554818894de7f8e Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Mon, 31 Jul 2023 02:46:27 +0900 Subject: [PATCH 017/191] Fix typo in init.lua releated -> related --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c6e7a981557..160d94007c3 100644 --- a/init.lua +++ b/init.lua @@ -110,7 +110,7 @@ require('lazy').setup({ -- Useful plugin to show you pending keybinds. { 'folke/which-key.nvim', opts = {} }, { - -- Adds git releated signs to the gutter, as well as utilities for managing changes + -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { -- See `:help gitsigns.txt` From b06980a8da1a02f8c123197668998e279c313a5d Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Sat, 5 Aug 2023 17:28:18 -0700 Subject: [PATCH 018/191] fix(init): turn telescope-fzf-native into a dependecy --- init.lua | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 160d94007c3..933f5f16466 100644 --- a/init.lua +++ b/init.lua @@ -167,19 +167,24 @@ require('lazy').setup({ { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) - { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, - - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim' + } + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, }, { From 8ee4d24b36334bbf92ae6553baac435687c99969 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Sat, 5 Aug 2023 17:31:01 -0700 Subject: [PATCH 019/191] fix: fix brackets --- init.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 933f5f16466..f5389e4749a 100644 --- a/init.lua +++ b/init.lua @@ -172,18 +172,18 @@ require('lazy').setup({ branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' - } - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, }, }, From a4ec83a43328232175f5a68bdd188ad4ba8e8981 Mon Sep 17 00:00:00 2001 From: daan Date: Sun, 6 Aug 2023 16:27:05 +0100 Subject: [PATCH 020/191] fix: missing comma --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f5389e4749a..1192c4634a4 100644 --- a/init.lua +++ b/init.lua @@ -171,7 +171,7 @@ require('lazy').setup({ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { - 'nvim-lua/plenary.nvim' + 'nvim-lua/plenary.nvim', -- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Only load if `make` is available. Make sure you have the system -- requirements installed. From d0b47ce9581499785aab8ed6772128ad67c95a4b Mon Sep 17 00:00:00 2001 From: Smig <89040888+smiggiddy@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:00:15 -0400 Subject: [PATCH 021/191] Update init.lua added a URL to the lua-guide may help others who miss the :help lua-guide --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 1192c4634a4..1332c3b97a5 100644 --- a/init.lua +++ b/init.lua @@ -17,7 +17,9 @@ Kickstart.nvim is a template for your own configuration. a guide. One possible example: - https://learnxinyminutes.com/docs/lua/ + And then you can explore or search through `:help lua-guide` + - https://neovim.io/doc/user/lua-guide.html Kickstart Guide: From 555dd8ed27890ffa29b30921b46614e5cbf21a09 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 19 Aug 2023 13:38:31 +0200 Subject: [PATCH 022/191] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef5976007ab..4a312bc9cb4 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Distribution Alternatives: `~/.config/nvim` (MacOS) `%userprofile%\AppData\Local\nvim\` (Windows) -* run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim` +* Run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim` * Run Neovim (from terminal or shortcut) and allow lazy.nvim to download files and set up the basics. * Once the setup is complete, restart Neovim. * **You're ready to go!** From f00ff6f6ab6a94e3d49b2e8efa94eed855bc6623 Mon Sep 17 00:00:00 2001 From: "E. Aakash" <09e.aakash@gmail.com> Date: Sun, 20 Aug 2023 14:43:34 +0530 Subject: [PATCH 023/191] Use telescope for goto implementation --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 1332c3b97a5..7eb1d231c7f 100644 --- a/init.lua +++ b/init.lua @@ -403,7 +403,7 @@ local on_attach = function(_, bufnr) nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') + nmap('gI', require('telescope.builtin').lsp_implementaitons, '[G]oto [I]mplementation') nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') From 1283a0bbe7424b44a38dc983f1ba0fbe33e80978 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Mon, 21 Aug 2023 17:19:13 -0400 Subject: [PATCH 024/191] Update init.lua Fix typo in original. Co-authored-by: Luis G Estrades --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 7eb1d231c7f..d9967930782 100644 --- a/init.lua +++ b/init.lua @@ -403,7 +403,7 @@ local on_attach = function(_, bufnr) nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementaitons, '[G]oto [I]mplementation') + nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') From 38a0f0323196c406e6e81d52052b2ac213bfe709 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Tue, 22 Aug 2023 07:17:15 +0300 Subject: [PATCH 025/191] Revert gitsigns keymaps but fix vimdiff and fugitive conflict Originally, the keymaps for jumping to next and previous git hunks were ]c and [c. This was changed in #323 (83b65a1) because they overwrote the built-in vimdiff keymaps. However, the more traditional solution is to have ]c and [c *extend* the built-in keymap. This is what fugitive and gitgutter have been doing for years. Gitsigns doesn't do this by itself, but it has a recommended keymap configuration on which the present patch is based: https://github.com/lewis6991/gitsigns.nvim#keymaps The only thing I've added is to have the keymaps work in visual mode as well, which is the same behavior as the built in vimdiff keymaps. --- init.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 1332c3b97a5..8c213667202 100644 --- a/init.lua +++ b/init.lua @@ -124,9 +124,20 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) - vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) - vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) + vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + + -- don't override the built-in and fugitive keymaps + local gs = package.loaded.gitsigns + vim.keymap.set({'n', 'v'}, ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) + vim.keymap.set({'n', 'v'}, '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) end, }, }, From a347bb401e53e3c89ff7cc484c44864af5edcae1 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 27 Aug 2023 06:48:22 +0300 Subject: [PATCH 026/191] treesitter: ensure 'javascript' installed along with typescript and tsx This parser is actually needed for some *JSX* parsing, and since typescript and tsx are already getting installed, it makes sense to also install the javascript parser. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 1332c3b97a5..ad993ea7669 100644 --- a/init.lua +++ b/init.lua @@ -313,7 +313,7 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, From ac9b167860479982feddf9795c24165d75f1847b Mon Sep 17 00:00:00 2001 From: Dilshod Temirkhodjaev Date: Mon, 4 Sep 2023 17:36:28 +0500 Subject: [PATCH 027/191] Add telescope search resume key binding --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index ad993ea7669..be65154660f 100644 --- a/init.lua +++ b/init.lua @@ -308,6 +308,7 @@ vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]resume' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` From f3f6a595a27af4a1762d5623ca9e8ce49b02e915 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Tue, 5 Sep 2023 14:12:56 +0200 Subject: [PATCH 028/191] docs: restructure README --- README.md | 75 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4a312bc9cb4..963883d4547 100644 --- a/README.md +++ b/README.md @@ -20,35 +20,52 @@ Distribution Alternatives: ### Installation -* Backup your previous configuration (if any exists) - -### Archive Installation -* On the home/landing page for the project find the blue "<> CODE" button click it and select Local > Download ZIP. -* Extract the archive to: - `~/.config/nvim` (Linux) - `~/.config/nvim` (MacOS) - `%userprofile%\AppData\Local\nvim\` (Windows) -* Ensure your extraction method did not extract with a parent folder. For example in ~/.config/nvim you should have init.lua not another folder called kickstart.nvim. - -### Git Clone Installation -* From a terminal cd/dir to: - `~/.config/nvim` (Linux) - `~/.config/nvim` (MacOS) - `%userprofile%\AppData\Local\nvim\` (Windows) - -* Run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim` -* Run Neovim (from terminal or shortcut) and allow lazy.nvim to download files and set up the basics. -* Once the setup is complete, restart Neovim. -* **You're ready to go!** - -* (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify). -* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim\` (Windows) - * If you don't want to include it as a git repo, you can just clone it and then move the files to this location - -Additional system requirements: -- Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -- See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` +> **NOTE** +> [Backup](#FAQ) your previous configuration (if any exists) + +Requirements: +* Make sure to review the readmes of the plugins if you are experiencing errors. In particular: + * [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. +* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` + +Neovim's configurations are located under the following paths, depending on your OS: + +| OS | PATH | +| :- | :--- | +| Linux | `~/.config/nvim` | +| MacOS | `~/.config/nvim` | +| Windows | `%userprofile%\AppData\Local\nvim\` | + +#### Archive Installation + +* On the home/landing page for the project find the green "`<> CODE`" button click it and select `Local > Download ZIP`. +* Extract the archive to the appropriate configuration path. +* Ensure your extraction method did not extract with a parent folder. For example in `~/.config/nvim` you should have `init.lua` not another folder called `kickstart.nvim`. + +#### Git Clone Installation + +From a terminal `cd`/`dir` to the configuration path and then run: + +```sh +git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim +# OR +gh repo clone nvim-lua/kickstart.nvim +``` + +### Post Installation + +Run the following command and then **you are ready to go**! + +```sh +nvim --headless "+Lazy! sync" +qa +``` + +### Recommended Optional + +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. + +> **NOTE** +> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` ### Configuration And Extension From 24885f24831434425145ae5c998cc25f00ffdc52 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Thu, 7 Sep 2023 18:36:05 +0200 Subject: [PATCH 029/191] docs: remove archive installation --- README.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 963883d4547..49fa0f315e6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Distribution Alternatives: ### Installation -> **NOTE** +> **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) Requirements: @@ -32,24 +32,17 @@ Neovim's configurations are located under the following paths, depending on your | OS | PATH | | :- | :--- | -| Linux | `~/.config/nvim` | -| MacOS | `~/.config/nvim` | +| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| MacOS | `$XDG_CONFIG_HOME/nvim`, '~/.config/nvim` | | Windows | `%userprofile%\AppData\Local\nvim\` | -#### Archive Installation - -* On the home/landing page for the project find the green "`<> CODE`" button click it and select `Local > Download ZIP`. -* Extract the archive to the appropriate configuration path. -* Ensure your extraction method did not extract with a parent folder. For example in `~/.config/nvim` you should have `init.lua` not another folder called `kickstart.nvim`. - -#### Git Clone Installation - -From a terminal `cd`/`dir` to the configuration path and then run: +Clone kickstart.nvim: ```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim -# OR -gh repo clone nvim-lua/kickstart.nvim +# on Linux and Mac +git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +# on Windows +git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` ### Post Installation @@ -60,7 +53,7 @@ Run the following command and then **you are ready to go**! nvim --headless "+Lazy! sync" +qa ``` -### Recommended Optional +### Recommended Steps [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. From 8443853cfece1763a2cd9ef677fdf6e80a590bbd Mon Sep 17 00:00:00 2001 From: Christopher Gillis <771603+Chris-Gillis@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:10:51 -0400 Subject: [PATCH 030/191] Remove extra "r" Search Resume description --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ea330eb16f4..cec3084e844 100644 --- a/init.lua +++ b/init.lua @@ -319,7 +319,7 @@ vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]resume' }) +vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` From 0340f772007d8a2fcca0cb172c0fc9b17ec33ea3 Mon Sep 17 00:00:00 2001 From: tcld Date: Sun, 24 Sep 2023 10:24:33 +0200 Subject: [PATCH 031/191] Add documentation for custom which-key groups --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index cec3084e844..6f8f714607c 100644 --- a/init.lua +++ b/init.lua @@ -438,6 +438,17 @@ local on_attach = function(_, bufnr) end, { desc = 'Format current buffer with LSP' }) end +-- document existing key chains +require('which-key').register({ + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, + ['h'] = { name = 'More git', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, +}) + -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- From aff064f714a701a565332d1e8758ab317387c1c9 Mon Sep 17 00:00:00 2001 From: Anthony Fiddes <11233666+Anthony-Fiddes@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:44:03 -0700 Subject: [PATCH 032/191] Remove lazy-lock.json from .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea93edad490..d699e1d68cc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ tags test.sh .luarc.json nvim -lazy-lock.json From 878ec12318c675caaa3055b60c54294206fda9fd Mon Sep 17 00:00:00 2001 From: Emmanuel Chucks <31349069+emmanuelchucks@users.noreply.github.com> Date: Thu, 28 Sep 2023 05:57:53 +0000 Subject: [PATCH 033/191] fix(init.lua): indent blankline v3 setup --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index cec3084e844..8ec8d54eb22 100644 --- a/init.lua +++ b/init.lua @@ -170,10 +170,12 @@ require('lazy').setup({ 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` - opts = { - char = '┊', - show_trailing_blankline_indent = false, - }, + config = function() + require('ibl').setup { + char = '┊', + show_trailing_blankline_indent = false, + } + end, }, -- "gc" to comment visual regions/lines From 7a58588a92f3b0c7c0d8ff92ce6ff278f6092d93 Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Thu, 28 Sep 2023 23:11:05 +0900 Subject: [PATCH 034/191] fix: fix indent-blankline config --- init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 8ec8d54eb22..3a00dea2f5a 100644 --- a/init.lua +++ b/init.lua @@ -170,12 +170,8 @@ require('lazy').setup({ 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` - config = function() - require('ibl').setup { - char = '┊', - show_trailing_blankline_indent = false, - } - end, + main = "ibl", + opts = {}, }, -- "gc" to comment visual regions/lines From 4d5f24d6c1ecd1c77aded7fc4e59a329d27509b8 Mon Sep 17 00:00:00 2001 From: Ashraf Michail Date: Sat, 30 Sep 2023 00:35:22 +0000 Subject: [PATCH 035/191] Defer Treesitter setup to improve startup time of nvim {filename} --- init.lua | 113 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/init.lua b/init.lua index 52571130c65..e5bc576e457 100644 --- a/init.lua +++ b/init.lua @@ -321,69 +321,72 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` -require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, - - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { +-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' +vim.defer_fn(function() + require('nvim-treesitter.configs').setup { + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, + + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + auto_install = false, + + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', }, }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, }, }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, -} + } +end, 0) -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) From 313bd75ca04cb2cef48a79ac3ad697a1b9a2daab Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sat, 30 Sep 2023 20:06:22 -0400 Subject: [PATCH 036/191] Fix git clone instruction - separate code blocks for Windows and UNIX. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 49fa0f315e6..4d27756c92e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Clone kickstart.nvim: ```sh # on Linux and Mac git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +``` + + +``` # on Windows git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` From 6ffc5a169f090b0b4359deb6deff0b99ab123679 Mon Sep 17 00:00:00 2001 From: Anthony Fiddes <11233666+Anthony-Fiddes@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:25:57 -0700 Subject: [PATCH 037/191] Fix Mason setup issue and run stylua. --- init.lua | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index e5bc576e457..4438ca19331 100644 --- a/init.lua +++ b/init.lua @@ -81,7 +81,7 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, + 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP @@ -128,16 +128,24 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({'n', 'v'}, ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) + vim.keymap.set({ 'n', 'v' }, ']c', function() + if vim.wo.diff then + return ']c' + end + vim.schedule(function() + gs.next_hunk() + end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) - vim.keymap.set({'n', 'v'}, '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) + end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) + vim.keymap.set({ 'n', 'v' }, '[c', function() + if vim.wo.diff then + return '[c' + end + vim.schedule(function() + gs.prev_hunk() + end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) + end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) end, }, }, @@ -170,7 +178,7 @@ require('lazy').setup({ 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` - main = "ibl", + main = 'ibl', opts = {}, }, @@ -326,10 +334,10 @@ vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, - + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, - + highlight = { enable = true }, indent = { enable = true }, incremental_selection = { @@ -440,7 +448,7 @@ local on_attach = function(_, bufnr) end -- document existing key chains -require('which-key').register({ +require('which-key').register { ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, @@ -448,7 +456,7 @@ require('which-key').register({ ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, -}) +} -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. @@ -481,6 +489,11 @@ require('neodev').setup() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) +-- mason-lspconfig requires that these setup functions are called in this order +-- before setting up the servers. +require('mason').setup() +require('mason-lspconfig').setup() + -- Ensure the servers above are installed local mason_lspconfig = require 'mason-lspconfig' @@ -496,7 +509,7 @@ mason_lspconfig.setup_handlers { settings = servers[server_name], filetypes = (servers[server_name] or {}).filetypes, } - end + end, } -- [[ Configure nvim-cmp ]] From 21b175d21b5ff07a7b5cf8e846cad1c31d20547c Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 7 Oct 2023 13:49:47 +0200 Subject: [PATCH 038/191] remove spaces in empty lines --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e5bc576e457..5c8372a68e4 100644 --- a/init.lua +++ b/init.lua @@ -326,10 +326,10 @@ vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, - + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, - + highlight = { enable = true }, indent = { enable = true }, incremental_selection = { From 36224daa1bfff3b2fe7067952f305111f99b356f Mon Sep 17 00:00:00 2001 From: Anthony Fiddes <11233666+Anthony-Fiddes@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:14:26 -0700 Subject: [PATCH 039/191] Move mason setup up further This helps if a user needs to find a mason executable --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 4438ca19331..11f55d05fb0 100644 --- a/init.lua +++ b/init.lua @@ -458,6 +458,11 @@ require('which-key').register { ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, } +-- mason-lspconfig requires that these setup functions are called in this order +-- before setting up the servers. +require('mason').setup() +require('mason-lspconfig').setup() + -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -489,11 +494,6 @@ require('neodev').setup() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) --- mason-lspconfig requires that these setup functions are called in this order --- before setting up the servers. -require('mason').setup() -require('mason-lspconfig').setup() - -- Ensure the servers above are installed local mason_lspconfig = require 'mason-lspconfig' From 01ed2525bbff69756cd867673dea4dd9e54dfdee Mon Sep 17 00:00:00 2001 From: Ashraf Michail Date: Tue, 3 Oct 2023 13:22:25 +0000 Subject: [PATCH 040/191] Fix bash errors --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 11f55d05fb0..ee1f390ee9c 100644 --- a/init.lua +++ b/init.lua @@ -333,7 +333,7 @@ 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 - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, From c27b05467a80a36a2be757a84384ffba86221094 Mon Sep 17 00:00:00 2001 From: Pedro Santayana Date: Sat, 7 Oct 2023 22:34:24 -0300 Subject: [PATCH 041/191] docs: fix misstype on README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d27756c92e..433a51de6f0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Neovim's configurations are located under the following paths, depending on your | OS | PATH | | :- | :--- | | Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| MacOS | `$XDG_CONFIG_HOME/nvim`, '~/.config/nvim` | +| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | Windows | `%userprofile%\AppData\Local\nvim\` | Clone kickstart.nvim: From db7189f35c33f9b7e95a1602ff4d8dffe5cbf741 Mon Sep 17 00:00:00 2001 From: Alvaro-Kothe Date: Tue, 10 Oct 2023 19:57:49 -0300 Subject: [PATCH 042/191] Fix help for indent-blankline plugin Since version 3 `:help indent_blankline` no longer works. Replace it with `:help ibl`. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ee1f390ee9c..fb080807d14 100644 --- a/init.lua +++ b/init.lua @@ -177,7 +177,7 @@ require('lazy').setup({ -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help indent_blankline.txt` + -- See `:help ibl` main = 'ibl', opts = {}, }, From 5d8921990bf2fab9a1c9dc0d74bf1bbe1b6dc980 Mon Sep 17 00:00:00 2001 From: Theo P Date: Fri, 13 Oct 2023 16:21:10 +0900 Subject: [PATCH 043/191] feat(lsp): use Telescope builtin functions for LSP definition and type definition --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index fb080807d14..a7667ddcc63 100644 --- a/init.lua +++ b/init.lua @@ -422,10 +422,10 @@ local on_attach = function(_, bufnr) nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') + nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') + nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') From 68b1981f0298f5b92b68acc00f42eda5702c4044 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 25 Oct 2023 21:46:24 +0200 Subject: [PATCH 044/191] Update README Post Installation steps Change the recommendation to just run nvim normally instead of the headless mode for the first run. This will show Lazy UI updating the plugins which would match what the video show and may be easier to understand what is going on thant the silent headless run. --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 433a51de6f0..f8198270aed 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,15 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\L ### Post Installation -Run the following command and then **you are ready to go**! +Start Neovim + +```sh +nvim +``` + +The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up. + +If you would prefer to hide this step and run the plugin sync from the command line, you can use: ```sh nvim --headless "+Lazy! sync" +qa From 0dd934ee017cdd52bc91b4e5dd9f4e4e31a5d98b Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sat, 28 Oct 2023 23:33:10 +0200 Subject: [PATCH 045/191] README.md: add a note about NVIM_APPNAME in the FAQ section --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index f8198270aed..9652d708b3a 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,13 @@ Each PR, especially those which increase the line count, should have a descripti * You should back it up, then delete all files associated with it. * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) +* Can I keep my existing configuration in parallel to kickstart? + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create a script `~/bin/nvim-kickstart`: + ``` + #!/bin/sh + exec env NVIM_APPNAME=nvim-kickstart nvim "$@" + ``` + When you run Neovim with `nvim-kickstart` it will use the alternative config directory and the matching local directory: `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information * Are there any cool videos about this plugin? From 4d2cf48fb6b620a5b4ae30f6b2a0b3b521cdbce8 Mon Sep 17 00:00:00 2001 From: n-a11s Date: Fri, 3 Nov 2023 13:47:30 +0100 Subject: [PATCH 046/191] Update README.md Added information on where to install if you use Powershell in windows. Since CMD and Powershell work differently. `%userprofile%` only works for the CMD application. `$env:USERPROFILE` works in Powershell. --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9652d708b3a..e2d9ea84b9a 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,8 @@ Neovim's configurations are located under the following paths, depending on your | :- | :--- | | Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows | `%userprofile%\AppData\Local\nvim\` | +| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | +| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | Clone kickstart.nvim: @@ -45,10 +46,16 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO ``` -# on Windows +# on Windows (cmd) git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` +``` +# on Windows (powershell) +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +``` + + ### Post Installation Start Neovim From 1ad1ec250907acd6e1c593f9990eb61430aa7c74 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Fri, 3 Nov 2023 19:04:25 +0100 Subject: [PATCH 047/191] README.md: Added a FAQ: why is init.lua a single file --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 9652d708b3a..1f8e6f40476 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,16 @@ Each PR, especially those which increase the line count, should have a descripti * Are there any cool videos about this plugin? * Current iteration of kickstart (coming soon) * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. +* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? + * The main purpose of kickstart is to serve as a teaching tool and a reference + configuration that someone can easily `git clone` as a basis for their own. + As you progress in learning Neovim and Lua, you might consider splitting `init.lua` + into smaller parts. A fork of kickstart that does this while maintaining the exact + 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) ### Windows Installation From 0fda9af7c94a2c3687a5123a7cf254613de45a46 Mon Sep 17 00:00:00 2001 From: Sebastian Lara Menares Date: Mon, 6 Nov 2023 11:10:16 -0300 Subject: [PATCH 048/191] add Telescope live_grep on Git root --- init.lua | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a7667ddcc63..a301a94e2eb 100644 --- a/init.lua +++ b/init.lua @@ -308,6 +308,40 @@ require('telescope').setup { -- Enable telescope fzf native, if installed pcall(require('telescope').load_extension, 'fzf') +-- Telescope live_grep in git root +-- Function to find the git root directory based on the current buffer's path +local function find_git_root() + -- Use the current buffer's path as the starting point for the git search + local current_file = vim.api.nvim_buf_get_name(0) + -- If the buffer is not associated with a file, return nil + if current_file == "" then + print("Buffer is not associated with a file") + return nil + end + -- Extract the directory from the current file's path + local current_dir = vim.fn.fnamemodify(current_file, ":h") + -- Find the Git root directory from the current file's path + print("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel") + local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1] + if vim.v.shell_error ~= 0 then + print("Not a git repository") + return nil + end + return git_root +end + +-- Custom live_grep function to search in git root +local function live_grep_git_root() + local git_root = find_git_root() + if git_root then + require('telescope.builtin').live_grep({ + search_dirs = {git_root}, + }) + end +end + +vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) + -- See `:help telescope.builtin` vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) @@ -323,7 +357,8 @@ vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sG', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sg', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) From 5ce4f38e1e9b62c7e2477b2e21af08ecac232bc5 Mon Sep 17 00:00:00 2001 From: Sebastian Lara Menares Date: Mon, 6 Nov 2023 15:29:09 -0300 Subject: [PATCH 049/191] change keymap to not disrupt existing users of Search by Grep --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index a301a94e2eb..b4b83051fe6 100644 --- a/init.lua +++ b/init.lua @@ -321,7 +321,6 @@ local function find_git_root() -- Extract the directory from the current file's path local current_dir = vim.fn.fnamemodify(current_file, ":h") -- Find the Git root directory from the current file's path - print("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel") local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1] if vim.v.shell_error ~= 0 then print("Not a git repository") @@ -357,8 +356,8 @@ vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sG', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sg', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) From 1d14453024dcb8e2025ba3a14d5c3f1daa384e63 Mon Sep 17 00:00:00 2001 From: Sebastian Lara Menares Date: Mon, 6 Nov 2023 22:29:05 -0300 Subject: [PATCH 050/191] Live Grep from Git root falls back to cwd on special buffers --- init.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index b4b83051fe6..0976a461a58 100644 --- a/init.lua +++ b/init.lua @@ -313,18 +313,21 @@ pcall(require('telescope').load_extension, 'fzf') local function find_git_root() -- Use the current buffer's path as the starting point for the git search local current_file = vim.api.nvim_buf_get_name(0) + local current_dir + local cwd = vim.fn.getcwd() -- If the buffer is not associated with a file, return nil if current_file == "" then - print("Buffer is not associated with a file") - return nil + current_dir = cwd + else + -- Extract the directory from the current file's path + current_dir = vim.fn.fnamemodify(current_file, ":h") end - -- Extract the directory from the current file's path - local current_dir = vim.fn.fnamemodify(current_file, ":h") + -- Find the Git root directory from the current file's path local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1] if vim.v.shell_error ~= 0 then - print("Not a git repository") - return nil + print("Not a git repository. Searching on current working directory") + return cwd end return git_root end From f23484cf88197ac38574f4fd4965cc2c17263f20 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 7 Nov 2023 11:18:15 +0100 Subject: [PATCH 051/191] init.lua: move diagnostic keymaps together with other keymaps --- init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 0976a461a58..225ad21a458 100644 --- a/init.lua +++ b/init.lua @@ -281,6 +281,12 @@ vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) @@ -433,12 +439,6 @@ vim.defer_fn(function() } end, 0) --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) From c8dd8e7e0cd5d3d1d3760eac908513de1be0b37c Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 7 Nov 2023 11:27:14 +0100 Subject: [PATCH 052/191] init.lua: minor edits of section comments for consistency --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 225ad21a458..748e7f81454 100644 --- a/init.lua +++ b/init.lua @@ -37,13 +37,14 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now :) --]] + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Install package manager +-- [[ Install `lazy.nvim` plugin manager ]] -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -59,6 +60,7 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +-- [[ Configure plugins ]] -- NOTE: Here is where you install your plugins. -- You can configure plugins using the `config` key. -- From af4f51b2cd6cfb2511d34adc99900110f4d3916b Mon Sep 17 00:00:00 2001 From: Shashwat Agrawal Date: Sat, 11 Nov 2023 20:31:05 +0530 Subject: [PATCH 053/191] fix(auto-completion): ensure first menu item is selected by default --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 748e7f81454..385b19a0733 100644 --- a/init.lua +++ b/init.lua @@ -564,6 +564,9 @@ cmp.setup { luasnip.lsp_expand(args.body) end, }, + completion = { + completeopt = 'menu,menuone,noinsert' + }, mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), From 711e5976dd83f0bdb904e3d884375b79c89f0e2a Mon Sep 17 00:00:00 2001 From: j-hui Date: Mon, 13 Nov 2023 15:46:34 -0500 Subject: [PATCH 054/191] init.lua: remove 'legacy' tag from fidget.nvim --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 385b19a0733..3a98da03be6 100644 --- a/init.lua +++ b/init.lua @@ -88,7 +88,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', From ee9790b381416781063d0de6653b303f10ed89b0 Mon Sep 17 00:00:00 2001 From: Tommy Williams Date: Fri, 24 Nov 2023 09:55:19 -0700 Subject: [PATCH 055/191] option to reduce noisy Lua_LS's missing-fields warnings (#511) --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 3a98da03be6..e7f1eec416d 100644 --- a/init.lua +++ b/init.lua @@ -522,6 +522,8 @@ local servers = { Lua = { workspace = { checkThirdParty = false }, telemetry = { enable = false }, + -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' } }, }, }, } From 14cf319dbd63ef4bedf9cf219c3732c568718996 Mon Sep 17 00:00:00 2001 From: matt <55467261+mattwyd@users.noreply.github.com> Date: Wed, 29 Nov 2023 19:34:43 -0500 Subject: [PATCH 056/191] Update README.md (#520) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7f54ce88704..1979e9ec276 100644 --- a/README.md +++ b/README.md @@ -39,19 +39,19 @@ Neovim's configurations are located under the following paths, depending on your Clone kickstart.nvim: -```sh # on Linux and Mac +```sh git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ``` -``` # on Windows (cmd) +``` git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` -``` # on Windows (powershell) +``` git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` From afafc9ab194be254467b4cc8be049fc33fe27b14 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 30 Nov 2023 10:04:27 +0100 Subject: [PATCH 057/191] README.md: update install section formatting (#523) --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1979e9ec276..36c1386128e 100644 --- a/README.md +++ b/README.md @@ -39,18 +39,17 @@ Neovim's configurations are located under the following paths, depending on your Clone kickstart.nvim: -# on Linux and Mac +- on Linux and Mac ```sh git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ``` - -# on Windows (cmd) +- on Windows (cmd) ``` git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` -# on Windows (powershell) +- on Windows (powershell) ``` git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` From 39ae0829acea66175721fcf48695c7df6db040b9 Mon Sep 17 00:00:00 2001 From: Sudo <788991+wadkar@users.noreply.github.com> Date: Fri, 1 Dec 2023 07:30:55 +0900 Subject: [PATCH 058/191] Use alias instead of a wrapper script (#524) It is much easier to stick an alias statement in `~/.{z,ba}shrc` than create a script, invoke another instance of interpreter and then run neovim --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 36c1386128e..78ac6df0fb5 100644 --- a/README.md +++ b/README.md @@ -156,12 +156,11 @@ Each PR, especially those which increase the line count, should have a descripti * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) * Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create a script `~/bin/nvim-kickstart`: + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: ``` - #!/bin/sh - exec env NVIM_APPNAME=nvim-kickstart nvim "$@" + alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' ``` - When you run Neovim with `nvim-kickstart` it will use the alternative config directory and the matching local directory: `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. + When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information * Are there any cool videos about this plugin? From 3ca08acf0e9023b3f8b602a5db2dd00cebdcbfbc Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sat, 2 Dec 2023 22:27:13 +0100 Subject: [PATCH 059/191] Add a github action on pull request to check lua formatting (#526) GitHub Action used: https://github.com/marketplace/actions/stylua This runs `stylua --check` on a PR and it will show success or failure. The suggested stylua changes can be inspected when clicking on the details. The PR can still be merged even if the check fails. --- .github/workflows/stylua.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/stylua.yml diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml new file mode 100644 index 00000000000..e189fe01da2 --- /dev/null +++ b/.github/workflows/stylua.yml @@ -0,0 +1,18 @@ +# Check Lua Formatting +name: Check Lua Formatting +on: pull_request + +jobs: + stylua-check: + name: Stylua Check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Stylua Check + uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . + From 12bd68e8b9bc98242084bce55236d2bf9fe299b1 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 3 Dec 2023 20:23:39 +0100 Subject: [PATCH 060/191] Run stylua (#525) --- init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index e7f1eec416d..94f7cf4ecbe 100644 --- a/init.lua +++ b/init.lua @@ -324,17 +324,17 @@ local function find_git_root() local current_dir local cwd = vim.fn.getcwd() -- If the buffer is not associated with a file, return nil - if current_file == "" then + if current_file == '' then current_dir = cwd else -- Extract the directory from the current file's path - current_dir = vim.fn.fnamemodify(current_file, ":h") + current_dir = vim.fn.fnamemodify(current_file, ':h') end -- Find the Git root directory from the current file's path - local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1] + local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] if vim.v.shell_error ~= 0 then - print("Not a git repository. Searching on current working directory") + print 'Not a git repository. Searching on current working directory' return cwd end return git_root @@ -344,9 +344,9 @@ end local function live_grep_git_root() local git_root = find_git_root() if git_root then - require('telescope.builtin').live_grep({ - search_dirs = {git_root}, - }) + require('telescope.builtin').live_grep { + search_dirs = { git_root }, + } end end @@ -567,7 +567,7 @@ cmp.setup { end, }, completion = { - completeopt = 'menu,menuone,noinsert' + completeopt = 'menu,menuone,noinsert', }, mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.select_next_item(), From f8c8b08bc15b2bac590b3c397db3b466f7fb1d0b Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Dec 2023 16:35:54 +0100 Subject: [PATCH 061/191] Add gitsigns recommended keymaps (#531) * Import gitsigns README.md recommended keymaps (and apply stylua) the previously added visual mode for ]c [c is kept. * Add gitsigns keymap descriptions --- init.lua | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 94f7cf4ecbe..76ddd45a83f 100644 --- a/init.lua +++ b/init.lua @@ -126,11 +126,16 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) - - -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map({ 'n', 'v' }, ']c', function() if vim.wo.diff then return ']c' end @@ -138,8 +143,9 @@ require('lazy').setup({ gs.next_hunk() end) return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) - vim.keymap.set({ 'n', 'v' }, '[c', function() + end, { expr = true, desc = 'Jump to next hunk' }) + + map({ 'n', 'v' }, '[c', function() if vim.wo.diff then return '[c' end @@ -147,7 +153,37 @@ require('lazy').setup({ gs.prev_hunk() end) return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) + end, { expr = true, desc = 'Jump to previous hunk' }) + + -- Actions + -- visual mode + map('v', 'hs', function() + gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'stage git hunk' }) + map('v', 'hr', function() + gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'reset git hunk' }) + -- normal mode + map('n', 'hs', gs.stage_hunk, { desc = 'git stage hunk' }) + map('n', 'hr', gs.reset_hunk, { desc = 'git reset hunk' }) + map('n', 'hS', gs.stage_buffer, { desc = 'git Stage buffer' }) + map('n', 'hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) + map('n', 'hR', gs.reset_buffer, { desc = 'git Reset buffer' }) + map('n', 'hp', gs.preview_hunk, { desc = 'preview git hunk' }) + map('n', 'hb', function() + gs.blame_line { full = false } + end, { desc = 'git blame line' }) + map('n', 'hd', gs.diffthis, { desc = 'git diff against index' }) + map('n', 'hD', function() + gs.diffthis '~' + end, { desc = 'git diff against last commit' }) + + -- Toggles + map('n', 'tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) + map('n', 'td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) + + -- Text object + map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) end, }, }, @@ -491,11 +527,18 @@ require('which-key').register { ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, - ['h'] = { name = 'More git', _ = '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' }, + ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, } +-- register which-key VISUAL mode +-- required for visual hs (hunk stage) to work +require('which-key').register({ + [''] = { name = 'VISUAL ' }, + ['h'] = { 'Git [H]unk' }, +}, { mode = 'v' }) -- mason-lspconfig requires that these setup functions are called in this order -- before setting up the servers. From 3824342d107850dfe5b179d0a39e0d8fcd54411d Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Dec 2023 16:45:01 +0100 Subject: [PATCH 062/191] Adds two essential telescope keymaps (#528) * Added keymap for select Telescope picker * Added keymap for search in all open files --- init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.lua b/init.lua index 76ddd45a83f..36cc9a525ac 100644 --- a/init.lua +++ b/init.lua @@ -399,6 +399,14 @@ vim.keymap.set('n', '/', function() }) end, { desc = '[/] Fuzzily search in current buffer' }) +local function telescope_live_grep_open_files() + require('telescope.builtin').live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } +end +vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) +vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) From 76c5b1ec57f40d17ac787feb018817a802e24bb6 Mon Sep 17 00:00:00 2001 From: Shashwat Agrawal <72117025+ShashwatAgrawal20@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:44:06 +0530 Subject: [PATCH 063/191] feat(cmp): path completion feature (#536) --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 36cc9a525ac..cf4a3790026 100644 --- a/init.lua +++ b/init.lua @@ -105,6 +105,7 @@ require('lazy').setup({ -- Adds LSP completion capabilities 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', -- Adds a number of user-friendly snippets 'rafamadriz/friendly-snippets', @@ -652,6 +653,7 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'path' }, }, } From e39a8bce9d25b3bd8d50098fadf13575a4a71b4b Mon Sep 17 00:00:00 2001 From: Ari Pollak Date: Thu, 21 Dec 2023 15:35:28 -0500 Subject: [PATCH 064/191] Switch cmp up mapping from C-d to C-b to match regular vim up key (#549) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cf4a3790026..48cf771ba28 100644 --- a/init.lua +++ b/init.lua @@ -624,7 +624,7 @@ cmp.setup { mapping = cmp.mapping.preset.insert { [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete {}, [''] = cmp.mapping.confirm { From 4d0dc8d4b1bd6b94e59f7773158149bb1b0ee5be Mon Sep 17 00:00:00 2001 From: John Pekcan Date: Sat, 23 Dec 2023 20:59:59 -0800 Subject: [PATCH 065/191] fix: restore mason config timing for dap startup (#555) Co-authored-by: John Pekcan --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 48cf771ba28..7e68de67481 100644 --- a/init.lua +++ b/init.lua @@ -83,7 +83,7 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs to stdpath for neovim - 'williamboman/mason.nvim', + { 'williamboman/mason.nvim', config = true }, 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP From d45e5fe85582332ee7bd0e12f1062a40f8b9fa1f Mon Sep 17 00:00:00 2001 From: gitressa <3491208+gitressa@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:03:23 +0100 Subject: [PATCH 066/191] Move video up on the README.md page (#563) To help new users get started, how about moving the video link ("Effective Neovim: Instant IDE ") right after "Post Installation"? This way new users, can install it, and right away proceed to learn how to use it. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78ac6df0fb5..e1a4ee1991c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,10 @@ If you would prefer to hide this step and run the plugin sync from the command l nvim --headless "+Lazy! sync" +qa ``` +### Introduction + +To get started, see [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the previous version. Note: The install via init.lua is outdated, please follow the install instructions in this file instead. An updated video is coming soon. + ### Recommended Steps [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. @@ -163,9 +167,6 @@ Each PR, especially those which increase the line count, should have a descripti When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Are there any cool videos about this plugin? - * Current iteration of kickstart (coming soon) - * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily `git clone` as a basis for their own. From c4055a2212c6a1515d07edae5a9de435543102d2 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 3 Jan 2024 18:30:37 +0100 Subject: [PATCH 067/191] Improve stylua github workflow (#571) Addressing issue nvim-lua/kickstart.nvim#570 This improves the github workflow to no longer require manual approval for PRs from first time contributors. Changes the github event from pull_request to pull_request_target and adds an explicit PR head checkout --- .github/workflows/stylua.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml index e189fe01da2..5ec9dabacd2 100644 --- a/.github/workflows/stylua.yml +++ b/.github/workflows/stylua.yml @@ -1,6 +1,6 @@ # Check Lua Formatting name: Check Lua Formatting -on: pull_request +on: pull_request_target jobs: stylua-check: @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Stylua Check uses: JohnnyMorganz/stylua-action@v3 with: From c11afa2f90a9e5b995ef51c8f4b37dfcdc1a7390 Mon Sep 17 00:00:00 2001 From: Mohamad Alamin Yassin Date: Mon, 8 Jan 2024 20:17:01 +0300 Subject: [PATCH 068/191] Add Missing Fields to Treesitter Config to Resolve Warnings (#582) This commit introduces three additional fields - `sync_install`, `ignore_install`, and `modules` - to the Treesitter configuration. This update is aimed at resolving warnings that were previously displayed, potentially causing confusion or frustration for new users of Neovim. By explicitly defining these fields, the configuration aligns better with the latest `nvim-treesitter` requirements. --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 7e68de67481..dd9ef7b9e7b 100644 --- a/init.lua +++ b/init.lua @@ -427,7 +427,14 @@ vim.defer_fn(function() -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, - + -- 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`) + sync_install = false, + -- List of parsers to ignore installing + ignore_install = {}, + -- You can specify additional Treesitter modules here: -- For example: -- playground = {--enable = true,-- }, + modules = {}, highlight = { enable = true }, indent = { enable = true }, incremental_selection = { From 60b93c95d31d1b6723ba1c85db42352b343ebe10 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 8 Jan 2024 20:44:00 +0100 Subject: [PATCH 069/191] README.md: rename the duplicate "Introduction" to "Getting Started" (#572) Changing this second "Introduction" heading to "Getting Started" The recent change in README which moved the youtube link from FAQ to it's own section used the heading "Introduction" which is already the first heading in the file. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e1a4ee1991c..a4c6bd78683 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,9 @@ If you would prefer to hide this step and run the plugin sync from the command l nvim --headless "+Lazy! sync" +qa ``` -### Introduction +### Getting Started -To get started, see [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the previous version. Note: The install via init.lua is outdated, please follow the install instructions in this file instead. An updated video is coming soon. +See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the previous version. Note: The install via init.lua is outdated, please follow the install instructions in this file instead. An updated video is coming soon. ### Recommended Steps From 2510c29d62d39d63bb75f1a613d2ae628a2af4ee Mon Sep 17 00:00:00 2001 From: Sreejith I V <46400271+pzerone@users.noreply.github.com> Date: Wed, 10 Jan 2024 20:06:33 +0530 Subject: [PATCH 070/191] Removed duplicate line (#583) --- init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.lua b/init.lua index dd9ef7b9e7b..1ff16af54b7 100644 --- a/init.lua +++ b/init.lua @@ -425,8 +425,6 @@ vim.defer_fn(function() -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, -- 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`) From deaafcf5491a76f71d3bc70c9d75b3320fe83e83 Mon Sep 17 00:00:00 2001 From: Victor Bertin <83238030+v-bertin@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:48:14 +0100 Subject: [PATCH 071/191] Set status line theme to the global colorscheme (#600) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 1ff16af54b7..3694bc03883 100644 --- a/init.lua +++ b/init.lua @@ -205,7 +205,7 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'onedark', + theme = 'auto', component_separators = '|', section_separators = '', }, From b11581491671ed49b1dfdb1ea777932ade7ff2e5 Mon Sep 17 00:00:00 2001 From: Nazar <63452145+Tokarak@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:52:50 +0000 Subject: [PATCH 072/191] Add Onedark Style (#590) * Add style options to Onedark setup (init.lua) * stylua init.lua * Load onedark through `require` * Improve commenting --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3694bc03883..6c6ae020bcd 100644 --- a/init.lua +++ b/init.lua @@ -193,8 +193,13 @@ require('lazy').setup({ -- Theme inspired by Atom 'navarasu/onedark.nvim', priority = 1000, + lazy = false, config = function() - vim.cmd.colorscheme 'onedark' + require('onedark').setup { + -- Set a style preset. 'dark' is default. + style = 'dark', -- dark, darker, cool, deep, warm, warmer, light + } + require('onedark').load() end, }, From c3ae716fb394344e168ca7ed856e13fb8b6c96bd Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 1 Feb 2024 17:01:46 +0100 Subject: [PATCH 073/191] issue: #594 stylua workflow only on official kickstart repo (#609) Only run the github stylua workflow check on the official kickstart repo (nvim-lua/kickstart.nvim) so that it's not enforced on any other forks. As suggested by: @zwergius --- .github/workflows/stylua.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml index 5ec9dabacd2..75db6c3355b 100644 --- a/.github/workflows/stylua.yml +++ b/.github/workflows/stylua.yml @@ -4,6 +4,7 @@ on: pull_request_target jobs: stylua-check: + if: github.repository == 'nvim-lua/kickstart.nvim' name: Stylua Check runs-on: ubuntu-latest steps: From bc4ad1218b908ec4efc3b0f6ea6e3cb4940b0084 Mon Sep 17 00:00:00 2001 From: Micah Effiong <52747707+micaiah-effiong@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:24:46 +0100 Subject: [PATCH 074/191] feat: added contexts for code action - source fix-all errors (#599) * feat: added contexts for code action - source fix-all errors * fix: resolve stylua checks * fix: resolve stylua checks --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 6c6ae020bcd..c7e64006143 100644 --- a/init.lua +++ b/init.lua @@ -514,7 +514,9 @@ local on_attach = function(_, bufnr) end nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + nmap('ca', function() + vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } + end, '[C]ode [A]ction') nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') From 5d2d81b1ea7373a585fcf02e23296fe1f8bc58e7 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sat, 3 Feb 2024 19:15:25 -0500 Subject: [PATCH 075/191] Fixes #607. Add hints for new neovim users to learn how to learn. (#615) --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index a4c6bd78683..b7fe337a600 100644 --- a/README.md +++ b/README.md @@ -192,3 +192,55 @@ This requires: {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` +### Hints And Tips For New Neovimmers + +Neovim is a very rich and powerful environment, but it can also feel a bit +intimidating for new users trying to find their way around, especially if +they're coming from other environments like Visual Studio Code or a traditional +IDE. + +There's no way this README can provide you with everything you need to know, but +here are a few tips so you can learn how to learn. + +### Use The Help, Luke! + +Neovim's help system is incredibly thorough and extensive. You should really +take a moment to get comfortable navigating through help topics, going back and +forth, navigating the menus, etc. This won't just help you read the help, it +will empower you in the rest of your Neovim journey. + +You can double click on a topic to drill down, and hit Ctrl-o (Hold down the +Control key and the 'o' key) to go back. + +Read the first page you get when you run :help carefully. it will serve you +well. + +You can also get help on a particular thing by typing ":help ". + +Like, let's say we want to learn more about folding, just type ":help folding". + +### To The Telescope! + +One of the more powerful features you get by installing this project is the +brilliant Telescope plugin co-written by @tjdevries. + +Take a minute to browse through ":help telescope" and get a sense for all the +amazing superpowers you've gained. + +In particular, there are two Telescope features that are incredible for helping +you understand how to do a particular thing or how to configure a particular +feature. + +If you're not sure what to look for, try ":Telescope help_tags". Let's say we +want to configure Neovim to automatically word wrap. We might type ":Telescope +help_tags" and then type w, r, a, p. Notice how the list of results changes with +each new letter you type? When you're done you've got a screen full of topics +involving word wrap. + +Another common question is "What keys do I hit to make a thing happen?". To get +an answer, one way is to use ":Telescope keymaps". You'll get the same list of +results that changes to adapt with each new key you press. + +With these hints in mind you should be in good shape to get learning. Remember, +you are on a journey of discovery here, adapting your programming environment to +your needs. It will take effort, but the rewards are worth it! :) From 7af594fd319fbae6b2aaa06337f3df8acbbb7f18 Mon Sep 17 00:00:00 2001 From: rgarber11 Date: Mon, 5 Feb 2024 13:49:19 -0500 Subject: [PATCH 076/191] Add Build Step to LuaSnip (#611) --- init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c7e64006143..fd4567d902b 100644 --- a/init.lua +++ b/init.lua @@ -100,7 +100,18 @@ require('lazy').setup({ 'hrsh7th/nvim-cmp', dependencies = { -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', + { + 'L3MON4D3/LuaSnip', + build = (function() + -- 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 then + return + end + return 'make install_jsregexp' + end)(), + }, 'saadparwaiz1/cmp_luasnip', -- Adds LSP completion capabilities From 8b5d48a199c02658e399f5b43ff8d06df1ede7fb Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 26 Feb 2024 10:03:53 -0500 Subject: [PATCH 077/191] rewrite: slimmer, trimmer and more lazy kickstart.nvim (#635) We've removed over 1/3 of the code that was in kickstart previously, and more than doubled the amount of comments explaining every line of code (to the best of my ability). kickstart now properly uses many of the lazy.nvim config and loading idioms, which should be really helpful for people moving both to modular configs, as well as extending the kickstart config in one file. Additional features: - Beautiful ascii art - Added some documentation that explains what is an LSP, what is telescope, etc - There is now a `:checkhealth` for kickstart, which checks some basic information and adds useful information for maintainers (for people cloning the repo). - Improved LSP configuration and tool installation, for easier first time startup - Changed init.lua ordering, so that it moves from simple options to complicated config ``` ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Lua 1 108 404 298 ------------------------------------------------------------------------------- ``` --- .gitignore | 3 + README.md | 158 +-- init.lua | 1314 ++++++++++++++----------- lua/kickstart/health.lua | 51 + lua/kickstart/plugins/autoformat.lua | 74 -- lua/kickstart/plugins/indent_line.lua | 9 + 6 files changed, 836 insertions(+), 773 deletions(-) create mode 100644 lua/kickstart/health.lua delete mode 100644 lua/kickstart/plugins/autoformat.lua create mode 100644 lua/kickstart/plugins/indent_line.lua diff --git a/.gitignore b/.gitignore index d699e1d68cc..005b535b606 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ tags test.sh .luarc.json nvim + +spell/ +lazy-lock.json diff --git a/README.md b/README.md index b7fe337a600..c9b9d84e87b 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,73 @@ # kickstart.nvim -https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b - -### Introduction +## Introduction A starting point for Neovim that is: * Small -* Single-file (with examples of moving to multi-file) -* Documented -* Modular +* Single-file +* Completely Documented + +**NOT** a Neovim distribution, but instead a starting point for your configuration. -This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. +## Installation -Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. +### Install Neovim -Distribution Alternatives: -- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here) +Kickstart.nvim targets *only* the latest +['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest +['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. +If you are experiencing issues, please make sure you have the latest versions. -### Installation +### Install External Dependencies > **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) -Requirements: -* Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - * [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` +External Requirements: +- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) +- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- Language Setup: + - If want to write Typescript, you need `npm` + - If want to write Golang, you will need `go` + - etc. + +> **NOTE** +> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes Neovim's configurations are located under the following paths, depending on your OS: | OS | PATH | | :- | :--- | -| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | | Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | Clone kickstart.nvim: -- on Linux and Mac +
Linux and Mac + ```sh git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ``` -- on Windows (cmd) +
+ +
Windows + +If you're using `cmd.exe`: + ``` git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` -- on Windows (powershell) +If you're using `powershell.exe` + ``` git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` +
### Post Installation @@ -63,37 +77,33 @@ Start Neovim nvim ``` -The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up. +That's it! Lazy will install all the plugins you have. Use `:Lazy` to view +current plugin status. -If you would prefer to hide this step and run the plugin sync from the command line, you can use: - -```sh -nvim --headless "+Lazy! sync" +qa -``` +Read through the `init.lua` file in your configuration folder for more +information about extending and exploring Neovim. ### Getting Started -See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the previous version. Note: The install via init.lua is outdated, please follow the install instructions in this file instead. An updated video is coming soon. +See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the +previous version. Note: The install via init.lua is outdated, please follow the +install instructions in this file instead. An updated video is coming soon. ### Recommended Steps -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo +(so that you have your own copy that you can modify) and then installing you +can install to your machine using the methods above. > **NOTE** > Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` -### Configuration And Extension - -* Inside of your copy, feel free to modify any file you like! It's your copy! -* Feel free to change any of the default options in `init.lua` to better suit your needs. -* For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) - * Modify `init.lua` with additional plugins. - * Include the `lua/kickstart/plugins/*` files in your configuration. +#### Examples of adding popularly requested plugins -You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration. +
+ Adding autopairs -#### Example: Adding an autopairs plugin +This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). In the file: `lua/custom/plugins/autopairs.lua`, add: @@ -117,10 +127,11 @@ return { } ``` +
+
+ Adding a file tree plugin -This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). - -#### Example: Adding a file tree plugin +This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. In the file: `lua/custom/plugins/filetree.lua`, add: @@ -142,23 +153,13 @@ return { } ``` -This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. - -### Contribution - -Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: - -* Custom language server configuration (null-ls templates) -* Theming beyond a default colorscheme necessary for LSP highlight groups - -Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. +
### FAQ * What should I do if I already have a pre-existing neovim configuration? * You should back it up, then delete all files associated with it. * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) * Can I keep my existing configuration in parallel to kickstart? * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: ``` @@ -191,56 +192,3 @@ This requires: ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` - -### Hints And Tips For New Neovimmers - -Neovim is a very rich and powerful environment, but it can also feel a bit -intimidating for new users trying to find their way around, especially if -they're coming from other environments like Visual Studio Code or a traditional -IDE. - -There's no way this README can provide you with everything you need to know, but -here are a few tips so you can learn how to learn. - -### Use The Help, Luke! - -Neovim's help system is incredibly thorough and extensive. You should really -take a moment to get comfortable navigating through help topics, going back and -forth, navigating the menus, etc. This won't just help you read the help, it -will empower you in the rest of your Neovim journey. - -You can double click on a topic to drill down, and hit Ctrl-o (Hold down the -Control key and the 'o' key) to go back. - -Read the first page you get when you run :help carefully. it will serve you -well. - -You can also get help on a particular thing by typing ":help ". - -Like, let's say we want to learn more about folding, just type ":help folding". - -### To The Telescope! - -One of the more powerful features you get by installing this project is the -brilliant Telescope plugin co-written by @tjdevries. - -Take a minute to browse through ":help telescope" and get a sense for all the -amazing superpowers you've gained. - -In particular, there are two Telescope features that are incredible for helping -you understand how to do a particular thing or how to configure a particular -feature. - -If you're not sure what to look for, try ":Telescope help_tags". Let's say we -want to configure Neovim to automatically word wrap. We might type ":Telescope -help_tags" and then type w, r, a, p. Notice how the list of results changes with -each new letter you type? When you're done you've got a screen full of topics -involving word wrap. - -Another common question is "What keys do I hit to make a thing happen?". To get -an answer, one way is to use ":Telescope keymaps". You'll get the same list of -results that changes to adapt with each new key you press. - -With these hints in mind you should be in good shape to get learning. Remember, -you are on a journey of discovery here, adapting your programming environment to -your needs. It will take effort, but the rewards are worth it! :) diff --git a/init.lua b/init.lua index fd4567d902b..0d19b081263 100644 --- a/init.lua +++ b/init.lua @@ -3,101 +3,627 @@ ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== +======== .-----. ======== +======== .----------------------. | === | ======== +======== |.-""""""""""""""""""-.| |-----| ======== +======== || || | === | ======== +======== || KICKSTART.NVIM || |-----| ======== +======== || || | === | ======== +======== || || |-----| ======== +======== ||:Tutor || |:::::| ======== +======== |'-..................-'| |____o| ======== +======== `"")----------------(""` ___________ ======== +======== /::::::::::| |::::::::::\ \ no mouse \ ======== +======== /:::========| |==hjkl==:::\ \ required \ ======== +======== '""""""""""""' '""""""""""""' '""""""""""' ======== +======== ======== +===================================================================== +===================================================================== -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. +What is Kickstart? - Once you've done that, you should start exploring, configuring and tinkering to - explore Neovim! + Kickstart.nvim is *not* a distribution. - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ + Kickstart.nvim is a starting point for your own configuration. + The goal is that you can read every line of code, top-to-bottom, understand + what your configuration is doing, and modify it to suit your needs. + Once you've done that, you can start exploring, configuring and tinkering to + make Neovim your own! That might mean leaving kickstart just the way it is for a while + or immediately breaking it into modular pieces. It's up to you! - And then you can explore or search through `:help lua-guide` - - https://neovim.io/doc/user/lua-guide.html + If you don't know anything about Lua, I recommend taking some time to read through + a guide. One possible example which will only take 10-15 minutes: + - https://learnxinyminutes.com/docs/lua/ + After understanding a bit more about Lua, you can use `:help lua-guide` as a + reference for how Neovim integrates Lua. + - :help lua-guide + - (or HTML version): https://neovim.io/doc/user/lua-guide.html Kickstart Guide: -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. + TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. + + If you don't know what this means, type the following: + - + - : + - Tutor + - + + (If you already know how the Neovim basics, you can skip this step) + + Once you've completed that, you can continue working through **AND READING** the rest + of the kickstart init.lua + + Next, run AND READ `:help`. + This will open up a help window with some basic information + about reading, navigating and searching the builtin help documentation. + + This should be the first place you go to look when you're stuck or confused + with something. It's one of my favorite neovim features. -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. + MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, + which is very useful when you're not sure exactly what you're looking for. + + I have left several `:help X` comments throughout the init.lua + These are hints about where to find more information about the relevant settings, + plugins or neovim features used in kickstart. + + NOTE: Look for lines like this + + Throughout the file. These are for you, the reader, to help understand what is happening. + Feel free to delete them once you know what you're doing, but they should serve as a guide + for when you are first encountering a few different constructs in your nvim config. + +If you experience any errors while trying to install kickstart, run `:checkhealth` for more info I hope you enjoy your Neovim journey, - TJ -P.S. You can delete this when you're done too. It's your config now :) +P.S. You can delete this when you're done too. It's your config now! :) --]] -- Set as the leader key -- See `:help mapleader` --- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +-- [[ Setting options ]] +-- See `:help vim.opt` +-- NOTE: You can change these options as you wish! +-- For more options, you can see `:help option-list` + +-- Make line numbers default +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 + +-- Enable mouse mode, can be useful for resizing splits for example! +vim.opt.mouse = 'a' + +-- Don't show the mode, since it's already in status line +vim.opt.showmode = false + +-- Sync clipboard between OS and Neovim. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +vim.opt.clipboard = 'unnamedplus' + +-- Enable break indent +vim.opt.breakindent = true + +-- Save undo history +vim.opt.undofile = true + +-- Case-insensitive searching UNLESS \C or capital in search +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Keep signcolumn on by default +vim.opt.signcolumn = 'yes' + +-- Decrease update time +vim.opt.updatetime = 250 +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace in the editor. +-- See :help 'list' +-- and :help 'listchars' +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 10 + +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Set highlight on search, but clear on pressing in normal mode +vim.opt.hlsearch = true +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +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!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +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' }) + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.highlight.on_yank()` +vim.api.nvim_create_autocmd('TextYankPost', { + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] --- https://github.com/folke/lazy.nvim --- `:help lazy.nvim.txt` for more info +-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then - vim.fn.system { - 'git', - 'clone', - '--filter=blob:none', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release - lazypath, - } -end + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } +end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) --- [[ Configure plugins ]] --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. +-- [[ Configure and install plugins ]] +-- +-- To check the current status of your plugins, run +-- :Lazy -- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. +-- You can press `?` in this menu for help. Use `:q` to close the window +-- +-- To update plugins, you can run +-- :Lazy update +-- +-- NOTE: Here is where you install your plugins. require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', + -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). + 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', + -- 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. + -- + -- Use `opts = {}` to force a plugin to be loaded. + -- + -- This is equivalent to: + -- require('Comment').setup({}) - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. - { - -- LSP Configuration & Plugins + -- "gc" to comment visual regions/lines + { 'numToStr/Comment.nvim', opts = {} }, + + -- Here is a more advanced example where we pass configuration + -- options to `gitsigns.nvim`. This is equivalent to the following lua: + -- require('gitsigns').setup({ ... }) + -- + -- See `:help gitsigns` to understand what the configuration keys do + { -- Adds git related signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + }, + }, + + -- NOTE: Plugins can also be configured to run lua code when they are loaded. + -- + -- This is often very useful to both group configuration, as well as handle + -- lazy loading plugins that don't need to be loaded immediately at startup. + -- + -- For example, in the following configuration, we use: + -- event = 'VeryLazy' + -- + -- which loads which-key after all the UI elements are loaded. Events can be + -- normal autocommands events (:help autocomd-events). + -- + -- Then, because we use the `config` key, the configuration only runs + -- after the plugin has been loaded: + -- config = function() ... end + + { -- Useful plugin to show you pending keybinds. + 'folke/which-key.nvim', + event = 'VeryLazy', -- Sets the loading event to 'VeryLazy' + config = function() -- This is the function that runs, AFTER loading + require('which-key').setup() + + -- Document existing key chains + require('which-key').register { + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, + } + end, + }, + + -- NOTE: Plugins can specify dependencies. + -- + -- The dependencies are proper plugin specifications as well - anything + -- you do for a plugin at the top level, you can do for a dependency. + -- + -- Use the `dependencies` key to specify the dependencies of a particular plugin + + { -- Fuzzy Finder (files, lsp, etc) + 'nvim-telescope/telescope.nvim', + event = 'VeryLazy', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + { -- If encountering errors, see telescope-fzf-native README for install instructions + 'nvim-telescope/telescope-fzf-native.nvim', + + -- `build` is used to run some command when the plugin is installed/updated. + -- This is only run then, not every time Neovim starts up. + build = 'make', + + -- `cond` is a condition used to determine whether this plugin should be + -- installed and loaded. + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + { 'nvim-telescope/telescope-ui-select.nvim' }, + + -- Useful for getting pretty icons, but requires special font. + -- If you already have a Nerd Font, or terminal set up with fallback fonts + -- you can enable this + -- { 'nvim-tree/nvim-web-devicons' } + }, + config = function() + -- Telescope is a fuzzy finder that comes with a lot of different things that + -- it can fuzzy find! It's more than just a "file finder", it can search + -- many different aspects of Neovim, your workspace, LSP, and more! + -- + -- The easiest way to use telescope, is to start by doing something like: + -- :Telescope help_tags + -- + -- After running this command, a window will open up and you're able to + -- type in the prompt window. You'll see a list of help_tags options and + -- a corresponding preview of the help. + -- + -- Two important keymaps to use while in telescope are: + -- - Insert mode: + -- - Normal mode: ? + -- + -- This opens a window that shows you all of the keymaps for the current + -- telescope picker. This is really useful to discover what Telescope can + -- do as well as how to actually do it! + + -- [[ Configure Telescope ]] + -- See `:help telescope` and `:help telescope.setup()` + require('telescope').setup { + -- You can put your default mappings / updates / etc. in here + -- All the info you're looking for is in `:help telescope.setup()` + -- + -- defaults = { + -- mappings = { + -- i = { [''] = 'to_fuzzy_refine' }, + -- }, + -- }, + -- pickers = {} + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown(), + }, + }, + } + + -- Enable telescope extensions, if they are installed + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') + + -- See `:help telescope.builtin` + local builtin = require 'telescope.builtin' + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) + vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) + vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + + -- Slightly advanced example of overriding default behavior and theme + vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) + end, { desc = '[/] Fuzzily search in current buffer' }) + + -- Also possible to pass additional configuration options. + -- See `:help telescope.builtin.live_grep()` for information about particular keys + vim.keymap.set('n', 's/', function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, { desc = '[S]earch [/] in Open Files' }) + + -- Shortcut for searching your neovim configuration files + vim.keymap.set('n', 'sn', function() + builtin.find_files { cwd = vim.fn.stdpath 'config' } + end, { desc = '[S]earch [N]eovim files' }) + end, + }, + + { -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { - -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, + -- Automatically install LSPs and related tools to stdpath for neovim + 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', - -- Useful status updates for LSP + -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, + }, + config = function() + -- Brief Aside: **What is LSP?** + -- + -- LSP is an acronym you've probably heard, but might not understand what it is. + -- + -- LSP stands for Language Server Protocol. It's a protocol that helps editors + -- and language tooling communicate in a standardized fashion. + -- + -- In general, you have a "server" which is some tool built to understand a particular + -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc). These Language Servers + -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone + -- processes that communicate with some "client" - in this case, Neovim! + -- + -- LSP provides Neovim with features like: + -- - Go to definition + -- - Find references + -- - Autocompletion + -- - Symbol Search + -- - and more! + -- + -- Thus, Language Servers are external tools that must be installed separately from + -- Neovim. This is where `mason` and related plugins come into play. + -- + -- If you're wondering about lsp vs treesitter, you can check out the wonderfully + -- and elegantly composed help section, :help lsp-vs-treesitter + + -- This function gets run when an LSP attaches to a particular buffer. + -- That is to say, every time a new file is opened that is associated with + -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this + -- function will be executed to configure the current buffer + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + -- NOTE: Remember that lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself + -- many times. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc) + vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + + -- Find references for the word under your cursor. + map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + + -- Fuzzy find all the symbols in your current workspace + -- Similar to document symbols, except searches over your whole project. + map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + + -- Rename the variable under your cursor + -- Most Language Servers support renaming across files, etc. + map('rn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + + -- Opens a popup that displays documentation about the word under your cursor + -- See `:help K` for why this keymap + map('K', vim.lsp.buf.hover, 'Hover Documentation') + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header + map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- 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 + -- + -- 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 + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + callback = vim.lsp.buf.clear_references, + }) + end + 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. + -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- + -- Add any additional override configuration in the following tables. Available keys are: + -- - cmd (table): Override the default command used to start the server + -- - filetypes (table): Override the default list of associated filetypes for the server + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. + -- - 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 = {}, + -- + + lua_ls = { + -- cmd = {...}, + -- filetypes { ...}, + -- capabilities = {}, + settings = { + Lua = { + runtime = { version = 'LuaJIT' }, + workspace = { + checkThirdParty = false, + -- Tells lua_ls where to find all the Lua files that you have loaded + -- for your neovim configuration. + library = { + '${3rd}/luv/library', + unpack(vim.api.nvim_get_runtime_file('', true)), + }, + -- If lua_ls is really slow on your computer, you can try this instead: + -- library = { vim.env.VIMRUNTIME }, + }, + -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' } }, + }, + }, + }, + } + + -- 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 + -- :Mason + -- + -- You can press `g?` for help in this menu + require('mason').setup() + + -- You can add other tools here that you want Mason to install + -- for you, so that they are available from within Neovim. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + 'stylua', -- Used to format lua code + }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + require('mason-lspconfig').setup { + handlers = { + function(server_name) + local server = servers[server_name] or {} + require('lspconfig')[server_name].setup { + cmd = server.cmd, + settings = server.settings, + filetypes = server.filetypes, + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for tsserver) + capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}), + } + end, + }, + } + end, + }, - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', + { -- Autoformat + 'stevearc/conform.nvim', + opts = { + notify_on_error = false, + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + formatters_by_ft = { + lua = { 'stylua' }, + -- Conform can also run multiple formatters sequentially + -- python = { "isort", "black" }, + -- + -- You can use a sub-list to tell conform to run *until* a formatter + -- is found. + -- javascript = { { "prettierd", "prettier" } }, + }, }, }, - { - -- Autocompletion + { -- Autocompletion 'hrsh7th/nvim-cmp', + event = 'InsertEnter', dependencies = { -- Snippet Engine & its associated nvim-cmp source { @@ -106,7 +632,7 @@ 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 then + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end return 'make install_jsregexp' @@ -114,571 +640,171 @@ require('lazy').setup({ }, 'saadparwaiz1/cmp_luasnip', - -- Adds LSP completion capabilities + -- Adds other completion capabilities. + -- nvim-cmp does not ship with all sources by default. They are split + -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, - }, - - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { - -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) - return '' - end, { expr = true, desc = 'Jump to next hunk' }) - - map({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) - return '' - end, { expr = true, desc = 'Jump to previous hunk' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) - map('v', 'hr', function() - gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) - -- normal mode - map('n', 'hs', gs.stage_hunk, { desc = 'git stage hunk' }) - map('n', 'hr', gs.reset_hunk, { desc = 'git reset hunk' }) - map('n', 'hS', gs.stage_buffer, { desc = 'git Stage buffer' }) - map('n', 'hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) - map('n', 'hR', gs.reset_buffer, { desc = 'git Reset buffer' }) - map('n', 'hp', gs.preview_hunk, { desc = 'preview git hunk' }) - map('n', 'hb', function() - gs.blame_line { full = false } - end, { desc = 'git blame line' }) - map('n', 'hd', gs.diffthis, { desc = 'git diff against index' }) - map('n', 'hD', function() - gs.diffthis '~' - end, { desc = 'git diff against last commit' }) - - -- Toggles - map('n', 'tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) - map('n', 'td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) - - -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) - end, + -- If you want to add a bunch of pre-configured snippets, + -- you can use this plugin to help you. It even has snippets + -- for various frameworks/libraries/etc. but you will have to + -- set up the ones that are useful for you. + -- 'rafamadriz/friendly-snippets', }, - }, - - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - lazy = false, config = function() - require('onedark').setup { - -- Set a style preset. 'dark' is default. - style = 'dark', -- dark, darker, cool, deep, warm, warmer, light + -- See `:help cmp` + local cmp = require 'cmp' + local luasnip = require 'luasnip' + luasnip.config.setup {} + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + + -- For an understanding of why these mappings were + -- chosen, you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + mapping = cmp.mapping.preset.insert { + -- Select the [n]ext item + [''] = cmp.mapping.select_next_item(), + -- Select the [p]revious item + [''] = cmp.mapping.select_prev_item(), + + -- 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 }, + + -- Manually trigger a completion from nvim-cmp. + -- Generally you don't need this, because nvim-cmp will display + -- completions whenever it has completion options available. + [''] = cmp.mapping.complete {}, + + -- Think of as moving to the right of your snippet expansion. + -- So if you have a snippet that's like: + -- function $name($args) + -- $body + -- end + -- + -- will move you to the right of each of the expansion locations. + -- is similar, except moving you backwards. + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + }, } - require('onedark').load() end, }, - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'auto', - component_separators = '|', - section_separators = '', - }, - }, - }, + { -- You can easily change to a different colorscheme. + -- Change the name of the colorscheme plugin below, and then + -- change the command in the config to whatever the name of that colorscheme is + -- + -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme` + 'folke/tokyonight.nvim', + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + -- Load the colorscheme here + vim.cmd.colorscheme 'tokyonight-night' - { - -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, + -- You can configure highlights by doing something like + vim.cmd.hi 'Comment gui=none' + end, }, - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + -- Highlight todo, notes, etc in comments + { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - }, + { -- Collection of various small independent plugins/modules + 'echasnovski/mini.nvim', + config = function() + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]parenthen + -- - yinq - [Y]ank [I]nside [N]ext [']quote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup { n_lines = 500 } + + -- Add/delete/replace surroundings (brackets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + + -- Simple and easy statusline. + -- You could remove this setup call if you don't like it, + -- and try some other statusline plugin + require('mini.statusline').setup() + + -- ... and there is more! + -- Check out: https://github.com/echasnovski/mini.nvim + end, }, - { - -- Highlight, edit, and navigate code + { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - }, build = ':TSUpdate', + config = function() + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` + + ---@diagnostic disable-next-line: missing-fields + require('nvim-treesitter.configs').setup { + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + } + + -- There are additional nvim-treesitter modules that you can use to interact + -- with nvim-treesitter. You should go explore a few and see what interests you: + -- + -- - Incremental selection: Included, see :help nvim-treesitter-incremental-selection-mod + -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + end, }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', + -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the + -- init.lua. If you want these files, they are in the repository, so you can just download them and + -- put them in the right spots if you want. + + -- 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', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- This is the easiest way to modularize your config. -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- 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' }, }, {}) --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! - --- Set highlight on search -vim.o.hlsearch = false - --- Make line numbers default -vim.wo.number = true - --- Enable mouse mode -vim.o.mouse = 'a' - --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' - --- Enable break indent -vim.o.breakindent = true - --- Save undo history -vim.o.undofile = true - --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true - --- Keep signcolumn on by default -vim.wo.signcolumn = 'yes' - --- Decrease update time -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 - --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menuone,noselect' - --- NOTE: You should make sure your terminal supports this -vim.o.termguicolors = true - --- [[ Basic Keymaps ]] - --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = '*', -}) - --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` -require('telescope').setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, -} - --- Enable telescope fzf native, if installed -pcall(require('telescope').load_extension, 'fzf') - --- Telescope live_grep in git root --- Function to find the git root directory based on the current buffer's path -local function find_git_root() - -- Use the current buffer's path as the starting point for the git search - local current_file = vim.api.nvim_buf_get_name(0) - local current_dir - local cwd = vim.fn.getcwd() - -- If the buffer is not associated with a file, return nil - if current_file == '' then - current_dir = cwd - else - -- Extract the directory from the current file's path - current_dir = vim.fn.fnamemodify(current_file, ':h') - end - - -- Find the Git root directory from the current file's path - local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] - if vim.v.shell_error ~= 0 then - print 'Not a git repository. Searching on current working directory' - return cwd - end - return git_root -end - --- Custom live_grep function to search in git root -local function live_grep_git_root() - local git_root = find_git_root() - if git_root then - require('telescope.builtin').live_grep { - search_dirs = { git_root }, - } - end -end - -vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) - --- See `:help telescope.builtin` -vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) -vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end, { desc = '[/] Fuzzily search in current buffer' }) - -local function telescope_live_grep_open_files() - require('telescope.builtin').live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } -end -vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) -vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) - --- [[ Configure Treesitter ]] --- See `:help nvim-treesitter` --- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' -vim.defer_fn(function() - require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, - - -- 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`) - sync_install = false, - -- List of parsers to ignore installing - ignore_install = {}, - -- You can specify additional Treesitter modules here: -- For example: -- playground = {--enable = true,-- }, - modules = {}, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, - } -end, 0) - --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local nmap = function(keys, func, desc) - if desc then - desc = 'LSP: ' .. desc - end - - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) - end - - nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', function() - vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } - end, '[C]ode [A]ction') - - nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - - -- Lesser used LSP functionality - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') - nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') - nmap('wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, '[W]orkspace [L]ist Folders') - - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) -end - --- document existing key chains -require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]it', _ = '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' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, -} --- register which-key VISUAL mode --- required for visual hs (hunk stage) to work -require('which-key').register({ - [''] = { name = 'VISUAL ' }, - ['h'] = { 'Git [H]unk' }, -}, { mode = 'v' }) - --- mason-lspconfig requires that these setup functions are called in this order --- before setting up the servers. -require('mason').setup() -require('mason-lspconfig').setup() - --- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed. --- --- Add any additional override configuration in the following tables. They will be passed to --- the `settings` field of the server config. You must look up that documentation yourself. --- --- 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 = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - - lua_ls = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, -} - --- Setup neovim lua configuration -require('neodev').setup() - --- nvim-cmp supports additional completion capabilities, so broadcast that to servers -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - --- Ensure the servers above are installed -local mason_lspconfig = require 'mason-lspconfig' - -mason_lspconfig.setup { - ensure_installed = vim.tbl_keys(servers), -} - -mason_lspconfig.setup_handlers { - function(server_name) - require('lspconfig')[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - settings = servers[server_name], - filetypes = (servers[server_name] or {}).filetypes, - } - end, -} - --- [[ Configure nvim-cmp ]] --- See `:help cmp` -local cmp = require 'cmp' -local luasnip = require 'luasnip' -require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { - completeopt = 'menu,menuone,noinsert', - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - }, -} - -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua new file mode 100644 index 00000000000..957204e8dad --- /dev/null +++ b/lua/kickstart/health.lua @@ -0,0 +1,51 @@ +--[[ +-- +-- This file is not required for your own configuration, +-- but helps people determine if their system is setup correctly. +-- +--]] + +local check_version = function() + if not vim.version.cmp then + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version()))) + return + end + + if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then + vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version()))) + else + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version()))) + end +end + +local check_external_reqs = function() + -- Basic utils: `git`, `make`, `unzip` + for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do + local is_executable = vim.fn.executable(exe) == 1 + if is_executable then + vim.health.ok(string.format("Found executable: '%s'", exe)) + else + vim.health.warn(string.format("Could not find executable: '%s'", exe)) + end + end + + return true +end + +return { + check = function() + vim.health.start 'kickstart.nvim' + + vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` + + Fix only warnings for plugins and languages you intend to use. + Mason will give warnings for languages that are not installed. + You do not need to install, unless you want to use those languages!]] + + local uv = vim.uv or vim.loop + vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) + + check_version() + check_external_reqs() + end, +} diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua deleted file mode 100644 index bc56b15b027..00000000000 --- a/lua/kickstart/plugins/autoformat.lua +++ /dev/null @@ -1,74 +0,0 @@ --- autoformat.lua --- --- Use your language server to automatically format your code on save. --- Adds additional commands as well to manage the behavior - -return { - 'neovim/nvim-lspconfig', - config = function() - -- Switch for controlling whether you want autoformatting. - -- Use :KickstartFormatToggle to toggle autoformatting on or off - local format_is_enabled = true - vim.api.nvim_create_user_command('KickstartFormatToggle', function() - format_is_enabled = not format_is_enabled - print('Setting autoformatting to: ' .. tostring(format_is_enabled)) - end, {}) - - -- Create an augroup that is used for managing our formatting autocmds. - -- We need one augroup per client to make sure that multiple clients - -- can attach to the same buffer without interfering with each other. - local _augroups = {} - local get_augroup = function(client) - if not _augroups[client.id] then - local group_name = 'kickstart-lsp-format-' .. client.name - local id = vim.api.nvim_create_augroup(group_name, { clear = true }) - _augroups[client.id] = id - end - - return _augroups[client.id] - end - - -- Whenever an LSP attaches to a buffer, we will run this function. - -- - -- See `:help LspAttach` for more information about this autocmd event. - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), - -- This is where we attach the autoformatting for reasonable clients - callback = function(args) - local client_id = args.data.client_id - local client = vim.lsp.get_client_by_id(client_id) - local bufnr = args.buf - - -- Only attach to clients that support document formatting - if not client.server_capabilities.documentFormattingProvider then - return - end - - -- Tsserver usually works poorly. Sorry you work with bad languages - -- You can remove this line if you know what you're doing :) - if client.name == 'tsserver' then - return - end - - -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. - vim.api.nvim_create_autocmd('BufWritePre', { - group = get_augroup(client), - buffer = bufnr, - callback = function() - if not format_is_enabled then - return - end - - vim.lsp.buf.format { - async = false, - filter = function(c) - return c.id == client.id - end, - } - end, - }) - end, - }) - end, -} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua new file mode 100644 index 00000000000..ed7f269399f --- /dev/null +++ b/lua/kickstart/plugins/indent_line.lua @@ -0,0 +1,9 @@ +return { + { -- Add indentation guides even on blank lines + 'lukas-reineke/indent-blankline.nvim', + -- Enable `lukas-reineke/indent-blankline.nvim` + -- See `:help ibl` + main = 'ibl', + opts = {}, + }, +} From 1c89b024c8ee1cdeda8cc02e9d434c0dbe08bcba Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 26 Feb 2024 10:45:32 -0500 Subject: [PATCH 078/191] fixup: add autocommand link for help and description --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 0d19b081263..fb569a4a306 100644 --- a/init.lua +++ b/init.lua @@ -184,10 +184,14 @@ 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' }) +-- [[ Basic Autocommands ]] +-- See :help lua-guide-autocommands + -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode -- See `:help vim.highlight.on_yank()` vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() vim.highlight.on_yank() From af4fd2355f211d4d19ec08ea6d57cbea483e2ee7 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 26 Feb 2024 10:46:31 -0500 Subject: [PATCH 079/191] fixup: change comment to reflect auto_install --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index fb569a4a306..1e5691a7e37 100644 --- a/init.lua +++ b/init.lua @@ -775,7 +775,7 @@ require('lazy').setup({ ---@diagnostic disable-next-line: missing-fields require('nvim-treesitter.configs').setup { ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + -- Autoinstall languages that are not installed auto_install = true, highlight = { enable = true }, indent = { enable = true }, From 18b919c61eec1f6ffe91ad21c14e53ce27048b0a Mon Sep 17 00:00:00 2001 From: brxxlstxrs <92815065+brxxlstxrs@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:08:37 +0300 Subject: [PATCH 080/191] add plugin specs docstring, remove lazy.nvim configuration (empty) table (#652) --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 1e5691a7e37..0506b3e64c6 100644 --- a/init.lua +++ b/init.lua @@ -218,7 +218,9 @@ vim.opt.rtp:prepend(lazypath) -- :Lazy update -- -- NOTE: Here is where you install your plugins. -require('lazy').setup({ +require('lazy').setup { + + -- [[ Plugin Specs list ]] -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -808,7 +810,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' }, -}, {}) +} -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 465d6f25c23dc6be27746b758253168adf9cb5bb Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 28 Feb 2024 19:23:13 +0100 Subject: [PATCH 081/191] Change mini.statusline location format to LINE:COLUMN (#659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default mini.statusline location format is: 'cursor line | total lines │ cursor column | total columns' --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 0506b3e64c6..89da77b977e 100644 --- a/init.lua +++ b/init.lua @@ -762,6 +762,9 @@ require('lazy').setup { -- You could remove this setup call if you don't like it, -- and try some other statusline plugin require('mini.statusline').setup() + MiniStatusline.section_location = function() + return '%2l:%-2v' + end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim From b58666dd15fa9abd40c53b4e6b7a1e1c6e586dcb Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Thu, 29 Feb 2024 12:08:01 -0500 Subject: [PATCH 082/191] fixup: updated some style stuff --- init.lua | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 89da77b977e..c81ae2ebaf6 100644 --- a/init.lua +++ b/init.lua @@ -219,9 +219,6 @@ vim.opt.rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup { - - -- [[ Plugin Specs list ]] - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -592,15 +589,11 @@ require('lazy').setup { handlers = { function(server_name) local server = servers[server_name] or {} - require('lspconfig')[server_name].setup { - cmd = server.cmd, - settings = server.settings, - filetypes = server.filetypes, - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for tsserver) - capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}), - } + -- This handles overriding only values explicitly passed + -- 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 {}) + require('lspconfig')[server_name].setup(server) end, }, } @@ -761,9 +754,15 @@ require('lazy').setup { -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - require('mini.statusline').setup() - MiniStatusline.section_location = function() - return '%2l:%-2v' + local statusline = require 'mini.statusline' + statusline.setup() + + -- You can confiure sections in the statusline by overriding their + -- default behavior. For example, here we disable the section for + -- cursor information because line numbers are already enabled + ---@diagnostic disable-next-line: duplicate-set-field + statusline.section_location = function() + return '' end -- ... and there is more! From 38828dcaf7c140902fedeaa75b017bf968400bb0 Mon Sep 17 00:00:00 2001 From: Anton Kastritskii Date: Thu, 29 Feb 2024 18:14:36 +0000 Subject: [PATCH 083/191] feat: enable lua lsp snipppets (#660) --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index c81ae2ebaf6..9146b5f2f6f 100644 --- a/init.lua +++ b/init.lua @@ -562,6 +562,9 @@ require('lazy').setup { -- If lua_ls is really slow on your computer, you can try this instead: -- library = { vim.env.VIMRUNTIME }, }, + completion = { + callSnippet = 'Replace', + }, -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings -- diagnostics = { disable = { 'missing-fields' } }, }, From 94a93643ab76f92435de2db21a41f6476894f8b3 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Sat, 2 Mar 2024 04:07:34 +0700 Subject: [PATCH 084/191] chore: fix typos (#666) --- init.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 9146b5f2f6f..3f53732864f 100644 --- a/init.lua +++ b/init.lua @@ -134,8 +134,8 @@ vim.opt.splitright = true vim.opt.splitbelow = true -- Sets how neovim will display certain whitespace in the editor. --- See :help 'list' --- and :help 'listchars' +-- See `:help 'list'` +-- and `:help 'listchars'` vim.opt.list = true vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } @@ -185,7 +185,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the lower win vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- [[ Basic Autocommands ]] --- See :help lua-guide-autocommands +-- See `:help lua-guide-autocommands` -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode @@ -261,7 +261,7 @@ require('lazy').setup { -- event = 'VeryLazy' -- -- which loads which-key after all the UI elements are loaded. Events can be - -- normal autocommands events (:help autocomd-events). + -- normal autocommands events (`:help autocmd-events`). -- -- Then, because we use the `config` key, the configuration only runs -- after the plugin has been loaded: @@ -434,7 +434,7 @@ require('lazy').setup { -- Neovim. This is where `mason` and related plugins come into play. -- -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, :help lsp-vs-treesitter + -- and elegantly composed help section, `:help lsp-vs-treesitter` -- This function gets run when an LSP attaches to a particular buffer. -- That is to say, every time a new file is opened that is associated with @@ -742,7 +742,7 @@ require('lazy').setup { -- Better Around/Inside textobjects -- -- Examples: - -- - va) - [V]isually select [A]round [)]parenthen + -- - va) - [V]isually select [A]round [)]paren -- - yinq - [Y]ank [I]nside [N]ext [']quote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } @@ -760,7 +760,7 @@ require('lazy').setup { local statusline = require 'mini.statusline' statusline.setup() - -- You can confiure sections in the statusline by overriding their + -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we disable the section for -- cursor information because line numbers are already enabled ---@diagnostic disable-next-line: duplicate-set-field @@ -791,7 +791,7 @@ require('lazy').setup { -- There are additional nvim-treesitter modules that you can use to interact -- with nvim-treesitter. You should go explore a few and see what interests you: -- - -- - Incremental selection: Included, see :help nvim-treesitter-incremental-selection-mod + -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects end, @@ -813,7 +813,7 @@ require('lazy').setup { -- 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 + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- { import = 'custom.plugins' }, } From b99af2d6a361e7332cfd3efb7aa5396d2338e289 Mon Sep 17 00:00:00 2001 From: Taulant Aliraj Date: Sun, 3 Mar 2024 02:07:58 +0000 Subject: [PATCH 085/191] feat: use VimEnter event instead of VeryLazy (#673) --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 3f53732864f..292ec0779a9 100644 --- a/init.lua +++ b/init.lua @@ -258,9 +258,9 @@ require('lazy').setup { -- lazy loading plugins that don't need to be loaded immediately at startup. -- -- For example, in the following configuration, we use: - -- event = 'VeryLazy' + -- event = 'VimEnter' -- - -- which loads which-key after all the UI elements are loaded. Events can be + -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- -- Then, because we use the `config` key, the configuration only runs @@ -269,7 +269,7 @@ require('lazy').setup { { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', - event = 'VeryLazy', -- Sets the loading event to 'VeryLazy' + event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading require('which-key').setup() @@ -293,7 +293,7 @@ require('lazy').setup { { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', - event = 'VeryLazy', + event = 'VimEnter', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', @@ -734,7 +734,7 @@ require('lazy').setup { }, -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', From 23fc4e59dc54dc22f2372cd9a2e4c76ba335f9a1 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 3 Mar 2024 03:12:55 +0100 Subject: [PATCH 086/191] README.md: updated windows install instructions (#674) --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index c9b9d84e87b..0f6911c610c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ Neovim's configurations are located under the following paths, depending on your | Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | | Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | +### Install Kickstart + Clone kickstart.nvim:
Linux and Mac @@ -192,3 +194,23 @@ This requires: ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` + +Alternatively one can install gcc and make which don't require changing the config, +the easiest way is to use choco: + +1. install [chocolatey](https://chocolatey.org/install) +either follow the instructions on the page or use winget, +run in cmd as **admin**: +``` +winget install --accept-source-agreements chocolatey.chocolatey +``` + +2. install all requirements using choco, exit previous cmd and +open a new one so that choco path is set, run in cmd as **admin**: +``` +choco install -y neovim git ripgrep wget fd unzip gzip mingw make +``` + +Then continue with the [Install Kickstart](#Install-Kickstart) step. + + From e6710a461ab08513af80c213929ff64e75b5e456 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Sun, 3 Mar 2024 03:13:16 -0500 Subject: [PATCH 087/191] fix: add note in readme for custom plugins --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0f6911c610c..b6d19f49787 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ can install to your machine using the methods above. #### Examples of adding popularly requested plugins +NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins. +
Adding autopairs From c9122e89e3c2e19cd784642a1d0cddae258d0672 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Mar 2024 01:32:06 +0100 Subject: [PATCH 088/191] fix: checkhealth reported nvim version (#685) --- lua/kickstart/health.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index 957204e8dad..04df77b33e8 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -6,15 +6,16 @@ --]] local check_version = function() + local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) if not vim.version.cmp then - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version()))) + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) return end if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then - vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version()))) + vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version()))) + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) end end From c3127f1226df227e436a62105a1e33ea052f5e56 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Mar 2024 14:16:50 +0100 Subject: [PATCH 089/191] Change statusline location to LINE:COLUMN (#689) --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 292ec0779a9..16d3c26b1ec 100644 --- a/init.lua +++ b/init.lua @@ -761,11 +761,11 @@ require('lazy').setup { statusline.setup() -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we disable the section for - -- cursor information because line numbers are already enabled + -- default behavior. For example, here we set the section for + -- cursor location to LINE:COLUMN ---@diagnostic disable-next-line: duplicate-set-field statusline.section_location = function() - return '' + return '%2l:%-2v' end -- ... and there is more! From a02abdb161bb1db4864254245a27e7d153b41efb Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Mon, 4 Mar 2024 21:47:11 +0800 Subject: [PATCH 090/191] chore: remove trailing spaces from readme (#679) --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b6d19f49787..82eecebda9e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you are experiencing issues, please make sure you have the latest versions. ### Install External Dependencies -> **NOTE** +> **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) External Requirements: @@ -60,13 +60,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ```
@@ -97,7 +97,7 @@ install instructions in this file instead. An updated video is coming soon. (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. -> **NOTE** +> **NOTE** > Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` #### Examples of adding popularly requested plugins @@ -214,5 +214,3 @@ choco install -y neovim git ripgrep wget fd unzip gzip mingw make ``` Then continue with the [Install Kickstart](#Install-Kickstart) step. - - From b83b2b061c1fab0e1a3a28c185345be7957e74cd Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Mon, 4 Mar 2024 21:47:45 +0800 Subject: [PATCH 091/191] chore: link new installation youtube video (#678) --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 82eecebda9e..c44d5f9a5a2 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,7 @@ information about extending and exploring Neovim. ### Getting Started -See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the -previous version. Note: The install via init.lua is outdated, please follow the -install instructions in this file instead. An updated video is coming soon. +[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) ### Recommended Steps From f764b7bacd54a59cf51ab0e2c8e1d397ec5ae174 Mon Sep 17 00:00:00 2001 From: Ryan Winchester Date: Tue, 5 Mar 2024 21:19:06 -0400 Subject: [PATCH 092/191] Add more detail to colorscheme comment (#713) --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 16d3c26b1ec..e8c8693fa6f 100644 --- a/init.lua +++ b/init.lua @@ -725,7 +725,9 @@ require('lazy').setup { lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() - -- Load the colorscheme here + -- Load the colorscheme here. + -- Like many other themes, this one has different styles, and you could load + -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight-night' -- You can configure highlights by doing something like From 66e2a5a425a4f3b2e4f9456d82b29718c24a8993 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 6 Mar 2024 17:49:44 +0100 Subject: [PATCH 093/191] Make the Nerd Font an optional requirement (#716) --- README.md | 2 ++ init.lua | 36 +++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c44d5f9a5a2..6d48c18e546 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons + - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: - If want to write Typescript, you need `npm` - If want to write Golang, you will need `go` diff --git a/init.lua b/init.lua index e8c8693fa6f..3bdb5e36998 100644 --- a/init.lua +++ b/init.lua @@ -90,6 +90,9 @@ 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 +vim.g.have_nerd_font = false + -- [[ Setting options ]] -- See `:help vim.opt` -- NOTE: You can change these options as you wish! @@ -218,7 +221,7 @@ vim.opt.rtp:prepend(lazypath) -- :Lazy update -- -- NOTE: Here is where you install your plugins. -require('lazy').setup { +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 @@ -312,10 +315,8 @@ require('lazy').setup { }, { 'nvim-telescope/telescope-ui-select.nvim' }, - -- Useful for getting pretty icons, but requires special font. - -- If you already have a Nerd Font, or terminal set up with fallback fonts - -- you can enable this - -- { 'nvim-tree/nvim-web-devicons' } + -- Useful for getting pretty icons, but requires a Nerd Font. + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -760,7 +761,8 @@ require('lazy').setup { -- You could remove this setup call if you don't like it, -- and try some other statusline plugin local statusline = require 'mini.statusline' - statusline.setup() + -- set use_icons to true if you have a Nerd Font + statusline.setup { use_icons = vim.g.have_nerd_font } -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for @@ -817,7 +819,27 @@ 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' }, -} +}, { + ui = { + -- If you have a Nerd Font, set icons to an empty table which will use the + -- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table + icons = vim.g.have_nerd_font and {} or { + cmd = '⌘', + config = '🛠', + event = '📅', + ft = '📂', + init = '⚙', + keys = '🗝', + plugin = '🔌', + runtime = '💻', + require = '🌙', + source = '📄', + start = '🚀', + task = '📌', + lazy = '💤 ', + }, + }, +}) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 8fae6798b907d4c980e55011621092d8786e5551 Mon Sep 17 00:00:00 2001 From: Nora Ayesha <160715982+noraayesha@users.noreply.github.com> Date: Sat, 9 Mar 2024 02:26:32 +0600 Subject: [PATCH 094/191] Fix typos and whatnot (#731) --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6d48c18e546..9ed19123c33 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,8 @@ information about extending and exploring Neovim. ### Recommended Steps [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo -(so that you have your own copy that you can modify) and then installing you -can install to your machine using the methods above. +(so that you have your own copy that you can modify) and then install. You +can install it on your machine using the methods above. > **NOTE** > Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` @@ -135,7 +135,7 @@ return {
Adding a file tree plugin -This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. +This will install the tree plugin and add the command `:Neotree` for you. For more information, see the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim). In the file: `lua/custom/plugins/filetree.lua`, add: @@ -162,10 +162,10 @@ return { ### FAQ * What should I do if I already have a pre-existing neovim configuration? - * You should back it up, then delete all files associated with it. + * You should back it up and then delete all associated files. * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` * Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example, you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: ``` alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' ``` @@ -174,9 +174,9 @@ return { * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference - configuration that someone can easily `git clone` as a basis for their own. + configuration that someone can easily use to `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the exact + into smaller parts. A fork of kickstart that does this while maintaining the same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * Discussions on this topic can be found here: @@ -185,19 +185,19 @@ return { ### Windows Installation -Installation may require installing build tools, and updating the run command for `telescope-fzf-native` +Installation may require installing build tools and updating the run command for `telescope-fzf-native` See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) This requires: -- Install CMake, and the Microsoft C++ Build Tools on Windows +- Install CMake and the Microsoft C++ Build Tools on Windows ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` -Alternatively one can install gcc and make which don't require changing the config, +Alternatively, one can install gcc and make which don't require changing the config, the easiest way is to use choco: 1. install [chocolatey](https://chocolatey.org/install) @@ -208,9 +208,9 @@ winget install --accept-source-agreements chocolatey.chocolatey ``` 2. install all requirements using choco, exit previous cmd and -open a new one so that choco path is set, run in cmd as **admin**: +open a new one so that choco path is set, and run in cmd as **admin**: ``` choco install -y neovim git ripgrep wget fd unzip gzip mingw make ``` -Then continue with the [Install Kickstart](#Install-Kickstart) step. +Then, continue with the [Install Kickstart](#Install-Kickstart) step. From 3cfccc01be47259613e39196e6a6901ceecc3a0f Mon Sep 17 00:00:00 2001 From: "name.tar.xz" <54463026+name-tar-xz@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:55:08 +0530 Subject: [PATCH 095/191] use init for colorscheme (#715) --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3bdb5e36998..cfbe00d24af 100644 --- a/init.lua +++ b/init.lua @@ -723,9 +723,8 @@ require('lazy').setup({ -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme` 'folke/tokyonight.nvim', - lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins - config = function() + init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. From 8de494fff222f4fe944338875c339d309ff83d1f Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 11 Mar 2024 22:52:18 +0100 Subject: [PATCH 096/191] README.md: update neo-tree example - remove legacy setting (#744) --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 9ed19123c33..36920a79da3 100644 --- a/README.md +++ b/README.md @@ -140,9 +140,6 @@ This will install the tree plugin and add the command `:Neotree` for you. For mo In the file: `lua/custom/plugins/filetree.lua`, add: ```lua --- Unless you are still migrating, remove the deprecated commands from v1.x -vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - return { "nvim-neo-tree/neo-tree.nvim", version = "*", From c0d6f9892442243b4586c6ef9d246b8b653cf259 Mon Sep 17 00:00:00 2001 From: Ryan Baumgardner <26423650+rbaumgardner93@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:18:45 -0400 Subject: [PATCH 097/191] feat: allow treesitter defaults to be overwritten from custom directory (#732) --- init.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index cfbe00d24af..9216e600ccc 100644 --- a/init.lua +++ b/init.lua @@ -779,17 +779,18 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - config = function() + opts = { + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + -- Autoinstall languages that are not installed + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }, + config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, - } + require('nvim-treesitter.configs').setup(opts) -- There are additional nvim-treesitter modules that you can use to interact -- with nvim-treesitter. You should go explore a few and see what interests you: From cb1f16b8cad0c06eac841a227825d9f23b4acba0 Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Tue, 12 Mar 2024 07:20:39 +0800 Subject: [PATCH 098/191] chore: rename to for consistency (#719) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 9216e600ccc..c570c4c264a 100644 --- a/init.lua +++ b/init.lua @@ -456,7 +456,7 @@ require('lazy').setup({ -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . + -- To jump back, press . map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') -- Find references for the word under your cursor. From 000a5c42b00172dad2d22db3c3c9af2ac7c9dcb0 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 12 Mar 2024 22:06:12 +0100 Subject: [PATCH 099/191] Added folke/neodev.nvim for proper nvim api completion and annotation (#754) Fixes nvim-lua/kickstart.nvim#692 `neodev` configures Lua LSP for your Neovim config, runtime and plugins used for completion, annotations and signatures of Neovim apis With neodev, there's no more need to manually set lua_ls workspace settings which don't seem to work properly anyway as currently nvim api completion does not work. --- init.lua | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index c570c4c264a..04cc6b7a03d 100644 --- a/init.lua +++ b/init.lua @@ -410,6 +410,10 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, + + -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief Aside: **What is LSP?** @@ -551,18 +555,6 @@ require('lazy').setup({ -- capabilities = {}, settings = { Lua = { - runtime = { version = 'LuaJIT' }, - workspace = { - checkThirdParty = false, - -- Tells lua_ls where to find all the Lua files that you have loaded - -- for your neovim configuration. - library = { - '${3rd}/luv/library', - unpack(vim.api.nvim_get_runtime_file('', true)), - }, - -- If lua_ls is really slow on your computer, you can try this instead: - -- library = { vim.env.VIMRUNTIME }, - }, completion = { callSnippet = 'Replace', }, From d8a1dbc4b40fc018f254be3f060061d90ad35185 Mon Sep 17 00:00:00 2001 From: James Karefylakis Date: Wed, 13 Mar 2024 08:12:35 +1100 Subject: [PATCH 100/191] Use `cmp-nvim-lua` as `nvim-cmp` source for neovim Lua API (#696) * Use cmp-nvim-lua as nvim-cmp source for neovim Lua API * Move the dependency to a more suitable place --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 04cc6b7a03d..fe2564868a3 100644 --- a/init.lua +++ b/init.lua @@ -640,6 +640,9 @@ require('lazy').setup({ -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', + -- nvim-cmp source for neovim Lua API + -- so that things like vim.keymap.set, etc. are autocompleted + 'hrsh7th/cmp-nvim-lua', -- If you want to add a bunch of pre-configured snippets, -- you can use this plugin to help you. It even has snippets @@ -701,6 +704,7 @@ require('lazy').setup({ end, { 'i', 's' }), }, sources = { + { name = 'nvim_lua' }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, From b529bc33590cbb81a5916408b2d6001a643e596c Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Tue, 12 Mar 2024 18:09:47 -0400 Subject: [PATCH 101/191] Revert "Use `cmp-nvim-lua` as `nvim-cmp` source for neovim Lua API (#696)" (#755) This reverts commit d8a1dbc4b40fc018f254be3f060061d90ad35185. --- init.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/init.lua b/init.lua index fe2564868a3..04cc6b7a03d 100644 --- a/init.lua +++ b/init.lua @@ -640,9 +640,6 @@ require('lazy').setup({ -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', - -- nvim-cmp source for neovim Lua API - -- so that things like vim.keymap.set, etc. are autocompleted - 'hrsh7th/cmp-nvim-lua', -- If you want to add a bunch of pre-configured snippets, -- you can use this plugin to help you. It even has snippets @@ -704,7 +701,6 @@ require('lazy').setup({ end, { 'i', 's' }), }, sources = { - { name = 'nvim_lua' }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, From 7715b7c2eed1a7e6ea02fd6a99a9f006c792dce4 Mon Sep 17 00:00:00 2001 From: TLW <58749948+TinyLittleWheatley@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:24:49 +0330 Subject: [PATCH 102/191] doc: add info about timeoutlen (#691) Add separate comment for `timeoutlen` option `timeoutlen` option was under unrelated comment with `updatetime` option. --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 04cc6b7a03d..964ff8201f3 100644 --- a/init.lua +++ b/init.lua @@ -130,6 +130,9 @@ vim.opt.signcolumn = 'yes' -- Decrease update time vim.opt.updatetime = 250 + +-- Decrease mapped sequence wait time +-- Displays which-key popup sooner vim.opt.timeoutlen = 300 -- Configure how new splits should be opened From 452e3a73cfc87995c58f8d46effa370da4fd1131 Mon Sep 17 00:00:00 2001 From: Rafael Zasas <42390827+RafaelZasas@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:12:41 +0200 Subject: [PATCH 103/191] Add / cmp mapping to scroll cmp docs (#750) --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 964ff8201f3..26774a53512 100644 --- a/init.lua +++ b/init.lua @@ -674,6 +674,10 @@ require('lazy').setup({ -- Select the [p]revious item [''] = cmp.mapping.select_prev_item(), + -- scroll the documentation window [b]ack / [f]orward + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. From 2f494e59cae64a2d62dc2377ab317a963fa2e5d5 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:35:42 +0100 Subject: [PATCH 104/191] Move friendly snippets to dependencies of LuaSnip (#759) Co-authored-by: TJ DeVries --- init.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 26774a53512..552e16a23ad 100644 --- a/init.lua +++ b/init.lua @@ -635,6 +635,17 @@ require('lazy').setup({ end return 'make install_jsregexp' end)(), + dependencies = { + -- `friendly-snippets` contains a variety of premade snippets. + -- See the README about individual language/framework/plugin snippets: + -- https://github.com/rafamadriz/friendly-snippets + -- { + -- 'rafamadriz/friendly-snippets', + -- config = function() + -- require('luasnip.loaders.from_vscode').lazy_load() + -- end, + -- }, + }, }, 'saadparwaiz1/cmp_luasnip', @@ -643,12 +654,6 @@ require('lazy').setup({ -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', - - -- If you want to add a bunch of pre-configured snippets, - -- you can use this plugin to help you. It even has snippets - -- for various frameworks/libraries/etc. but you will have to - -- set up the ones that are useful for you. - -- 'rafamadriz/friendly-snippets', }, config = function() -- See `:help cmp` From 5ac4b58f85fe14992c5c9ff7fee894a69fff4010 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 15 Mar 2024 11:18:43 -0400 Subject: [PATCH 105/191] doc: add note about advanced luasnip features --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 552e16a23ad..c504ccb6927 100644 --- a/init.lua +++ b/init.lua @@ -711,6 +711,9 @@ require('lazy').setup({ luasnip.jump(-1) end end, { 'i', 's' }), + + -- For more advanced luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, sources = { { name = 'nvim_lsp' }, From 7892c0c354639985b1cf36f11d175201590e267b Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 15 Mar 2024 11:35:07 -0400 Subject: [PATCH 106/191] fix: disable ts indenting for Ruby Tree-sitter indenting for ruby is pretty terrible. But the fix requires a few steps, so showed those and documented how you could do that for other languages as well (with the tricky part being the additional_vim_regex_highlighting trick) --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c504ccb6927..87133ddcfe3 100644 --- a/init.lua +++ b/init.lua @@ -790,8 +790,14 @@ require('lazy').setup({ ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, + highlight = { + enable = true, + -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. + -- If you are experiencing weird indenting issues, add the language to + -- the list of additional_vim_regex_highlighting and disabled languages for indent. + additional_vim_regex_highlighting = { 'ruby' }, + }, + indent = { enable = true, disable = { 'ruby' } }, }, config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` From da1271db4d0e3761c358ec6546b3e9dd175a7962 Mon Sep 17 00:00:00 2001 From: stgpepper <74211382+stgpepper@users.noreply.github.com> Date: Fri, 15 Mar 2024 22:51:41 +0200 Subject: [PATCH 107/191] Update README.md (#763) Added file text to code block for consistency since the other plugin had file also inside code block. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 36920a79da3..0f0bb1b30a9 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,8 @@ This will install the tree plugin and add the command `:Neotree` for you. For mo In the file: `lua/custom/plugins/filetree.lua`, add: ```lua +-- File: lua/custom/plugins/filetree.lua + return { "nvim-neo-tree/neo-tree.nvim", version = "*", From ea4335f5af2fabbf063f8bf946f05583f215f904 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Fri, 15 Mar 2024 21:53:33 +0100 Subject: [PATCH 108/191] conform: disable autoformat on save for specified filetypes (#694) Provide a method to disable autoformat on save lsp fallback for specified filetypes. By default disable for C/C++ as an example, because it does not have a well standardized coding style. Based on conform recipe: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md --- init.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 87133ddcfe3..506bbaf5458 100644 --- a/init.lua +++ b/init.lua @@ -603,10 +603,16 @@ require('lazy').setup({ 'stevearc/conform.nvim', opts = { notify_on_error = false, - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, + format_on_save = function(bufnr) + -- 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 } + return { + timeout_ms = 500, + lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + } + end, formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially From a222805c6120b88f451c3e026b29ea6f761a491e Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 17 Mar 2024 21:22:58 +0100 Subject: [PATCH 109/191] README: additional install recipes for various OS (#767) --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0f0bb1b30a9..e9d31703866 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ External Requirements: - etc. > **NOTE** -> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes +> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes +> and quick install snippets Neovim's configurations are located under the following paths, depending on your OS: @@ -182,8 +183,15 @@ return { * [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) -### Windows Installation +### Install Recipes +Below you can find OS specific install instructions for Neovim and dependencies. + +After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step. + +#### Windows Installation + +
Windows with Microsoft C++ Build Tools and CMake Installation may require installing build tools and updating the run command for `telescope-fzf-native` See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) @@ -195,7 +203,8 @@ This requires: ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` - +
+
Windows with gcc/make using chocolatey Alternatively, one can install gcc and make which don't require changing the config, the easiest way is to use choco: @@ -211,5 +220,41 @@ open a new one so that choco path is set, and run in cmd as **admin**: ``` choco install -y neovim git ripgrep wget fd unzip gzip mingw make ``` +
+
WSL (Windows Subsystem for Linux) + +``` +wsl --install +wsl +sudo add-apt-repository ppa:neovim-ppa/unstable -y +sudo apt update +sudo apt install make gcc ripgrep unzip neovim +``` +
+ +#### Linux Install +
Ubuntu Install Steps + +``` +sudo add-apt-repository ppa:neovim-ppa/unstable -y +sudo apt update +sudo apt install make gcc ripgrep unzip neovim +``` +
+
Debian Install Steps + +``` +sudo apt update +sudo apt install make gcc ripgrep unzip git +echo "deb https://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list +sudo apt update +sudo apt install -t unstable neovim +``` +
+
Fedora Install Steps + +``` +sudo dnf install -y gcc make git ripgrep fd-find neovim +``` +
-Then, continue with the [Install Kickstart](#Install-Kickstart) step. From b81115d002745cdd5aaba5aea98d3677c4a56844 Mon Sep 17 00:00:00 2001 From: Shane Crowley <66971213+edibotopic@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:57:48 +0000 Subject: [PATCH 110/191] assign table to filetype in lua_ls config comment (#770) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 506bbaf5458..6e813f44bcf 100644 --- a/init.lua +++ b/init.lua @@ -554,7 +554,7 @@ require('lazy').setup({ lua_ls = { -- cmd = {...}, - -- filetypes { ...}, + -- filetypes = { ...}, -- capabilities = {}, settings = { Lua = { From 8e24ca32e32b866a0bec443b937fe75bd5756fc8 Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Mon, 18 Mar 2024 15:00:48 +0100 Subject: [PATCH 111/191] feat: add linter plugin (#699) --- init.lua | 1 + lua/kickstart/plugins/lint.lua | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 lua/kickstart/plugins/lint.lua diff --git a/init.lua b/init.lua index 6e813f44bcf..c2428867272 100644 --- a/init.lua +++ b/init.lua @@ -831,6 +831,7 @@ require('lazy').setup({ -- -- 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. diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua new file mode 100644 index 00000000000..7f0dc42fbbf --- /dev/null +++ b/lua/kickstart/plugins/lint.lua @@ -0,0 +1,55 @@ +return { + + { -- Linting + 'mfussenegger/nvim-lint', + event = { 'BufReadPre', 'BufNewFile' }, + config = function() + local lint = require 'lint' + lint.linters_by_ft = { + markdown = { 'markdownlint' }, + } + + -- To allow other plugins to add linters to require('lint').linters_by_ft, + -- instead set linters_by_ft like this: + -- lint.linters_by_ft = lint.linters_by_ft or {} + -- lint.linters_by_ft['markdown'] = { 'markdownlint' } + -- + -- However, note that this will enable a set of default linters, + -- which will cause errors unless these tools are available: + -- { + -- clojure = { "clj-kondo" }, + -- dockerfile = { "hadolint" }, + -- inko = { "inko" }, + -- janet = { "janet" }, + -- json = { "jsonlint" }, + -- markdown = { "vale" }, + -- rst = { "vale" }, + -- ruby = { "ruby" }, + -- terraform = { "tflint" }, + -- text = { "vale" } + -- } + -- + -- You can disable the default linters by setting their filetypes to nil: + -- lint.linters_by_ft['clojure'] = nil + -- lint.linters_by_ft['dockerfile'] = nil + -- lint.linters_by_ft['inko'] = nil + -- lint.linters_by_ft['janet'] = nil + -- lint.linters_by_ft['json'] = nil + -- lint.linters_by_ft['markdown'] = nil + -- lint.linters_by_ft['rst'] = nil + -- lint.linters_by_ft['ruby'] = nil + -- lint.linters_by_ft['terraform'] = nil + -- lint.linters_by_ft['text'] = nil + + -- Create autocommand which carries out the actual linting + -- on the specified events. + local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) + vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { + group = lint_augroup, + callback = function() + require('lint').try_lint() + end, + }) + end, + }, +} From 65a5ac404b56c4718d79f65ac642e19e89346eda Mon Sep 17 00:00:00 2001 From: Togglebit <74262215+togglebyte@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:35:53 +0100 Subject: [PATCH 112/191] Some suggestions and capitalised a few words (#771) --- init.lua | 108 +++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git a/init.lua b/init.lua index c2428867272..013fcc29267 100644 --- a/init.lua +++ b/init.lua @@ -29,7 +29,7 @@ What is Kickstart? what your configuration is doing, and modify it to suit your needs. Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving kickstart just the way it is for a while + make Neovim your own! That might mean leaving Kickstart just the way it is for a while or immediately breaking it into modular pieces. It's up to you! If you don't know anything about Lua, I recommend taking some time to read through @@ -51,32 +51,32 @@ Kickstart Guide: - Tutor - - (If you already know how the Neovim basics, you can skip this step) + (If you already know the Neovim basics, you can skip this step.) Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua + of the kickstart init.lua. Next, run AND READ `:help`. This will open up a help window with some basic information about reading, navigating and searching the builtin help documentation. This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite neovim features. + with something. It's one of my favorite Neovim features. MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not sure exactly what you're looking for. + which is very useful when you're not exactly sure of what you're looking for. I have left several `:help X` comments throughout the init.lua These are hints about where to find more information about the relevant settings, - plugins or neovim features used in kickstart. + plugins or Neovim features used in Kickstart. NOTE: Look for lines like this - Throughout the file. These are for you, the reader, to help understand what is happening. + Throughout the file. These are for you, the reader, to help you understand what is happening. Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your nvim config. + for when you are first encountering a few different constructs in your Neovim config. -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info +If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. I hope you enjoy your Neovim journey, - TJ @@ -100,14 +100,14 @@ vim.g.have_nerd_font = false -- Make line numbers default vim.opt.number = true --- You can also add relative line numbers, for help with jumping. +-- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! -- vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' --- Don't show the mode, since it's already in status line +-- Don't show the mode, since it's already in the status line vim.opt.showmode = false -- Sync clipboard between OS and Neovim. @@ -121,7 +121,7 @@ vim.opt.breakindent = true -- Save undo history vim.opt.undofile = true --- Case-insensitive searching UNLESS \C or capital in search +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term vim.opt.ignorecase = true vim.opt.smartcase = true @@ -139,7 +139,7 @@ vim.opt.timeoutlen = 300 vim.opt.splitright = true vim.opt.splitbelow = true --- Sets how neovim will display certain whitespace in the editor. +-- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` -- and `:help 'listchars'` vim.opt.list = true @@ -220,7 +220,7 @@ vim.opt.rtp:prepend(lazypath) -- -- You can press `?` in this menu for help. Use `:q` to close the window -- --- To update plugins, you can run +-- To update plugins you can run -- :Lazy update -- -- NOTE: Here is where you install your plugins. @@ -241,7 +241,7 @@ require('lazy').setup({ { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration - -- options to `gitsigns.nvim`. This is equivalent to the following lua: + -- options to `gitsigns.nvim`. This is equivalent to the following Lua: -- require('gitsigns').setup({ ... }) -- -- See `:help gitsigns` to understand what the configuration keys do @@ -258,7 +258,7 @@ require('lazy').setup({ }, }, - -- NOTE: Plugins can also be configured to run lua code when they are loaded. + -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- -- This is often very useful to both group configuration, as well as handle -- lazy loading plugins that don't need to be loaded immediately at startup. @@ -303,7 +303,7 @@ require('lazy').setup({ branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for install instructions + { -- If encountering errors, see telescope-fzf-native README for installation instructions 'nvim-telescope/telescope-fzf-native.nvim', -- `build` is used to run some command when the plugin is installed/updated. @@ -326,19 +326,19 @@ require('lazy').setup({ -- it can fuzzy find! It's more than just a "file finder", it can search -- many different aspects of Neovim, your workspace, LSP, and more! -- - -- The easiest way to use telescope, is to start by doing something like: + -- The easiest way to use Telescope, is to start by doing something like: -- :Telescope help_tags -- -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of help_tags options and + -- type in the prompt window. You'll see a list of `help_tags` options and -- a corresponding preview of the help. -- - -- Two important keymaps to use while in telescope are: + -- Two important keymaps to use while in Telescope are: -- - Insert mode: -- - Normal mode: ? -- -- This opens a window that shows you all of the keymaps for the current - -- telescope picker. This is really useful to discover what Telescope can + -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! -- [[ Configure Telescope ]] @@ -360,7 +360,7 @@ require('lazy').setup({ }, } - -- Enable telescope extensions, if they are installed + -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') @@ -379,14 +379,14 @@ require('lazy').setup({ -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. + -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) - -- Also possible to pass additional configuration options. + -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() builtin.live_grep { @@ -395,7 +395,7 @@ require('lazy').setup({ } end, { desc = '[S]earch [/] in Open Files' }) - -- Shortcut for searching your neovim configuration files + -- Shortcut for searching your Neovim configuration files vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) @@ -405,7 +405,7 @@ require('lazy').setup({ { -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { - -- Automatically install LSPs and related tools to stdpath for neovim + -- Automatically install LSPs and related tools to stdpath for Neovim 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -419,15 +419,15 @@ require('lazy').setup({ { 'folke/neodev.nvim', opts = {} }, }, config = function() - -- Brief Aside: **What is LSP?** + -- Brief aside: **What is LSP?** -- - -- LSP is an acronym you've probably heard, but might not understand what it is. + -- LSP is an initialism you've probably heard, but might not understand what it is. -- -- LSP stands for Language Server Protocol. It's a protocol that helps editors -- and language tooling communicate in a standardized fashion. -- -- In general, you have a "server" which is some tool built to understand a particular - -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc). These Language Servers + -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone -- processes that communicate with some "client" - in this case, Neovim! -- @@ -451,9 +451,8 @@ require('lazy').setup({ vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), callback = function(event) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. + -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself. -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. @@ -482,11 +481,11 @@ require('lazy').setup({ -- Symbols are things like variables, functions, types, etc. map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - -- Fuzzy find all the symbols in your current workspace - -- Similar to document symbols, except searches over your whole project. + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - -- Rename the variable under your cursor + -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. map('rn', vim.lsp.buf.rename, '[R]e[n]ame') @@ -495,11 +494,11 @@ require('lazy').setup({ map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') -- Opens a popup that displays documentation about the word under your cursor - -- See `:help K` for why this keymap + -- See `:help K` for why this keymap. map('K', vim.lsp.buf.hover, 'Hover Documentation') -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header + -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') -- The following two autocommands are used to highlight references of the @@ -523,7 +522,7 @@ require('lazy').setup({ }) -- 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. + -- 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. -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. local capabilities = vim.lsp.protocol.make_client_capabilities() @@ -573,14 +572,14 @@ require('lazy').setup({ -- other tools, you can run -- :Mason -- - -- You can press `g?` for help in this menu + -- You can press `g?` for help in this menu. require('mason').setup() -- You can add other tools here that you want Mason to install -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { - 'stylua', -- Used to format lua code + 'stylua', -- Used to format Lua code }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -633,9 +632,9 @@ require('lazy').setup({ { 'L3MON4D3/LuaSnip', build = (function() - -- 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 + -- 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 @@ -685,7 +684,7 @@ require('lazy').setup({ -- Select the [p]revious item [''] = cmp.mapping.select_prev_item(), - -- scroll the documentation window [b]ack / [f]orward + -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), @@ -718,7 +717,7 @@ require('lazy').setup({ end end, { 'i', 's' }), - -- For more advanced luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, sources = { @@ -732,18 +731,18 @@ require('lazy').setup({ { -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is + -- change the command in the config to whatever the name of that colorscheme is. -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme` + -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. 'folke/tokyonight.nvim', - priority = 1000, -- make sure to load this before all the other start plugins + priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight-night' - -- You can configure highlights by doing something like + -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' end, }, @@ -788,7 +787,6 @@ require('lazy').setup({ -- Check out: https://github.com/echasnovski/mini.nvim end, }, - { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -822,11 +820,11 @@ require('lazy').setup({ -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- put them in the right spots if you want. + -- place them in the correct locations. - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for kickstart + -- 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. + -- 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', @@ -841,8 +839,8 @@ require('lazy').setup({ -- { import = 'custom.plugins' }, }, { ui = { - -- If you have a Nerd Font, set icons to an empty table which will use the - -- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table + -- If you are using a Nerd Font: set icons to an empty table which will use the + -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table icons = vim.g.have_nerd_font and {} or { cmd = '⌘', config = '🛠', From 773e482d4b40cec4095e4b60fbd753cb69b3f51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Sarasola?= Date: Mon, 18 Mar 2024 22:38:14 +0100 Subject: [PATCH 113/191] Add nvim-nio as dependency for nvim-dap-ui (#774) It's a dependency now --- lua/kickstart/plugins/debug.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7fc783fabd4..7be4abdbd96 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -14,6 +14,9 @@ return { -- Creates a beautiful debugger UI 'rcarriga/nvim-dap-ui', + -- Required dependency for nvim-dap-ui + 'nvim-neotest/nvim-nio', + -- Installs the debug adapters for you 'williamboman/mason.nvim', 'jay-babu/mason-nvim-dap.nvim', From 4c02e29e49bf2e3b478f751f9dd78ae4b138232a Mon Sep 17 00:00:00 2001 From: E <2061889+bozoputer@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:27:18 -0400 Subject: [PATCH 114/191] Update README.md (#781) The recommended step of forking the repo coming sequentially after the step instructing users to clone the current repo doesn't make sense. This commit orders the install instructions in a manner that's more logical. --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e9d31703866..82ca52c9726 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,16 @@ Neovim's configurations are located under the following paths, depending on your ### Install Kickstart -Clone kickstart.nvim: +#### Recommended Step + +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. + +> **NOTE** +> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` + +#### Clone kickstart.nvim +> **NOTE** +> If following the recommended step above (i.e., forking the repo), replace `nvim-lua` with `` in the commands below
Linux and Mac @@ -88,18 +97,6 @@ current plugin status. Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. -### Getting Started - -[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) - -### Recommended Steps - -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo -(so that you have your own copy that you can modify) and then install. You -can install it on your machine using the methods above. - -> **NOTE** -> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` #### Examples of adding popularly requested plugins @@ -159,6 +156,10 @@ return {
+### Getting Started + +[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) + ### FAQ * What should I do if I already have a pre-existing neovim configuration? From dbba54cfd81506a20832aade85735bf4dc377b95 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 21 Mar 2024 20:47:55 +0100 Subject: [PATCH 115/191] README: wrap long lines (#784) --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 82ca52c9726..531c2fe1a02 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,20 @@ Neovim's configurations are located under the following paths, depending on your #### Recommended Step -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo +so that you have your own copy that you can modify, then install by cloning the +fork to your machine using one of the commands below, depending on your OS. + + > **NOTE** -> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` +> Your fork's url will be something like this: +> `https://github.com//kickstart.nvim.git` #### Clone kickstart.nvim > **NOTE** -> If following the recommended step above (i.e., forking the repo), replace `nvim-lua` with `` in the commands below +> If following the recommended step above (i.e., forking the repo), replace +> `nvim-lua` with `` in the commands below
Linux and Mac @@ -105,7 +111,9 @@ NOTE: You'll need to uncomment the line in the init.lua that turns on loading cu
Adding autopairs -This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). +This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) +and enable it on startup. For more information, see documentation for +[lazy.nvim](https://github.com/folke/lazy.nvim). In the file: `lua/custom/plugins/autopairs.lua`, add: @@ -133,7 +141,9 @@ return {
Adding a file tree plugin -This will install the tree plugin and add the command `:Neotree` for you. For more information, see the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim). +This will install the tree plugin and add the command `:Neotree` for you. +For more information, see the documentation at +[neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim). In the file: `lua/custom/plugins/filetree.lua`, add: @@ -164,13 +174,19 @@ return { * What should I do if I already have a pre-existing neovim configuration? * You should back it up and then delete all associated files. - * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` + * This includes your existing init.lua and the neovim files in `~/.local` + which can be deleted with `rm -rf ~/.local/share/nvim/` * Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example, you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` + to maintain multiple configurations. For example, you can install the kickstart + configuration in `~/.config/nvim-kickstart` and create an alias: ``` alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' ``` - When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. + When you run Neovim using `nvim-kickstart` alias it will use the alternative + config directory and the matching local directory + `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim + distribution that you would like to try out. * What if I want to "uninstall" this configuration: * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? From 2877a60e00e661fd716f8fc4f772dee0860f5036 Mon Sep 17 00:00:00 2001 From: Liu Qisheng <81770798+Saplyn@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:16:48 +0800 Subject: [PATCH 116/191] fix #799 (#800) Add `'luadoc'`, to the `ensure_installed` of `nvim-treesitter/nvim-treesitter` --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 013fcc29267..db55a9e8fd6 100644 --- a/init.lua +++ b/init.lua @@ -791,7 +791,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From 93fde0556e82ead2a5392ccb678359fa59437b98 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Wed, 27 Mar 2024 11:22:28 -0400 Subject: [PATCH 117/191] Add instructions to quit :lazy. Fixes #761 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 531c2fe1a02..3453cfad5c1 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ nvim ``` That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -current plugin status. +current plugin status. Hit `q` to close the window. Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. From 1175f6d25a84146fda2eb16236d2a21ae30cc7b1 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 31 Mar 2024 19:36:43 +0200 Subject: [PATCH 118/191] Add a keymap space-f to format buffer using conform (#817) This works also for visual range selection Copied from conform recipe: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index db55a9e8fd6..667fb9c5138 100644 --- a/init.lua +++ b/init.lua @@ -600,6 +600,16 @@ require('lazy').setup({ { -- Autoformat 'stevearc/conform.nvim', + keys = { + { + 'f', + function() + require('conform').format { async = true, lsp_fallback = true } + end, + mode = '', + desc = '[F]ormat buffer', + }, + }, opts = { notify_on_error = false, format_on_save = function(bufnr) From d605b840a2697de9f6e7277787b7e415aec602da Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 1 Apr 2024 02:00:11 +0200 Subject: [PATCH 119/191] Don't lazy load conform plugin (#818) --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 667fb9c5138..496f45b85b1 100644 --- a/init.lua +++ b/init.lua @@ -600,6 +600,7 @@ require('lazy').setup({ { -- Autoformat 'stevearc/conform.nvim', + lazy = false, keys = { { 'f', From 19afab164183a5e80d8f7e7ae9df6b57e26a4a48 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 1 Apr 2024 16:36:32 +0200 Subject: [PATCH 120/191] README: move backup and paths from external deps to install section (#819) --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3453cfad5c1..5ca19d7a07c 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,6 @@ If you are experiencing issues, please make sure you have the latest versions. ### Install External Dependencies -> **NOTE** -> [Backup](#FAQ) your previous configuration (if any exists) - External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) @@ -38,6 +35,11 @@ External Requirements: > See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes > and quick install snippets +### Install Kickstart + +> **NOTE** +> [Backup](#FAQ) your previous configuration (if any exists) + Neovim's configurations are located under the following paths, depending on your OS: | OS | PATH | @@ -46,16 +48,12 @@ Neovim's configurations are located under the following paths, depending on your | Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | | Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | -### Install Kickstart - #### Recommended Step [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. - - > **NOTE** > Your fork's url will be something like this: > `https://github.com//kickstart.nvim.git` From c4363e4ad8aa3269a581d89b1e11403dd89df291 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 4 Apr 2024 16:31:37 +0200 Subject: [PATCH 121/191] Add a pull request template (#825) --- .github/pull_request_template.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..f401c9ffd9c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ +*************************************************************************** +**NOTE** +Please verify that the `base repository` above has the intended destination! +Github by default opens Pull Requests against the parent of a forked repository. +If this is your personal fork and you didn't intend to open a PR for contribution +to the original project then adjust the `base repository` accordingly. +************************************************************************** + From 23773900d9a2e1079a1a04d31adce5c5e901db6f Mon Sep 17 00:00:00 2001 From: Viet <51826956+hoangvietdo@users.noreply.github.com> Date: Tue, 9 Apr 2024 05:13:22 +0900 Subject: [PATCH 122/191] Update README (#832) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ca19d7a07c..4dd8ac873d4 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ sudo apt install make gcc ripgrep unzip neovim ``` sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update -sudo apt install make gcc ripgrep unzip neovim +sudo apt install make gcc ripgrep unzip git neovim ```
Debian Install Steps From e2bfa0c66f474f7d8863a8bc05e3d5bdf704f7bf Mon Sep 17 00:00:00 2001 From: rdvm Date: Tue, 16 Apr 2024 10:29:27 -0500 Subject: [PATCH 123/191] Arch, btw (#852) * Arch, btw * Add unzip * Add unzip for Fedora and --needed arg for Arch --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4dd8ac873d4..e67b94a3b6b 100644 --- a/README.md +++ b/README.md @@ -269,7 +269,14 @@ sudo apt install -t unstable neovim
Fedora Install Steps ``` -sudo dnf install -y gcc make git ripgrep fd-find neovim +sudo dnf install -y gcc make git ripgrep fd-find unzip neovim +``` +
+ +
Arch Install Steps + +``` +sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim ```
From fabeb86d8bb6cf1df5e05377f3abca10e4a25a24 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 17 Apr 2024 15:59:14 +0200 Subject: [PATCH 124/191] Comment about nerd font selection. Fixes #853 (#854) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 496f45b85b1..1d922dfc52c 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 +-- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = false -- [[ Setting options ]] From 6d6b3f38c1e243e2fd8f96b6b6eff1720c110cab Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Wed, 17 Apr 2024 14:02:24 -0400 Subject: [PATCH 125/191] Fix: #847 - add prefer_git to treesitter config (#856) --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 1d922dfc52c..cc49351ed52 100644 --- a/init.lua +++ b/init.lua @@ -817,6 +817,8 @@ 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) From 5540527fabc2776cf62b63ef511079b1c8bf5297 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:04:55 +0200 Subject: [PATCH 126/191] Enable inlay hints for the supporting servers (#843) --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index cc49351ed52..4bd9b7f583d 100644 --- a/init.lua +++ b/init.lua @@ -286,6 +286,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' }, } end, }, @@ -518,6 +519,16 @@ require('lazy').setup({ 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(0, not vim.lsp.inlay_hint.is_enabled()) + end, '[T]oggle Inlay [H]ints') + end end, }) From 5e258d276fef52cc45a17021dc83a95748a0bc7f Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 17 Apr 2024 21:25:54 +0200 Subject: [PATCH 127/191] Move plugin examples from README to optional plugin files (#831) * Move autopairs example from README to an optional plugin * Move neo-tree example from README to an optional plugin --- README.md | 65 +---------------------------- init.lua | 2 + lua/kickstart/plugins/autopairs.lua | 16 +++++++ lua/kickstart/plugins/neo-tree.lua | 25 +++++++++++ 4 files changed, 45 insertions(+), 63 deletions(-) create mode 100644 lua/kickstart/plugins/autopairs.lua create mode 100644 lua/kickstart/plugins/neo-tree.lua diff --git a/README.md b/README.md index e67b94a3b6b..a427def240a 100644 --- a/README.md +++ b/README.md @@ -99,71 +99,10 @@ That's it! Lazy will install all the plugins you have. Use `:Lazy` to view current plugin status. Hit `q` to close the window. Read through the `init.lua` file in your configuration folder for more -information about extending and exploring Neovim. +information about extending and exploring Neovim. That includes also +examples of adding popularly requested plugins. -#### Examples of adding popularly requested plugins - -NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins. - -
- Adding autopairs - -This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) -and enable it on startup. For more information, see documentation for -[lazy.nvim](https://github.com/folke/lazy.nvim). - -In the file: `lua/custom/plugins/autopairs.lua`, add: - -```lua --- File: lua/custom/plugins/autopairs.lua - -return { - "windwp/nvim-autopairs", - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require("nvim-autopairs").setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require('nvim-autopairs.completion.cmp') - local cmp = require('cmp') - cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() - ) - end, -} -``` - -
-
- Adding a file tree plugin - -This will install the tree plugin and add the command `:Neotree` for you. -For more information, see the documentation at -[neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim). - -In the file: `lua/custom/plugins/filetree.lua`, add: - -```lua --- File: lua/custom/plugins/filetree.lua - -return { - "nvim-neo-tree/neo-tree.nvim", - version = "*", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - }, - config = function () - require('neo-tree').setup {} - end, -} -``` - -
- ### Getting Started [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) diff --git a/init.lua b/init.lua index 4bd9b7f583d..21d7df83780 100644 --- a/init.lua +++ b/init.lua @@ -854,6 +854,8 @@ 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', -- 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. diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua new file mode 100644 index 00000000000..87a7e5ffa2e --- /dev/null +++ b/lua/kickstart/plugins/autopairs.lua @@ -0,0 +1,16 @@ +-- autopairs +-- https://github.com/windwp/nvim-autopairs + +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua new file mode 100644 index 00000000000..c793b885bc6 --- /dev/null +++ b/lua/kickstart/plugins/neo-tree.lua @@ -0,0 +1,25 @@ +-- Neo-tree is a Neovim plugin to browse the file system +-- https://github.com/nvim-neo-tree/neo-tree.nvim + +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + cmd = 'Neotree', + keys = { + { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, + }, + opts = { + filesystem = { + window = { + mappings = { + ['\\'] = 'close_window', + }, + }, + }, + }, +} From f5c9fe8e15aafb6857706e3c05b5eee4ecb98a2b Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 18 Apr 2024 03:00:39 +0200 Subject: [PATCH 128/191] Add gitsigns recommended keymaps as an optional plugin (#858) --- init.lua | 6 +++ lua/kickstart/plugins/gitsigns.lua | 61 ++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 lua/kickstart/plugins/gitsigns.lua diff --git a/init.lua b/init.lua index 21d7df83780..a182828eebf 100644 --- a/init.lua +++ b/init.lua @@ -287,7 +287,12 @@ require('lazy').setup({ ['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, }, @@ -856,6 +861,7 @@ require('lazy').setup({ -- 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. diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua new file mode 100644 index 00000000000..4bcc70f4c79 --- /dev/null +++ b/lua/kickstart/plugins/gitsigns.lua @@ -0,0 +1,61 @@ +-- Adds git related signs to the gutter, as well as utilities for managing changes +-- NOTE: gitsigns is already included in init.lua but contains only the base +-- config. This will add also the recommended keymaps. + +return { + { + 'lewis6991/gitsigns.nvim', + opts = { + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' + end + end, { desc = 'Jump to next git [c]hange' }) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, { desc = 'Jump to previous git [c]hange' }) + + -- Actions + -- visual mode + map('v', 'hs', function() + gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'stage git hunk' }) + map('v', 'hr', function() + gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'reset git hunk' }) + -- normal mode + map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) + map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) + map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) + map('n', 'hD', function() + gitsigns.diffthis '@' + end, { desc = 'git [D]iff against last commit' }) + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) + map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) + end, + }, + }, +} From b07176aef66948fa9de810174d3fc8a780eb8953 Mon Sep 17 00:00:00 2001 From: GameFuzzy Date: Fri, 19 Apr 2024 19:50:42 +0200 Subject: [PATCH 129/191] fix: restore Mason config timing for DAP startup (again) (#865) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a182828eebf..62d2c5cfe8c 100644 --- a/init.lua +++ b/init.lua @@ -412,7 +412,7 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim - 'williamboman/mason.nvim', + { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', From 931ec5c226b8440fa3ed066a6a2fbe78e29bf5e1 Mon Sep 17 00:00:00 2001 From: Evan Carroll Date: Sat, 20 Apr 2024 10:55:01 -0500 Subject: [PATCH 130/191] Update README.md (#860) Attempted fix for #859, provide reasonable Debian install instructions -- comment on GitHub issue with refinement. --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a427def240a..4cb89536d7c 100644 --- a/README.md +++ b/README.md @@ -200,9 +200,14 @@ sudo apt install make gcc ripgrep unzip git neovim ``` sudo apt update sudo apt install make gcc ripgrep unzip git -echo "deb https://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list -sudo apt update -sudo apt install -t unstable neovim + +# Now we install nvim +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz +sudo rm -rf /opt/nvim +sudo tar -C /opt -xzf nvim-linux64.tar.gz + +# make it available in /usr/local/bin, distro installs to /usr/bin +sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/ ```
Fedora Install Steps From 9f5176fc2a30fbf5f0601ba1c84a345a4943bac2 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sat, 20 Apr 2024 19:14:24 +0200 Subject: [PATCH 131/191] Minor improvements of debian install instructions. Fixes #859 (#869) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4cb89536d7c..dd51f209b38 100644 --- a/README.md +++ b/README.md @@ -199,11 +199,13 @@ sudo apt install make gcc ripgrep unzip git neovim ``` sudo apt update -sudo apt install make gcc ripgrep unzip git +sudo apt install make gcc ripgrep unzip git curl # Now we install nvim curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -sudo rm -rf /opt/nvim +sudo rm -rf /opt/nvim-linux64 +sudo mkdir -p /opt/nvim-linux64 +sudo chmod a+rX /opt/nvim-linux64 sudo tar -C /opt -xzf nvim-linux64.tar.gz # make it available in /usr/local/bin, distro installs to /usr/bin From 2e68a2c2532d1575b717721a34efa033f4d7a88e Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sat, 20 Apr 2024 19:14:49 +0200 Subject: [PATCH 132/191] Add a commented out example of the classic complete keymaps. Fixes #866 (#868) --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.lua b/init.lua index 62d2c5cfe8c..3c70d7364af 100644 --- a/init.lua +++ b/init.lua @@ -720,6 +720,12 @@ require('lazy').setup({ -- 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(), + -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display -- completions whenever it has completion options available. From f92fb11d681a29f02ba144227142dfcf18297da7 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:27:13 +0200 Subject: [PATCH 133/191] Fix deprecation notice of inlay hints (#873) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3c70d7364af..256da5b8d6f 100644 --- a/init.lua +++ b/init.lua @@ -531,7 +531,7 @@ require('lazy').setup({ -- 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(0, not vim.lsp.inlay_hint.is_enabled()) + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end, '[T]oggle Inlay [H]ints') end end, From 81f270a704ffe428ffe221122e0b1604567ae6cd Mon Sep 17 00:00:00 2001 From: Francis Belanger Date: Mon, 22 Apr 2024 11:43:10 -0400 Subject: [PATCH 134/191] Fix highlight errors when lsp crash or stop (#864) * Fix highlight errors when lsp crash or stop It adds a check wether the client is still available before highlighting. If the client is not there anymore it returns `true` to unregister the autocommand This fix the `method textDocument/documentHighlight is not supported by any of the servers registered for the current buffer` errors when doing a LspRestart or the server crashes * Delete the highlight autocommands in the LspDetatch event * Only delete autocmds for the current buffer with the group name * Simplify clearing the autocommands --------- Co-authored-by: Francis Belanger --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index 256da5b8d6f..ccca32c815f 100644 --- a/init.lua +++ b/init.lua @@ -514,13 +514,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 = true }) 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 @@ -537,6 +540,14 @@ 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 942b26184c06f7fbeb276f3df0a829f02a752657 Mon Sep 17 00:00:00 2001 From: Francis Belanger Date: Mon, 22 Apr 2024 15:53:45 -0400 Subject: [PATCH 135/191] fix: highlight group clear on each attach (#874) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ccca32c815f..036eefb8c3b 100644 --- a/init.lua +++ b/init.lua @@ -514,7 +514,7 @@ 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 = true }) + 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, From 8df3deb6fe7d8adf6957bc649b171f0ffde7f1ad Mon Sep 17 00:00:00 2001 From: Adolfo Gante Date: Mon, 22 Apr 2024 14:15:42 -0700 Subject: [PATCH 136/191] Update README.md (#875) Line 102. Placed 'also' before the 'includes'. "That includes also examples of adding popularly requested plugins." ---> "That also includes examples of adding popularly requested plugins." --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd51f209b38..be313bdb565 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ That's it! Lazy will install all the plugins you have. Use `:Lazy` to view current plugin status. Hit `q` to close the window. Read through the `init.lua` file in your configuration folder for more -information about extending and exploring Neovim. That includes also +information about extending and exploring Neovim. That also includes examples of adding popularly requested plugins. From b7d5cc8f426e1e3b6c52f79cbb2d1b3f81e7f31c Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sat, 27 Apr 2024 22:40:27 +0200 Subject: [PATCH 137/191] README: add clipboard tool dependency (#886) Fixes: #884 Neovim requires an external tool for proper system clipboard integration. Some systems install this already by default: - on Fedora xsel is already installed by default - on Windows using the choko install the win32yank is alredy installed This is not installed by default on ubuntu or debian so adding that to the dependencies list and to the install instructions snippets. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index be313bdb565..f445b65ecd5 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- Clipboard tool (xclip/xsel/win32yank or other depending on platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: @@ -182,7 +183,7 @@ wsl --install wsl sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update -sudo apt install make gcc ripgrep unzip neovim +sudo apt install make gcc ripgrep unzip git xclip neovim ```
@@ -192,14 +193,14 @@ sudo apt install make gcc ripgrep unzip neovim ``` sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update -sudo apt install make gcc ripgrep unzip git neovim +sudo apt install make gcc ripgrep unzip git xclip neovim ```
Debian Install Steps ``` sudo apt update -sudo apt install make gcc ripgrep unzip git curl +sudo apt install make gcc ripgrep unzip git xclip curl # Now we install nvim curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz From 6f6f38a6b5059787d8d92b313f6e1b2c722389b0 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 2 May 2024 22:53:07 +0200 Subject: [PATCH 138/191] 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 036eefb8c3b..457ad214873 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 139/191] 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 457ad214873..88658ef3033 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 140/191] 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 7be4abdbd96..d4d146594e0 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 141/191] 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 d4d146594e0..31dfecf5b38 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 f5c919558b57afa7bdb921f4538c31ad9fcef9c2 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:05:40 +0200 Subject: [PATCH 142/191] which-key v3 update (#1022) * which-key v3 update * remove unneeded brackets from which-key registration --- init.lua | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 88658ef3033..907ef90ce0b 100644 --- a/init.lua +++ b/init.lua @@ -280,19 +280,15 @@ require('lazy').setup({ require('which-key').setup() -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['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' }, + require('which-key').add { + { 'c', group = '[C]ode' }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) end, }, From 3e55ff1a83dc7a9813d8f2220cefd90b07aacdab Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 18:06:47 +0200 Subject: [PATCH 143/191] fix(lazy): added error handling for bootstrap (#1001) --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 907ef90ce0b..f5205cafde6 100644 --- a/init.lua +++ b/init.lua @@ -209,7 +209,10 @@ vim.api.nvim_create_autocmd('TextYankPost', { local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) From 2df5137e59c28fc9148148db8ed4a9f7abf73b4f Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 17 Jul 2024 21:37:31 -0400 Subject: [PATCH 144/191] fix: add required parsers from nvim-treesitter --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f5205cafde6..624e23d87fe 100644 --- a/init.lua +++ b/init.lua @@ -834,7 +834,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From 202910d3fae9a9b9e4f3f390fc69e36e6350180c Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 21 Jul 2024 22:22:10 +0200 Subject: [PATCH 145/191] Fix neo-tree keymap description (#932) The lazy.nvim keys parameter does not need the `desc` to be inside a table in the way that vim.keymap.set() does. With this fix the keymap description will be properly shown for example in telescope keymap search --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c793b885bc6..f126d68af2c 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,7 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal' }, }, opts = { filesystem = { From 1cdf6fb377f4594f803b5aa675777635b6d18074 Mon Sep 17 00:00:00 2001 From: Tom Kuson Date: Sun, 21 Jul 2024 22:22:44 +0200 Subject: [PATCH 146/191] Remove redundant require (#959) --- lua/kickstart/plugins/lint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 7f0dc42fbbf..ca9bc237904 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -47,7 +47,7 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - require('lint').try_lint() + lint.try_lint() end, }) end, From 4bbca64157af07cf0550c16d336cfd7513d10946 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:24:57 +0200 Subject: [PATCH 147/191] Make debug lazy loadable (#978) --- lua/kickstart/plugins/debug.lua | 35 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 31dfecf5b38..196f2c6dbd6 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,6 +24,28 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', }, + keys = function(_, keys) + local dap = require 'dap' + local dapui = require 'dapui' + return { + -- Basic debugging keymaps, feel free to change to your liking! + { '', dap.continue, desc = 'Debug: Start/Continue' }, + { '', dap.step_into, desc = 'Debug: Step Into' }, + { '', dap.step_over, desc = 'Debug: Step Over' }, + { '', dap.step_out, desc = 'Debug: Step Out' }, + { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, + { + 'B', + function() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Debug: Set Breakpoint', + }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { '', dapui.toggle, desc = 'Debug: See last session result.' }, + unpack(keys), + } + end, config = function() local dap = require 'dap' local dapui = require 'dapui' @@ -45,16 +67,6 @@ return { }, } - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Breakpoint' }) - -- Dap UI setup -- For more information, see |:help nvim-dap-ui| dapui.setup { @@ -77,9 +89,6 @@ return { }, } - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) - dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From c405d3fd4f5e105c3c7a43dcddcb96f01ca70dee Mon Sep 17 00:00:00 2001 From: Artyom <84637383+MZhuvka@users.noreply.github.com> Date: Sun, 21 Jul 2024 23:33:26 +0300 Subject: [PATCH 148/191] Update README.md | %userprofile%\appdata\local -> %localappdata% (#963) - Replace `%userprofile%\AppData\Local\nvim\` and `$env:USERPROFILE\AppData\Local\nvim` to `%localappdata%\nvim` and `$env:LOCALAPPDATA\nvim respectfully` --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f445b65ecd5..3f19854cd20 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ Neovim's configurations are located under the following paths, depending on your | OS | PATH | | :- | :--- | | Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | -| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | +| Windows (cmd)| `%localappdata%\nvim\` | +| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | #### Recommended Step @@ -77,13 +77,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\ ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\ ```
From b36d84ddf0b88ab71593d25bf68b48cae9d578eb Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:34:17 +0200 Subject: [PATCH 149/191] Make conform.nvim be lazy-loadable again (#977) The PR that disabled lazy loading (#818) was to fix plugin not being loaded before write. This sets up lazy to load conform before write. --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 624e23d87fe..de4264b2f04 100644 --- a/init.lua +++ b/init.lua @@ -626,7 +626,8 @@ require('lazy').setup({ { -- Autoformat 'stevearc/conform.nvim', - lazy = false, + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, keys = { { 'f', From 07a9f446a30487439a6c922a7b4a4aa5756ee1d9 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 21 Jul 2024 13:34:51 -0700 Subject: [PATCH 150/191] Fix comment about mini.ai example (#985) This example wasn't using `'` so this makes more sense --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index de4264b2f04..8e252894c45 100644 --- a/init.lua +++ b/init.lua @@ -801,7 +801,7 @@ require('lazy').setup({ -- -- Examples: -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [']quote + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } From 7513ec8a7dd579957ce2d9b44e05c1da18d7d0e3 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:35:07 +0200 Subject: [PATCH 151/191] Neovim 0.10 updates (#936) * Neovim 0.10 updates Provide the buffer for which to enable inlay hints Co-authored-by: Matt Mirus * refactor: replace vim.loop with vim.uv * Upgrade folke/neodev (sunsetting) to folke/lazydev * Update checkhealth for 0.10 release --------- Co-authored-by: Matt Mirus Co-authored-by: mrr11k Co-authored-by: Seb Tomasini --- init.lua | 29 +++++++++++------------------ lua/kickstart/health.lua | 6 +++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/init.lua b/init.lua index 8e252894c45..a1c900f5ec1 100644 --- a/init.lua +++ b/init.lua @@ -162,9 +162,6 @@ vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -207,7 +204,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ 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' -if not vim.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then @@ -237,11 +234,6 @@ require('lazy').setup({ -- -- Use `opts = {}` to force a plugin to be loaded. -- - -- This is equivalent to: - -- require('Comment').setup({}) - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -419,9 +411,9 @@ require('lazy').setup({ -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/lazydev.nvim', ft = 'lua', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -498,10 +490,6 @@ require('lazy').setup({ -- or a suggestion from your LSP for this to activate. map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - -- Opens a popup that displays documentation about the word under your cursor - -- See `:help K` for why this keymap. - map('K', vim.lsp.buf.hover, 'Hover Documentation') - -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -512,7 +500,7 @@ 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 + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -539,9 +527,9 @@ require('lazy').setup({ -- 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 + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, @@ -765,6 +753,11 @@ require('lazy').setup({ -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, sources = { + { + name = 'lazydev', + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it + group_index = 0, + }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index 04df77b33e8..b59d08649af 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -6,13 +6,13 @@ --]] local check_version = function() - local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) - if not vim.version.cmp then + local verstr = tostring(vim.version()) + if not vim.version.ge then vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) return end - if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then + if vim.version.ge(vim.version(), '0.10-dev') then vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) From 620732789b56ba7770bf12211ad2820309136ff1 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 21 Jul 2024 19:08:09 -0700 Subject: [PATCH 152/191] Update lazydev config to fix "Undefined field `fs_stat`" LSP error (#1040) 7513ec8a7dd579957ce2d9b44e05c1da18d7d0e3 switched from neodev to lazydev, but in the process it introduced an LSP error in `init.lua`, which degrades the desired "first timer" experience of kickstart.nvim. This commit follows the configuration suggested in https://github.com/folke/lazydev.nvim/tree/6184ebbbc8045d70077659b7d30c705a588dc62f#-installation which resolves the LSP error. --- init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a1c900f5ec1..77181309c0e 100644 --- a/init.lua +++ b/init.lua @@ -413,7 +413,17 @@ require('lazy').setup({ -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/lazydev.nvim', ft = 'lua', opts = {} }, + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() -- Brief aside: **What is LSP?** From 6f3fe35de355b71257fe987537727ca2c7101c0c Mon Sep 17 00:00:00 2001 From: srdtrk <59252793+srdtrk@users.noreply.github.com> Date: Mon, 22 Jul 2024 04:21:21 +0200 Subject: [PATCH 153/191] lint: fix lsp warning in `vim.lsp.inlay_hint.is_enabled` (#947) * fix: lsp warning * review suggestion Co-authored-by: Tom Kuson --------- Co-authored-by: Tom Kuson From 56b9114bf29cdc0c0f5de78b5deae1fe0ab65db1 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:00:35 -0700 Subject: [PATCH 154/191] Update comment about the toggle inlay hints keymap (#1041) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 77181309c0e..0d380e8dc28 100644 --- a/init.lua +++ b/init.lua @@ -533,7 +533,7 @@ require('lazy').setup({ }) end - -- The following autocommand is used to enable inlay hints in your + -- The following code creates a keymap to toggle 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 From f00b2866de46fab6fcac519b70dbec1d0c683f9b Mon Sep 17 00:00:00 2001 From: Arvin Verain Date: Mon, 29 Jul 2024 00:39:54 +0800 Subject: [PATCH 155/191] Remove redundant hlsearch option (#1058) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 0d380e8dc28..bfbb676ab62 100644 --- a/init.lua +++ b/init.lua @@ -157,8 +157,8 @@ vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` --- Set highlight on search, but clear on pressing in normal mode -vim.opt.hlsearch = true +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps From 1cef2325e0d28ec99c1d8446be4ea58b73028901 Mon Sep 17 00:00:00 2001 From: Brandon Clark Date: Sun, 28 Jul 2024 12:43:08 -0400 Subject: [PATCH 156/191] Modify conform comments to prevent deprecation warning when used (#1057) --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bfbb676ab62..d4d7b8c269f 100644 --- a/init.lua +++ b/init.lua @@ -653,9 +653,8 @@ require('lazy').setup({ -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, }, }, From fd66454c4a02abb44568159e7447060b962e1b5d Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:39:34 -0400 Subject: [PATCH 157/191] refactor: remove lazydev and luvit-meta as lsp dependencies (#1047) --- init.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index d4d7b8c269f..5f442b6b2ed 100644 --- a/init.lua +++ b/init.lua @@ -399,7 +399,22 @@ require('lazy').setup({ end, }, - { -- LSP Configuration & Plugins + -- LSP Plugins + { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, + { + -- Main LSP Configuration 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim @@ -410,20 +425,6 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - { - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, - }, - }, - }, - { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() -- Brief aside: **What is LSP?** From 84cc12354dbe0ebda180d445f54820def8c4638f Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:41:34 +0000 Subject: [PATCH 158/191] performance: defer clipboard because xsel and pbcopy can be slow (#1049) --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5f442b6b2ed..ee1d3b4909e 100644 --- a/init.lua +++ b/init.lua @@ -111,9 +111,12 @@ vim.opt.mouse = 'a' vim.opt.showmode = false -- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.opt.clipboard = 'unnamedplus' +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) -- Enable break indent vim.opt.breakindent = true From bb9f84ca8f37c97ae248575680fc73c72ced471d Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:01:19 -0400 Subject: [PATCH 159/191] Remove treesitter prefer_git option (#1061) - It's not safe and can corrupt other git repos - nvim-treesiter maintainers consider `prefer_git` as deprecated and no longer needed. See nvim-treesitter PR for details: https://github.com/nvim-treesitter/nvim-treesitter/pull/6959 --- init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.lua b/init.lua index ee1d3b4909e..04c5896c8ec 100644 --- a/init.lua +++ b/init.lua @@ -856,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) From 186018483039b20dc39d7991e4fb28090dd4750e Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:02:37 -0400 Subject: [PATCH 160/191] Add explicit dependency of nvim-lspconfig on cmp-nvim-lsp (#1042) --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 04c5896c8ec..220d3045268 100644 --- a/init.lua +++ b/init.lua @@ -428,6 +428,9 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, + + -- Allows extra capabilities provided by nvim-cmp + 'hrsh7th/cmp-nvim-lsp', }, config = function() -- Brief aside: **What is LSP?** From c1ae9092cbd2b75ee25284a594209a8147609cef Mon Sep 17 00:00:00 2001 From: theoboldalex <44616505+theoboldalex@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:49:25 +0100 Subject: [PATCH 161/191] Update README.md (#1091) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f19854cd20..0b56eab3c4e 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ External Requirements: - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: - - If want to write Typescript, you need `npm` - - If want to write Golang, you will need `go` + - If you want to write Typescript, you need `npm` + - If you want to write Golang, you will need `go` - etc. > **NOTE** From 554a054bf9e0f04b637b7913b17327606f0ec9d0 Mon Sep 17 00:00:00 2001 From: Matt Gallagher <46973220+mattgallagher92@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:53:57 +0100 Subject: [PATCH 162/191] Add note in README about lazy-lock.json (#1090) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0b56eab3c4e..53ae459c786 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ fork to your machine using one of the commands below, depending on your OS. > Your fork's url will be something like this: > `https://github.com//kickstart.nvim.git` +You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file +too - it's ignored in the kickstart repo to make maintenance easier, but it's +[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). + #### Clone kickstart.nvim > **NOTE** > If following the recommended step above (i.e., forking the repo), replace From ce0c7340fff68fb45d817478a8c0facb24425149 Mon Sep 17 00:00:00 2001 From: "Michael L." Date: Thu, 22 Aug 2024 22:56:33 +0200 Subject: [PATCH 163/191] Check for loop or uv for lazypath (#1095) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 220d3045268..314a05b6bb3 100644 --- a/init.lua +++ b/init.lua @@ -207,7 +207,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ 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' -if not vim.uv.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then From ac78e7d9e77048fa7d5b0711f85aab93508e71a7 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:00:39 -0400 Subject: [PATCH 164/191] refactor: update treesitter and which-key config (#1068) --- init.lua | 60 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index 314a05b6bb3..41b5a97bb0b 100644 --- a/init.lua +++ b/init.lua @@ -275,7 +275,44 @@ require('lazy').setup({ 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() + require('which-key').setup { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', + }, + }, + } -- Document existing key chains require('which-key').add { @@ -843,6 +880,8 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', + main = 'nvim-treesitter.configs', -- Sets main module to use for opts + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed @@ -856,19 +895,12 @@ require('lazy').setup({ }, indent = { enable = true, disable = { 'ruby' } }, }, - config = function(_, opts) - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - - ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup(opts) - - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - end, + -- There are additional nvim-treesitter modules that you can use to interact + -- with nvim-treesitter. You should go explore a few and see what interests you: + -- + -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` + -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the From d452633b35d4dd9ada06efeca95750beaf0f584f Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Sun, 25 Aug 2024 00:31:43 +0300 Subject: [PATCH 165/191] Include visual mode in LSP code action keymap (#1060) (#1064) --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 41b5a97bb0b..13ea93a25a5 100644 --- a/init.lua +++ b/init.lua @@ -316,7 +316,7 @@ require('lazy').setup({ -- Document existing key chains require('which-key').add { - { 'c', group = '[C]ode' }, + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, @@ -507,8 +507,9 @@ require('lazy').setup({ -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc) - vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end -- Jump to the definition of the word under your cursor. @@ -542,7 +543,7 @@ require('lazy').setup({ -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. From f49cc6c93525326d6db409191c1c36dcc2e41b6e Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:23:17 +0300 Subject: [PATCH 166/191] Enable silent option for default neo-tree plugin keybinding (#1108) --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index f126d68af2c..bd4422695aa 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,7 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal' }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = { From e4a5300bdbdc644a3a265513b386aa30c2337088 Mon Sep 17 00:00:00 2001 From: Harshit Pant <97608579+pantharshit007@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:57:46 +0530 Subject: [PATCH 167/191] Fix: updated the windows installation commands (#1101) * Update README.md * Update README.md * Fix: updated the windows installation commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53ae459c786..e14cbe222b2 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" ```
From c76c323a7cc30186a77e2a68c7ecd8f62973cad9 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 25 Aug 2024 23:28:26 -0400 Subject: [PATCH 168/191] fix: remove deprecated opt for conform.nvim (#1070) - changed lsp_fallback -> lsp_format - updated format_on_save function to reflect change above --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 13ea93a25a5..edc418222de 100644 --- a/init.lua +++ b/init.lua @@ -675,7 +675,7 @@ require('lazy').setup({ { 'f', function() - require('conform').format { async = true, lsp_fallback = true } + require('conform').format { async = true, lsp_format = 'fallback' } end, mode = '', desc = '[F]ormat buffer', @@ -688,9 +688,15 @@ 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 } + local lsp_format_opt + if disable_filetypes[vim.bo[bufnr].filetype] then + lsp_format_opt = 'never' + else + lsp_format_opt = 'fallback' + end return { timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + lsp_format = lsp_format_opt, } end, formatters_by_ft = { From 24d368f9ff3a951f9760c3c0e776a52726401f4f Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:17:22 -0400 Subject: [PATCH 169/191] cleanup: refactor which-key configuration for cleaner setup (#1102) - Moved `which-key` configuration from inline `config` to `opts` for better organization. - Updated the key mappings setup to use `spec` for defining existing key chains. - Removed deprecated or unnecessary comments and code. This change aligns with updated `which-key` configuration practices, improving readability and maintainability as recommended by @VlaDexa in #1068. --- init.lua | 96 +++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/init.lua b/init.lua index edc418222de..2513d537e30 100644 --- a/init.lua +++ b/init.lua @@ -274,57 +274,55 @@ require('lazy').setup({ { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup { - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, + opts = { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', }, - } - -- Document existing key chains - require('which-key').add { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - } - end, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + }, + }, + }, }, -- NOTE: Plugins can specify dependencies. From a22976111e406ec0e4903ae78bf66a1fc0125b8a Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 26 Aug 2024 22:43:59 +0200 Subject: [PATCH 170/191] Fix the which-key spec issue caused by recent cleanup (#1113) The recent cleanup accidentally broke the leader key specs because the spec block was in the wrong level of braces. That resulted in which-key no longer showing the description of the key chains such as [S]earch and others. --- init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 2513d537e30..13c8143daa0 100644 --- a/init.lua +++ b/init.lua @@ -310,17 +310,17 @@ require('lazy').setup({ F11 = '', F12 = '', }, + }, - -- Document existing key chains - spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, }, }, From 7201dc480134f41dd1be1f8f9b8f8470aac82a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Baquero?= <88566759+Cheveniko@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:27:24 -0500 Subject: [PATCH 171/191] feat: update references of tsserver to ts_ls (#1131) --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 13c8143daa0..ea86b792abe 100644 --- a/init.lua +++ b/init.lua @@ -614,8 +614,8 @@ require('lazy').setup({ -- 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 = {}, + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, -- lua_ls = { @@ -656,7 +656,7 @@ require('lazy').setup({ local server = servers[server_name] or {} -- This handles overriding only values explicitly passed -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for tsserver) + -- certain features of an LSP (for example, turning off formatting for ts_ls) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) require('lspconfig')[server_name].setup(server) end, From 4120893b8a1f31a0957f2f891f7fbef73ddfb9b1 Mon Sep 17 00:00:00 2001 From: Bastien Traverse Date: Tue, 24 Sep 2024 17:06:14 +0200 Subject: [PATCH 172/191] fix: update lazy uninstall information link (#1148) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e14cbe222b2..800ca990d51 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ examples of adding popularly requested plugins. `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information + * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. From 5ed1bc38dc6467a2e69e3b6ad04f9b92f3ca882f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20NICOLAS?= Date: Wed, 30 Oct 2024 16:41:46 +0100 Subject: [PATCH 173/191] Disable linting autocmd for readonly buffers (#1202) * Disable linting autocmd for readonly buffers This should avoid linting in buffers outside of the user's control, having in mind especially the handy LSP pop-ups that describe your hovered symbol using markdown. Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> * Justify guarding try_lint in readonly buffers Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --------- Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --- lua/kickstart/plugins/lint.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index ca9bc237904..907c6bf3e31 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -47,7 +47,12 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - lint.try_lint() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.opt_local.modifiable:get() then + lint.try_lint() + end end, }) end, From fb7f6a1c137ad32eca00926ceefa2b8a69e03d0a Mon Sep 17 00:00:00 2001 From: sam <110125971+samarth-na@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:19:16 +0530 Subject: [PATCH 174/191] samarth-nagar fix: lazy help tag on line 931 (#1167) * samarth-nagar fix: lazy help tag on line 931 found in issue #1152 * fixed white space --------- Co-authored-by: sam <110125971+samarth-nagar@users.noreply.github.com> --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ea86b792abe..e588129fbdf 100644 --- a/init.lua +++ b/init.lua @@ -928,8 +928,12 @@ require('lazy').setup({ -- 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' }, + -- + -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` + -- Or use telescope! + -- In normal mode type `sh` then write `lazy.nvim-plugin` + -- you can continue same window with `sr` which resumes last telescope search }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the From d09d9bc6dc25f3e5de1856a9af4e1af98ab85461 Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:50:27 +0000 Subject: [PATCH 175/191] Change diagnostic symbols if vim.g.have_nerd_font is true (#1195) * feat: Change diagnostic symbols if vim.g.have_nerd_font is true * feat: Comment out changes regarding diagnostic symbols so that only those who want to change them can do so --------- Co-authored-by: name --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.lua b/init.lua index e588129fbdf..b58677d1f9b 100644 --- a/init.lua +++ b/init.lua @@ -588,6 +588,15 @@ require('lazy').setup({ end, }) + -- Change diagnostic symbols in the sign column (gutter) + -- if vim.g.have_nerd_font then + -- local signs = { Error = '', Warn = '', Hint = '', Info = '' } + -- for type, icon in pairs(signs) do + -- local hl = 'DiagnosticSign' .. type + -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + -- end + -- 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 be678aa341bfa88f3b7ad8d85b7b76200d25e15d Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:01:42 +0000 Subject: [PATCH 176/191] Set breakpoint icons and their highlight colors (#1194) * feat: Set breakpoint icons and their highlight colors * docs: Delete reference URL (written in PR) feat: "Break" and "Stop" arguments of vim.api.nvim_set_hl are changed because they are too common nouns feat: Comment out changes regarding diagnostic symbols so that only those who want to change them can do so --------- Co-authored-by: name --- lua/kickstart/plugins/debug.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 196f2c6dbd6..2226d963442 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -89,6 +89,18 @@ return { }, } + -- Change breakpoint icons + -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) + -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) + -- local breakpoint_icons = vim.g.have_nerd_font + -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } + -- for type, icon in pairs(breakpoint_icons) do + -- local tp = 'Dap' .. type + -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' + -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) + -- end + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From 2ba39c69736597b60f6033aa3f8526e7c28343d5 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 30 Oct 2024 14:58:52 -0400 Subject: [PATCH 177/191] Remove two because there are more than two. (#1213) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b58677d1f9b..4ce35f4b5c4 100644 --- a/init.lua +++ b/init.lua @@ -917,7 +917,7 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, - -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- 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. From e5dc5f6d1ce598fdbee87e1bbd57062bdc1971b9 Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:37:22 +0900 Subject: [PATCH 178/191] feat: Change to prepare for upcoming deprecation of configuring diagnostic-signs using sign_define() (#1232) --- init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 4ce35f4b5c4..e3b7b56c631 100644 --- a/init.lua +++ b/init.lua @@ -590,11 +590,12 @@ require('lazy').setup({ -- Change diagnostic symbols in the sign column (gutter) -- if vim.g.have_nerd_font then - -- local signs = { Error = '', Warn = '', Hint = '', Info = '' } + -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' } + -- local diagnostic_signs = {} -- for type, icon in pairs(signs) do - -- local hl = 'DiagnosticSign' .. type - -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + -- diagnostic_signs[vim.diagnostic.severity[type]] = icon -- end + -- vim.diagnostic.config { signs = { text = diagnostic_signs } } -- end -- LSP servers and clients are able to communicate to each other what features they support. From 9dfb1b230f42a56bda0906e4693f4c9c4d5930eb Mon Sep 17 00:00:00 2001 From: Anjishnu Banerjee <107052359+kaezrr@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:10:51 +0530 Subject: [PATCH 179/191] Fix nvim-dap not lazy loading (#1216) * Fix nvim-dap not lazy loading The keys property had local variables 'dap' and 'dap-ui' that used `require` and prevented all DAP related plugins from lazy-loading. Fixed this by changing keys to a table and substituting the local variables with a lamba function * Make debug keybind descriptions more consistent --- lua/kickstart/plugins/debug.lua | 75 +++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 2226d963442..753cb0cedd3 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,28 +24,59 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', }, - keys = function(_, keys) - local dap = require 'dap' - local dapui = require 'dapui' - return { - -- Basic debugging keymaps, feel free to change to your liking! - { '', dap.continue, desc = 'Debug: Start/Continue' }, - { '', dap.step_into, desc = 'Debug: Step Into' }, - { '', dap.step_over, desc = 'Debug: Step Over' }, - { '', dap.step_out, desc = 'Debug: Step Out' }, - { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, - { - 'B', - function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { '', dapui.toggle, desc = 'Debug: See last session result.' }, - unpack(keys), - } - end, + keys = { + -- Basic debugging keymaps, feel free to change to your liking! + { + '', + function() + require('dap').continue() + end, + desc = 'Debug: Start/Continue', + }, + { + '', + function() + require('dap').step_into() + end, + desc = 'Debug: Step Into', + }, + { + '', + function() + require('dap').step_over() + end, + desc = 'Debug: Step Over', + }, + { + '', + function() + require('dap').step_out() + end, + desc = 'Debug: Step Out', + }, + { + 'b', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Debug: Toggle Breakpoint', + }, + { + 'B', + function() + require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Debug: Set Breakpoint', + }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { + '', + function() + require('dapui').toggle() + end, + desc = 'Debug: See last session result.', + }, + }, config = function() local dap = require 'dap' local dapui = require 'dapui' From 8d1ef972bc32faa86fee21a57f9033b41f612ebb Mon Sep 17 00:00:00 2001 From: Miha <79801427+mihasket@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:41:50 +0100 Subject: [PATCH 180/191] fix: which-key comment typo (#1227) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e3b7b56c631..08717d537e6 100644 --- a/init.lua +++ b/init.lua @@ -279,7 +279,7 @@ require('lazy').setup({ -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + -- default which-key.nvim defined Nerd Font icons, otherwise define a string table keys = vim.g.have_nerd_font and {} or { Up = ' ', Down = ' ', From 7bc9d19a4d086330b72b9f21e72431e9b31839b0 Mon Sep 17 00:00:00 2001 From: ben fleis Date: Thu, 12 Dec 2024 16:50:55 +0100 Subject: [PATCH 181/191] Tweak outdated comment about lazy's `config` key usage. (#1250) Remove outdated comment describing use of `config` key, replacing with corrected `opt` key note. Fixes #1249 --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 08717d537e6..b29693accab 100644 --- a/init.lua +++ b/init.lua @@ -267,9 +267,8 @@ require('lazy').setup({ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `config` key, the configuration only runs - -- after the plugin has been loaded: - -- config = function() ... end + -- Then, because we use the `opt` key (recommended), the configuration runs + -- after the plugin has been loaded as `require(MODULE).setup(opts)`. { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', From a2df3ea9ebec39de1c9a6f76320bf27a257ebf50 Mon Sep 17 00:00:00 2001 From: Artem Dragunov Date: Thu, 12 Dec 2024 18:51:58 +0300 Subject: [PATCH 182/191] Use consistent syntax style for { ... } "pseudocode" (#1247) ``` require('gitsigns').setup({ ... }) ``` This was the first occurrence It may be nice to have the same style everywhere Cosmetic change (just to make docs/comments even more perfect) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index b29693accab..8e56a216be3 100644 --- a/init.lua +++ b/init.lua @@ -628,8 +628,8 @@ require('lazy').setup({ -- lua_ls = { - -- cmd = {...}, - -- filetypes = { ...}, + -- cmd = { ... }, + -- filetypes = { ... }, -- capabilities = {}, settings = { Lua = { From bcdb4cd2525d517864b8221ddce3c5652ac35f9e Mon Sep 17 00:00:00 2001 From: ben fleis Date: Thu, 12 Dec 2024 22:26:20 +0100 Subject: [PATCH 183/191] Issue 1249 which key comments (#1263) * Tweak outdated comment about lazy's `config` key usage. Remove outdated comment describing use of `config` key, replacing with corrected `opt` key note. Fixes #1249 * fix typo opt -> opts Fixes #1250 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8e56a216be3..ee8fbc992e1 100644 --- a/init.lua +++ b/init.lua @@ -267,7 +267,7 @@ require('lazy').setup({ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `opt` key (recommended), the configuration runs + -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. { -- Useful plugin to show you pending keybinds. From de44f491016126204824fac2b5a7d7e544a769be Mon Sep 17 00:00:00 2001 From: Scott Swensen Date: Sat, 14 Dec 2024 22:42:39 -0700 Subject: [PATCH 184/191] fix(gitsigns): make visual mode descriptions consistent with normal mode (#1266) --- lua/kickstart/plugins/gitsigns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 4bcc70f4c79..c269bc06e15 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -36,10 +36,10 @@ return { -- visual mode map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) + end, { desc = 'git [s]tage hunk' }) map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) + end, { desc = 'git [r]eset hunk' }) -- normal mode map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) From e84e187f3c0c98ad258706a41768b5a93d411e1a Mon Sep 17 00:00:00 2001 From: George Date: Sun, 29 Dec 2024 18:39:47 +0200 Subject: [PATCH 185/191] Fix README.md grammar and typos (#1291) --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 800ca990d51..08cecfa3427 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) -- Clipboard tool (xclip/xsel/win32yank or other depending on platform) +- Clipboard tool (xclip/xsel/win32yank or other depending on the platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: @@ -56,12 +56,12 @@ so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. > **NOTE** -> Your fork's url will be something like this: +> Your fork's URL will be something like this: > `https://github.com//kickstart.nvim.git` You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file too - it's ignored in the kickstart repo to make maintenance easier, but it's -[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). +[recommended to track it in version control](https://lazy.folke.io/usage/lockfile). #### Clone kickstart.nvim > **NOTE** @@ -101,7 +101,7 @@ nvim ``` That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -current plugin status. Hit `q` to close the window. +the current plugin status. Hit `q` to close the window. Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. That also includes @@ -114,9 +114,9 @@ examples of adding popularly requested plugins. ### FAQ -* What should I do if I already have a pre-existing neovim configuration? +* What should I do if I already have a pre-existing Neovim configuration? * You should back it up and then delete all associated files. - * This includes your existing init.lua and the neovim files in `~/.local` + * This includes your existing init.lua and the Neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` * Can I keep my existing configuration in parallel to kickstart? * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` @@ -174,7 +174,7 @@ run in cmd as **admin**: winget install --accept-source-agreements chocolatey.chocolatey ``` -2. install all requirements using choco, exit previous cmd and +2. install all requirements using choco, exit the previous cmd and open a new one so that choco path is set, and run in cmd as **admin**: ``` choco install -y neovim git ripgrep wget fd unzip gzip mingw make From 7ddaab3ffda3f79c8dc16242e609a20b222f7551 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:00:16 -0500 Subject: [PATCH 186/191] chore: add pre-issue requirements (#1288) * chore: add pre-issue requirements Based on #1285 * docs: add header about documentation Based on #1285 --- .github/ISSUE_TEMPLATE/bug_report.md | 11 +++++++++-- README.md | 7 ++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2ad4d31ddb0..55b45b0d127 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,6 +9,13 @@ assignees: '' +## Before Reporting an Issue +- I have read the kickstart.nvim README.md. +- I have read the appropiate plugin's documentation. +- I have searched that this issue has not been reported before. + +- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** + ## Describe the bug @@ -18,8 +25,8 @@ assignees: '' ## Desktop -- OS: -- Terminal: +- OS: +- Terminal: ## Neovim Version diff --git a/README.md b/README.md index 08cecfa3427..aa5f4fc8f1e 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,15 @@ nvim That's it! Lazy will install all the plugins you have. Use `:Lazy` to view the current plugin status. Hit `q` to close the window. +#### Read The Friendly Documentation + Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. That also includes examples of adding popularly requested plugins. +> [!NOTE] +> For more information about a particular plugin check its repository's documentation. + ### Getting Started @@ -135,7 +140,7 @@ examples of adding popularly requested plugins. * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the + into smaller parts. A fork of kickstart that does this while maintaining the same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * Discussions on this topic can be found here: From a8f539562a8c5d822dd5c0ca1803d963c60ad544 Mon Sep 17 00:00:00 2001 From: Ryan Jensen Date: Sun, 29 Dec 2024 11:04:10 -0600 Subject: [PATCH 187/191] Fix which-key delay settings (#1276) The which-key plugin used to rely on vim.opt.timeoutlen, but it was updated a few months ago to use its own opt.delay instead. https://github.com/folke/which-key.nvim/blob/8ab96b38a2530eacba5be717f52e04601eb59326/NEWS.md?plain=1#L10 I set which-key's delay to 0 ms because it makes it feel snappy and responsive! That way, we give new users a good first impression. --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ee8fbc992e1..7758df93a2e 100644 --- a/init.lua +++ b/init.lua @@ -135,7 +135,6 @@ vim.opt.signcolumn = 'yes' vim.opt.updatetime = 250 -- Decrease mapped sequence wait time --- Displays which-key popup sooner vim.opt.timeoutlen = 300 -- Configure how new splits should be opened @@ -274,6 +273,9 @@ require('lazy').setup({ 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' opts = { + -- delay between pressing a key and opening which-key (milliseconds) + -- this setting is independent of vim.opt.timeoutlen + delay = 0, icons = { -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, From db4867acb939b548cf3c60641e1661783551248d Mon Sep 17 00:00:00 2001 From: Tomas Gareau Date: Tue, 7 Jan 2025 09:44:29 -0600 Subject: [PATCH 188/191] fix: prevent mason setup from being run twice (#1298) * fix: prevent mason setup from being run twice Addresses https://github.com/nvim-lua/kickstart.nvim/issues/1297 Currently, we're calling `require('mason').setup(...)` twice: * once when setting it as a dependency of `nvim-lspconfig` (since we set `config = true`) * once in the `config` function we define for `nvim-lspconfig` Calling setup twice can cause issues with, e.g., setting the `PATH` option: you might append Mason's bin dir in one setup call and prepend it in the other. We've kept the setup of `mason` in the `nvim-lspconfig` dependencies table since leaving it to the `config` function caused some plugin-loading-order related issues in the past. See: * https://github.com/nvim-lua/kickstart.nvim/pull/210 * https://github.com/nvim-lua/kickstart.nvim/issues/554 * https://github.com/nvim-lua/kickstart.nvim/pull/555 * https://github.com/nvim-lua/kickstart.nvim/pull/865 * docs: tweak comments per review feedback --- init.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 7758df93a2e..610018e8d99 100644 --- a/init.lua +++ b/init.lua @@ -457,7 +457,9 @@ 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 + -- Mason must be loaded before its dependents so we need to set it up here. + -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` + { 'williamboman/mason.nvim', opts = {} }, 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -646,13 +648,16 @@ require('lazy').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 + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run -- :Mason -- - -- You can press `g?` for help in this menu. - require('mason').setup() - + -- You can press `g?` for help in this menu. + -- + -- `mason` had to be setup earlier: to configure its options see the + -- `dependencies` table for `nvim-lspconfig` above. + -- -- You can add other tools here that you want Mason to install -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) From f6abf682fffba362ff4c6f8157ef72822adda289 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Thu, 16 Jan 2025 02:37:03 +0700 Subject: [PATCH 189/191] chore: remove redundant comment (#1307) --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index 610018e8d99..edbc37834f2 100644 --- a/init.lua +++ b/init.lua @@ -464,7 +464,6 @@ require('lazy').setup({ 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, -- Allows extra capabilities provided by nvim-cmp From ff89769e4583b4f2c170df0d8ccacb950d5dd4e6 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Thu, 16 Jan 2025 02:37:36 +0700 Subject: [PATCH 190/191] chore: fix typo in bug report issue template (#1306) --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 55b45b0d127..86598b8dc98 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ assignees: '' ## Before Reporting an Issue - I have read the kickstart.nvim README.md. -- I have read the appropiate plugin's documentation. +- I have read the appropriate plugin's documentation. - I have searched that this issue has not been reported before. - [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** From 5bdde24dfb353d365d908c5dd700f412ed2ffb17 Mon Sep 17 00:00:00 2001 From: Diorman Colmenares <229201+diorman@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:38:26 -0800 Subject: [PATCH 191/191] Use luals 3rd library for luv (#1303) --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index edbc37834f2..4eae8e7d95a 100644 --- a/init.lua +++ b/init.lua @@ -447,11 +447,10 @@ require('lazy').setup({ opts = { library = { -- Load luvit types when the `vim.uv` word is found - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, }, }, }, - { 'Bilal2453/luvit-meta', lazy = true }, { -- Main LSP Configuration 'neovim/nvim-lspconfig',