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 01/15] Fix typos and whatnot (#731) --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6d48c18..9ed1912 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 02/15] use init for colorscheme (#715) --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3bdb5e3..cfbe00d 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 03/15] 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 9ed1912..36920a7 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 04/15] 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 cfbe00d..9216e60 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 05/15] 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 9216e60..c570c4c 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 06/15] 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 c570c4c..04cc6b7 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 07/15] 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 04cc6b7..fe25648 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 08/15] 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 fe25648..04cc6b7 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 09/15] 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 04cc6b7..964ff82 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 10/15] 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 964ff82..26774a5 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 11/15] 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 26774a5..552e16a 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 12/15] doc: add note about advanced luasnip features --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 552e16a..c504ccb 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 13/15] 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 c504ccb..87133dd 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 14/15] 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 36920a7..0f0bb1b 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 15/15] 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 87133dd..506bbaf 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