From c9122e89e3c2e19cd784642a1d0cddae258d0672 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Mar 2024 01:32:06 +0100 Subject: [PATCH 01/21] 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 957204e..04df77b 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 02/21] 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 292ec07..16d3c26 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 03/21] 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 b6d19f4..82eeceb 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 04/21] 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 82eeceb..c44d5f9 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 05/21] 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 16d3c26..e8c8693 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 06/21] 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 c44d5f9..6d48c18 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 e8c8693..3bdb5e3 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] 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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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