From a222805c6120b88f451c3e026b29ea6f761a491e Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 17 Mar 2024 21:22:58 +0100 Subject: [PATCH 01/36] 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 0f0bb1b..e9d3170 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 02/36] 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 506bbaf..6e813f4 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 03/36] 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 6e813f4..c242886 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 0000000..7f0dc42 --- /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 04/36] 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 c242886..013fcc2 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 05/36] 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 7fc783f..7be4abd 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 06/36] 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 e9d3170..82ca52c 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 07/36] README: wrap long lines (#784) --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 82ca52c..531c2fe 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 08/36] 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 013fcc2..db55a9e 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 09/36] 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 531c2fe..3453cfa 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 10/36] 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 db55a9e..667fb9c 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 11/36] Don't lazy load conform plugin (#818) --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 667fb9c..496f45b 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 12/36] 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 3453cfa..5ca19d7 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 13/36] 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 0000000..f401c9f --- /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 14/36] Update README (#832) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ca19d7..4dd8ac8 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 15/36] 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 4dd8ac8..e67b94a 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 16/36] 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 496f45b..1d922df 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 17/36] 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 1d922df..cc49351 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 18/36] 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 cc49351..4bd9b7f 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 19/36] 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 e67b94a..a427def 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 4bd9b7f..21d7df8 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 0000000..87a7e5f --- /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 0000000..c793b88 --- /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 20/36] 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 21d7df8..a182828 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 0000000..4bcc70f --- /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 21/36] 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 a182828..62d2c5c 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 22/36] 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 a427def..4cb8953 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 23/36] 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 4cb8953..dd51f20 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 24/36] 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 62d2c5c..3c70d73 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 25/36] 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 3c70d73..256da5b 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 26/36] 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 256da5b..ccca32c 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 27/36] 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 ccca32c..036eefb 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 28/36] 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 dd51f20..be313bd 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 29/36] 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 be313bd..f445b65 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 30/36] Move LspDetach handler near kickstart-lsp-highlight group (#900) Moved to make sure the kickstart-lsp-highlight group exists when the LspDetach handler is invoked. The LspDetach handler is used to clean up any lsp highlights that were enabled by CursorHold if the LSP is stopped or crashed. --- init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 036eefb..457ad21 100644 --- a/init.lua +++ b/init.lua @@ -526,6 +526,14 @@ require('lazy').setup({ group = highlight_augroup, callback = vim.lsp.buf.clear_references, }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) end -- The following autocommand is used to enable inlay hints in your @@ -540,14 +548,6 @@ require('lazy').setup({ end, }) - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf } - end, - }) - -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. From f86f18f27afeef1952272e212bef886e58ffd04c Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 5 May 2024 18:01:39 -0700 Subject: [PATCH 31/36] Add diff to treesitter's ensure_installed languages (#908) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 457ad21..88658ef 100644 --- a/init.lua +++ b/init.lua @@ -835,7 +835,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From b9bd02d55b77293291a38fac9abe46acad9ab91d Mon Sep 17 00:00:00 2001 From: Smig <89040888+smiggiddy@users.noreply.github.com> Date: Wed, 8 May 2024 10:55:49 -0400 Subject: [PATCH 32/36] fix: debug.lua (#918) --- lua/kickstart/plugins/debug.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7be4abd..d4d1465 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -31,7 +31,7 @@ return { require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations - automatic_setup = true, + automatic_installation = true, -- You can provide additional configuration to the handlers, -- see mason-nvim-dap README for more information From 5aeddfdd5d0308506ec63b0e4f8de33e2a39355f Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Fri, 10 May 2024 19:43:22 +0200 Subject: [PATCH 33/36] Automatically set detached state as needed. (#925) * Automatically set detached state as needed. * Use vim.fn.has instead. * Fix int vs bool. --- lua/kickstart/plugins/debug.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index d4d1465..31dfecf 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -85,6 +85,12 @@ return { dap.listeners.before.event_exited['dapui_config'] = dapui.close -- Install golang specific config - require('dap-go').setup() + require('dap-go').setup { + delve = { + -- On Windows delve must be run attached or it crashes. + -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring + detached = vim.fn.has 'win32' == 0, + }, + } end, } From 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 34/36] 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 88658ef..907ef90 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 35/36] 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 907ef90..f5205ca 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 36/36] 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 f5205ca..624e23d 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 = {