From 187bebcbf93a82c29f12d946136b8d35ab695c64 Mon Sep 17 00:00:00 2001 From: Luiz Antonio Calliari Filho Date: Sun, 26 Feb 2023 23:03:34 -0300 Subject: [PATCH 01/30] Adding [+c and ]+c to move to diffs and leader+ph to show a pop up with the preview diff value. --- init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/init.lua b/init.lua index aeca6d28..427af75e 100644 --- a/init.lua +++ b/init.lua @@ -109,6 +109,19 @@ require('lazy').setup({ topdelete = { text = '‾' }, changedelete = { text = '~' }, }, + on_attach = function(bufnr) + local function map(mode, lhs, rhs, opts) + opts = vim.tbl_extend('force', {noremap = true, silent = true}, opts or {}) + vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts) + end + + -- Navigation + map('n', ']c', "&diff ? ']c' : 'Gitsigns next_hunk'", {expr=true}) + map('n', '[c', "&diff ? '[c' : 'Gitsigns prev_hunk'", {expr=true}) + + -- Actions + map('n', 'ph', 'Gitsigns preview_hunk') + end }, }, From 66dc5b896d47ed58e9821b8b39588ce431bfd83a Mon Sep 17 00:00:00 2001 From: Luiz Antonio Calliari Filho Date: Mon, 6 Mar 2023 23:26:20 -0300 Subject: [PATCH 02/30] Feat: Simplifying code --- init.lua | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 427af75e..9ce29c65 100644 --- a/init.lua +++ b/init.lua @@ -110,17 +110,9 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - local function map(mode, lhs, rhs, opts) - opts = vim.tbl_extend('force', {noremap = true, silent = true}, opts or {}) - vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts) - end - - -- Navigation - map('n', ']c', "&diff ? ']c' : 'Gitsigns next_hunk'", {expr=true}) - map('n', '[c', "&diff ? '[c' : 'Gitsigns prev_hunk'", {expr=true}) - - -- Actions - map('n', 'ph', 'Gitsigns preview_hunk') + vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to [P]revious [H]unk' }) + vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to [N]ext [H]unk' }) + vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end }, }, From 986aa82cd63a104e0930c17f747518d6449ac11a Mon Sep 17 00:00:00 2001 From: Luiz Antonio Calliari Filho Date: Sun, 12 Mar 2023 20:45:26 -0300 Subject: [PATCH 03/30] FIX: Updating command description. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e3ddbd29..b4a7881d 100644 --- a/init.lua +++ b/init.lua @@ -110,8 +110,8 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to [P]revious [H]unk' }) - vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to [N]ext [H]unk' }) + vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) + vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end }, From 55c52ce45bea8395e79d43dc6e5490c23b06a95b Mon Sep 17 00:00:00 2001 From: SamPosh Date: Tue, 2 May 2023 16:01:46 +0530 Subject: [PATCH 04/30] Added friendly snippet support --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 7fd9c54f..2d377d28 100644 --- a/init.lua +++ b/init.lua @@ -93,7 +93,7 @@ require('lazy').setup({ { -- Autocompletion 'hrsh7th/nvim-cmp', - dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, + dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip',"rafamadriz/friendly-snippets", }, }, -- Useful plugin to show you pending keybinds. @@ -447,7 +447,7 @@ mason_lspconfig.setup_handlers { -- nvim-cmp setup local cmp = require 'cmp' local luasnip = require 'luasnip' - +require("luasnip.loaders.from_vscode").lazy_load() luasnip.config.setup {} cmp.setup { From 1c02cec98b9192d8c7e990b8243e3ae007325bad Mon Sep 17 00:00:00 2001 From: Gaurav Bhatnagar <11798509+mech-a@users.noreply.github.com> Date: Sun, 7 May 2023 16:28:13 -0700 Subject: [PATCH 05/30] change luasnip tab jumping to locally jumpable --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 7fd9c54f..f4d8d0f4 100644 --- a/init.lua +++ b/init.lua @@ -469,7 +469,7 @@ cmp.setup { [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then + elseif luasnip.expand_or_locally_jumpable() then luasnip.expand_or_jump() else fallback() From 2844f61d968501b531758e8a301a53a77b2fb69e Mon Sep 17 00:00:00 2001 From: Gaurav Bhatnagar <11798509+mech-a@users.noreply.github.com> Date: Sun, 7 May 2023 16:38:44 -0700 Subject: [PATCH 06/30] add local jumping to shift tab --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f4d8d0f4..1496d240 100644 --- a/init.lua +++ b/init.lua @@ -478,7 +478,7 @@ cmp.setup { [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif luasnip.jumpable(-1) then + elseif luasnip.locally_jumpable(-1) then luasnip.jump(-1) else fallback() From fa4bf9c378a7ae17264abc42782f0628e3a3acf3 Mon Sep 17 00:00:00 2001 From: dec Date: Mon, 8 May 2023 11:02:37 +0100 Subject: [PATCH 07/30] Udated tree sitter to use latest release branch --- init.lua | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 7fd9c54f..f9c86079 100644 --- a/init.lua +++ b/init.lua @@ -35,7 +35,6 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now :) --]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -75,7 +74,8 @@ require('lazy').setup({ -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. - { -- LSP Configuration & Plugins + { + -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs to stdpath for neovim @@ -84,21 +84,23 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', }, }, - { -- Autocompletion + { + -- Autocompletion 'hrsh7th/nvim-cmp', dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { -- Adds git releated signs to the gutter, as well as utilities for managing changes + { 'folke/which-key.nvim', opts = {} }, + { + -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { -- See `:help gitsigns.txt` @@ -112,7 +114,8 @@ require('lazy').setup({ }, }, - { -- Theme inspired by Atom + { + -- Theme inspired by Atom 'navarasu/onedark.nvim', priority = 1000, config = function() @@ -120,7 +123,8 @@ require('lazy').setup({ end, }, - { -- Set lualine as statusline + { + -- Set lualine as statusline 'nvim-lualine/lualine.nvim', -- See `:help lualine.txt` opts = { @@ -133,7 +137,8 @@ require('lazy').setup({ }, }, - { -- Add indentation guides even on blank lines + { + -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` @@ -144,10 +149,10 @@ require('lazy').setup({ }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) - { 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim' } }, + { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, -- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Only load if `make` is available. Make sure you have the system @@ -162,7 +167,8 @@ require('lazy').setup({ end, }, - { -- Highlight, edit, and navigate code + { + -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', From 455691bd8d15064531d2db31a77b54f83ce2898d Mon Sep 17 00:00:00 2001 From: Gaurav Bhatnagar Date: Tue, 16 May 2023 12:38:56 -0700 Subject: [PATCH 08/30] refact: stylua --- init.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 71e1ae5a..c77ff26c 100644 --- a/init.lua +++ b/init.lua @@ -84,7 +84,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', @@ -94,11 +94,11 @@ require('lazy').setup({ { -- Autocompletion 'hrsh7th/nvim-cmp', - dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip',"rafamadriz/friendly-snippets", }, + dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'rafamadriz/friendly-snippets' }, }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -115,7 +115,7 @@ require('lazy').setup({ vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) - end + end, }, }, @@ -154,10 +154,10 @@ require('lazy').setup({ }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) - { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, + { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, -- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Only load if `make` is available. Make sure you have the system @@ -178,7 +178,7 @@ require('lazy').setup({ dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', }, - build = ":TSUpdate", + build = ':TSUpdate', }, -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart @@ -361,10 +361,10 @@ require('nvim-treesitter.configs').setup { } -- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = "Open floating diagnostic message" }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = "Open diagnostics list" }) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) -- LSP settings. -- This function gets run when an LSP connects to a particular buffer. @@ -458,7 +458,7 @@ mason_lspconfig.setup_handlers { -- nvim-cmp setup local cmp = require 'cmp' local luasnip = require 'luasnip' -require("luasnip.loaders.from_vscode").lazy_load() +require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} cmp.setup { From 8a647f4384eb7d38259474db042b9e5291b6f6b5 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sun, 21 May 2023 22:13:02 -0400 Subject: [PATCH 09/30] Update README.md Fix for #314 - there's no -data at the end of the nvim dir. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef119d21..9bab48d4 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Distribution Alternatives: * From a terminal cd/dir to: `~/.config/nvim` (Linux) `~/.config/nvim` (MacOS) - `%userprofile%\AppData\Local\nvim-data\` (Windows) + `%userprofile%\AppData\Local\nvim\` (Windows) * run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: gh repo clone nvim-lua/kickstart.nvim * Run neovim (from terminal or shortcut) and allow the kickstart process to download files and set up the basics. From 8e8ba26a96a4b2306b90dbaadf86eb7cb43f56d8 Mon Sep 17 00:00:00 2001 From: Gaurav Bhatnagar Date: Sun, 21 May 2023 23:46:09 -0700 Subject: [PATCH 10/30] refact: add cmp comments, other --- init.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index c77ff26c..bc60ef85 100644 --- a/init.lua +++ b/init.lua @@ -94,7 +94,17 @@ require('lazy').setup({ { -- Autocompletion 'hrsh7th/nvim-cmp', - dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'rafamadriz/friendly-snippets' }, + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, }, -- Useful plugin to show you pending keybinds. @@ -366,7 +376,7 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) --- LSP settings. +-- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) -- NOTE: Remember that lua is a real programming language, and as such it is possible @@ -455,7 +465,8 @@ mason_lspconfig.setup_handlers { end, } --- nvim-cmp setup +-- [[ Configure nvim-cmp ]] +-- See `:help cmp` local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() From 8d97b11dd8fb7bda1857ab30bb45b067947da797 Mon Sep 17 00:00:00 2001 From: Gaurav Bhatnagar Date: Mon, 22 May 2023 11:29:42 -0700 Subject: [PATCH 11/30] refact: remove after/ reference in readme, other clean-up items --- README.md | 42 +++++++++++++++++++++--------------------- init.lua | 8 +++----- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 9bab48d4..265c2be3 100644 --- a/README.md +++ b/README.md @@ -28,15 +28,15 @@ Distribution Alternatives: `%userprofile%\AppData\Local\nvim-data\` (Windows) * Ensure your extraction method did not extract with a parent folder. For example in ~/.config/nvim you should have init.lua not another folder called kickstart.nvim. -### GIT Clone Installation +### Git Clone Installation * From a terminal cd/dir to: `~/.config/nvim` (Linux) `~/.config/nvim` (MacOS) `%userprofile%\AppData\Local\nvim\` (Windows) -* run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: gh repo clone nvim-lua/kickstart.nvim -* Run neovim (from terminal or shortcut) and allow the kickstart process to download files and set up the basics. -* Once the setup is complete restart Neovim. +* run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim` +* Run Neovim (from terminal or shortcut) and allow lazy.nvim to download files and set up the basics. +* Once the setup is complete, restart Neovim. * **You're ready to go!** * (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify). @@ -46,17 +46,18 @@ Distribution Alternatives: Additional system requirements: - Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -- See as well [Windows Installation](#Windows-Installation) +- See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` ### Configuration And Extension -* Inside of your fork, feel free to modify any file you like! It's your fork! -* Then there are two primary configuration options available: - * Include the `lua/kickstart/plugins/*` files in your configuration. +* Inside of your copy, feel free to modify any file you like! It's your copy! +* Feel free to change any of the default options in `init.lua` to better suit your needs. +* For adding plugins, there are 3 primary options: * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` - * NOTE: To enable this, you need to uncomment `{ import = 'custom.plugins' }` in your `init.lua` + * Modify `init.lua` with additional plugins. + * Include the `lua/kickstart/plugins/*` files in your configuration. -You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration +You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration. #### Example: Adding an autopairs plugin @@ -67,14 +68,23 @@ In the file: `lua/custom/plugins/autopairs.lua`, add: 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, } ``` -This will automatically install `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). #### Example: Adding a file tree plugin @@ -100,16 +110,6 @@ return { This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. -#### Example: Adding a file to change default options - -To change default options, you can add a file in the `/after/plugin/` folder (see `:help load-plugins`) to include your own options, keymaps, autogroups, and more. The following is an example `defaults.lua` file (located at `$HOME/.config/nvim/after/plugin/defaults.lua`). - -```lua -vim.opt.relativenumber = true - -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -``` - ### Contribution Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: diff --git a/init.lua b/init.lua index c77ff26c..4719912e 100644 --- a/init.lua +++ b/init.lua @@ -7,8 +7,8 @@ Kickstart.nvim is *not* a distribution. Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, and understand - what your configuration is doing. + The goal is that you can read every line of code, top-to-bottom, understand + what your configuration is doing, and modify it to suit your needs. Once you've done that, you should start exploring, configuring and tinkering to explore Neovim! @@ -192,14 +192,12 @@ require('lazy').setup({ -- up-to-date with whatever is in the kickstart repo. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- - -- An additional note is that if you only copied in the `init.lua`, you can just comment this line - -- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`. { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] -- See `:help vim.o` +-- NOTE: You can change these options as you wish! -- Set highlight on search vim.o.hlsearch = false From 83b65a1c7d4a5ae9454426e88be823c203d14a73 Mon Sep 17 00:00:00 2001 From: Luiz Antonio Calliari Filho Date: Thu, 25 May 2023 22:09:34 -0300 Subject: [PATCH 12/30] FIX: Conflict with vimdiff keybinding --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index fb0252cc..ca2da6e1 100644 --- a/init.lua +++ b/init.lua @@ -122,8 +122,8 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) - vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, From f2b09aaac7cd6e93f857f4faf33329a095da4797 Mon Sep 17 00:00:00 2001 From: Pavel 'PK' Kaminsky Date: Mon, 29 May 2023 23:35:45 +0300 Subject: [PATCH 13/30] fix(docs): update windows path to a correct folder --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 265c2be3..e4a841ec 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Distribution Alternatives: * **You're ready to go!** * (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify). -* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim-data\` (Windows) +* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim\` (Windows) * If you don't want to include it as a git repo, you can just clone it and then move the files to this location Additional system requirements: From 1d52d1e68b8aa7e399b218bf2faf363e5c093254 Mon Sep 17 00:00:00 2001 From: Pavel 'PK' Kaminsky Date: Tue, 30 May 2023 11:04:01 +0300 Subject: [PATCH 14/30] Update README.md fix(docs): whoops missed another instance of `nvim-data` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4a841ec..64f386c6 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Distribution Alternatives: * Extract the archive to: `~/.config/nvim` (Linux) `~/.config/nvim` (MacOS) - `%userprofile%\AppData\Local\nvim-data\` (Windows) + `%userprofile%\AppData\Local\nvim\` (Windows) * Ensure your extraction method did not extract with a parent folder. For example in ~/.config/nvim you should have init.lua not another folder called kickstart.nvim. ### Git Clone Installation From cdaa750c86cfc0c8f2fc1c8638b7296c327bf5a9 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sat, 3 Jun 2023 10:11:10 -0400 Subject: [PATCH 15/30] Refactor theme and status line into their own file --- init.lua | 29 ++++++---------------------- lua/kickstart/plugins/autoformat.lua | 14 +++----------- lua/kickstart/plugins/statusline.lua | 14 ++++++++++++++ lua/kickstart/plugins/theme.lua | 10 ++++++++++ 4 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 lua/kickstart/plugins/statusline.lua create mode 100644 lua/kickstart/plugins/theme.lua diff --git a/init.lua b/init.lua index ca2da6e1..5e9e5679 100644 --- a/init.lua +++ b/init.lua @@ -122,35 +122,18 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) - vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) + vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) + vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, + -- Theme related configs go here + require 'kickstart.plugins.theme', - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, + -- Status line related configs go here + require 'kickstart.plugins.statusline', { -- Add indentation guides even on blank lines diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index bc56b15b..855f350f 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,6 +5,7 @@ return { 'neovim/nvim-lspconfig', + config = function() -- Switch for controlling whether you want autoformatting. -- Use :KickstartFormatToggle to toggle autoformatting on or off @@ -28,11 +29,9 @@ return { return _augroups[client.id] end - -- Whenever an LSP attaches to a buffer, we will run this function. - -- - -- See `:help LspAttach` for more information about this autocmd event. vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), + -- This is where we attach the autoformatting for reasonable clients callback = function(args) local client_id = args.data.client_id @@ -50,8 +49,6 @@ return { return end - -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. vim.api.nvim_create_autocmd('BufWritePre', { group = get_augroup(client), buffer = bufnr, @@ -60,12 +57,7 @@ return { return end - vim.lsp.buf.format { - async = false, - filter = function(c) - return c.id == client.id - end, - } + vim.lsp.buf.format { async = false } end, }) end, diff --git a/lua/kickstart/plugins/statusline.lua b/lua/kickstart/plugins/statusline.lua new file mode 100644 index 00000000..f54393fa --- /dev/null +++ b/lua/kickstart/plugins/statusline.lua @@ -0,0 +1,14 @@ +return { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'tokyonight', + component_separators = '|', + section_separators = '', + }, + }, +} + diff --git a/lua/kickstart/plugins/theme.lua b/lua/kickstart/plugins/theme.lua new file mode 100644 index 00000000..794aa4d2 --- /dev/null +++ b/lua/kickstart/plugins/theme.lua @@ -0,0 +1,10 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + vim.cmd.colorscheme 'tokyonight-storm' + end, +} + From 5e4d24cb2faf37d341bc906affcc2cac21919c51 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sun, 4 Jun 2023 16:10:59 +0000 Subject: [PATCH 16/30] Revert "Refactor theme and status line into their own file" This reverts commit cdaa750c86cfc0c8f2fc1c8638b7296c327bf5a9. --- init.lua | 29 ++++++++++++++++++++++------ lua/kickstart/plugins/autoformat.lua | 14 +++++++++++--- lua/kickstart/plugins/statusline.lua | 14 -------------- lua/kickstart/plugins/theme.lua | 10 ---------- 4 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 lua/kickstart/plugins/statusline.lua delete mode 100644 lua/kickstart/plugins/theme.lua diff --git a/init.lua b/init.lua index 5e9e5679..ca2da6e1 100644 --- a/init.lua +++ b/init.lua @@ -122,18 +122,35 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' }) - vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, }, - -- Theme related configs go here - require 'kickstart.plugins.theme', + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + config = function() + vim.cmd.colorscheme 'onedark' + end, + }, - -- Status line related configs go here - require 'kickstart.plugins.statusline', + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, + }, + }, { -- Add indentation guides even on blank lines diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index 855f350f..bc56b15b 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,7 +5,6 @@ return { 'neovim/nvim-lspconfig', - config = function() -- Switch for controlling whether you want autoformatting. -- Use :KickstartFormatToggle to toggle autoformatting on or off @@ -29,9 +28,11 @@ return { return _augroups[client.id] end + -- Whenever an LSP attaches to a buffer, we will run this function. + -- + -- See `:help LspAttach` for more information about this autocmd event. vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), - -- This is where we attach the autoformatting for reasonable clients callback = function(args) local client_id = args.data.client_id @@ -49,6 +50,8 @@ return { return end + -- Create an autocmd that will run *before* we save the buffer. + -- Run the formatting command for the LSP that has just attached. vim.api.nvim_create_autocmd('BufWritePre', { group = get_augroup(client), buffer = bufnr, @@ -57,7 +60,12 @@ return { return end - vim.lsp.buf.format { async = false } + vim.lsp.buf.format { + async = false, + filter = function(c) + return c.id == client.id + end, + } end, }) end, diff --git a/lua/kickstart/plugins/statusline.lua b/lua/kickstart/plugins/statusline.lua deleted file mode 100644 index f54393fa..00000000 --- a/lua/kickstart/plugins/statusline.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'tokyonight', - component_separators = '|', - section_separators = '', - }, - }, -} - diff --git a/lua/kickstart/plugins/theme.lua b/lua/kickstart/plugins/theme.lua deleted file mode 100644 index 794aa4d2..00000000 --- a/lua/kickstart/plugins/theme.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - vim.cmd.colorscheme 'tokyonight-storm' - end, -} - From e6cb90b2b33127dafdee351cc84a1d4ae06ce71f Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Wed, 7 Jun 2023 20:41:30 -0400 Subject: [PATCH 17/30] Fixes #336 - Enabale treesitter indent for Python Tested in my local configuratoin. Indenting works great. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5e9e5679..200bfe7c 100644 --- a/init.lua +++ b/init.lua @@ -295,7 +295,7 @@ require('nvim-treesitter.configs').setup { auto_install = false, highlight = { enable = true }, - indent = { enable = true, disable = { 'python' } }, + indent = { enable = true }, incremental_selection = { enable = true, keymaps = { From ac07c5c59cb57688f0c63fa74a28bcc3d7795ecd Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 14 Jun 2023 17:21:15 -0400 Subject: [PATCH 18/30] Add legacy tag to fidget to avoid deprecation warning --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 57c9af42..c6217451 100644 --- a/init.lua +++ b/init.lua @@ -84,7 +84,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', From be90f025de58b08871d866eab8e4d3baeb9f4f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Fri, 16 Jun 2023 21:12:11 -0700 Subject: [PATCH 19/30] Use call_parentheses --- .stylua.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stylua.toml b/.stylua.toml index 5d12dbdf..139e9397 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -3,4 +3,4 @@ line_endings = "Unix" indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" -no_call_parentheses = true +call_parentheses = "None" From c45b17ebab9da4913baa09f37c393a1a6962119b Mon Sep 17 00:00:00 2001 From: Juan Giordana Date: Sun, 18 Jun 2023 00:10:49 -0300 Subject: [PATCH 20/30] Add descriptions for debugging keybindings. Add descriptions for debugging key bindings. Improve formatting by changing double quotes to single quotes in order to keep compatibility with the rest of the kickstart.nvim project. --- lua/kickstart/plugins/debug.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index deeda564..7fc783fa 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -43,14 +43,14 @@ return { } -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue) - vim.keymap.set('n', '', dap.step_into) - vim.keymap.set('n', '', dap.step_over) - vim.keymap.set('n', '', dap.step_out) - vim.keymap.set('n', 'b', dap.toggle_breakpoint) + vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) + vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) + vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) + vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) + vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) vim.keymap.set('n', 'B', function() dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end) + end, { desc = 'Debug: Set Breakpoint' }) -- Dap UI setup -- For more information, see |:help nvim-dap-ui| @@ -69,13 +69,14 @@ return { step_back = 'b', run_last = '▶▶', terminate = '⏹', - disconnect = "⏏", + disconnect = '⏏', }, }, } - -- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception. - vim.keymap.set("n", "", dapui.toggle) - + + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From d8b3b774bb642a9bdb2930f2ef0dd09e29a2f00c Mon Sep 17 00:00:00 2001 From: ilian Date: Sun, 18 Jun 2023 16:20:34 +0200 Subject: [PATCH 21/30] Fix typo in ignorecase comment In order to perform a case-sensitive search with ignorecase, the pattern should contain `\C` instead of `/C`. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c6217451..fd36919c 100644 --- a/init.lua +++ b/init.lua @@ -229,7 +229,7 @@ vim.o.breakindent = true -- Save undo history vim.o.undofile = true --- Case insensitive searching UNLESS /C or capital in search +-- Case-insensitive searching UNLESS \C or capital in search vim.o.ignorecase = true vim.o.smartcase = true From 957655ddb8be837a37c8e1fd0dd7f5c49705986e Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sat, 1 Jul 2023 12:34:20 -0400 Subject: [PATCH 22/30] Make init.lua copy-paste friendly --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index fd36919c..f8d9383f 100644 --- a/init.lua +++ b/init.lua @@ -197,12 +197,13 @@ require('lazy').setup({ -- require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', - -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - { import = 'custom.plugins' }, + -- { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] From a73b2e5f57059aeff4f6a4cc5ea15f9b012ec9b8 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sat, 1 Jul 2023 11:21:10 -0400 Subject: [PATCH 23/30] =?UTF-8?q?docs:=20Update=20README.md=20=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 64f386c6..99914cf1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # kickstart.nvim +https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b + ### Introduction A starting point for Neovim that is: From 93ef2e8078900d2a19936beb8cd37706cdb7dbdb Mon Sep 17 00:00:00 2001 From: Andres Lowrie Date: Fri, 7 Jul 2023 08:37:12 -0500 Subject: [PATCH 24/30] correct typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hey y'all 👋 I think there may have been a typo? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64f386c6..e0b0470a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A starting point for Neovim that is: * Documented * Modular -This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. +This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. From 31f867a69947f96f7b3ae1a9d49d2a12a3220a8f Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Mon, 17 Jul 2023 10:21:44 -0400 Subject: [PATCH 25/30] Remove timeout --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index f8d9383f..859d9d2a 100644 --- a/init.lua +++ b/init.lua @@ -239,7 +239,6 @@ vim.wo.signcolumn = 'yes' -- Decrease update time vim.o.updatetime = 250 -vim.o.timeout = true vim.o.timeoutlen = 300 -- Set completeopt to have a better completion experience From 78ab7ee09411676d01138faafc03a3e638d5f560 Mon Sep 17 00:00:00 2001 From: Dennis-Rall <56480601+Dennis-Rall@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:56:15 +0200 Subject: [PATCH 26/30] Add hint to uncomment line to autodetect plugins --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a128bcf..b38867dd 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Additional system requirements: * Inside of your copy, feel free to modify any file you like! It's your copy! * Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` + * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment line 206 in init.lua therefore) * Modify `init.lua` with additional plugins. * Include the `lua/kickstart/plugins/*` files in your configuration. From c151235551781459fdb60af17c8d5c5f3ee94170 Mon Sep 17 00:00:00 2001 From: Dennis-Rall <56480601+Dennis-Rall@users.noreply.github.com> Date: Thu, 20 Jul 2023 16:42:46 +0200 Subject: [PATCH 27/30] Remove fixed line number and describe line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b38867dd..ef597600 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Additional system requirements: * Inside of your copy, feel free to modify any file you like! It's your copy! * Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment line 206 in init.lua therefore) + * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) * Modify `init.lua` with additional plugins. * Include the `lua/kickstart/plugins/*` files in your configuration. From 29aa5bf42df01c6983c5ea7b464e0535de46f628 Mon Sep 17 00:00:00 2001 From: Numkil Date: Mon, 24 Jul 2023 20:41:14 +0200 Subject: [PATCH 28/30] setup more language servers i use + allow customizing filetypes --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 859d9d2a..e5cbed98 100644 --- a/init.lua +++ b/init.lua @@ -424,12 +424,16 @@ end -- -- Add any additional override configuration in the following tables. They will be passed to -- the `settings` field of the server config. You must look up that documentation yourself. +-- +-- If you want to override the default filetypes that your language server will attach to you can +-- define the property 'filetypes' to the map in question. local servers = { -- clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- tsserver = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs'} }, lua_ls = { Lua = { @@ -459,8 +463,9 @@ mason_lspconfig.setup_handlers { capabilities = capabilities, on_attach = on_attach, settings = servers[server_name], + filetypes = servers[server_name].filetypes, } - end, + end } -- [[ Configure nvim-cmp ]] From 734cc4e94aec64c8cb3504711978c51b092f2542 Mon Sep 17 00:00:00 2001 From: Merel Jossart Date: Tue, 25 Jul 2023 17:06:04 +0200 Subject: [PATCH 29/30] Fix bug when server not explicitely defined in configuration but installed --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e5cbed98..c6e7a981 100644 --- a/init.lua +++ b/init.lua @@ -463,7 +463,7 @@ mason_lspconfig.setup_handlers { capabilities = capabilities, on_attach = on_attach, settings = servers[server_name], - filetypes = servers[server_name].filetypes, + filetypes = (servers[server_name] or {}).filetypes, } end } From c2fb482ec14041f4537d2269b554818894de7f8e Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Mon, 31 Jul 2023 02:46:27 +0900 Subject: [PATCH 30/30] Fix typo in init.lua releated -> related --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c6e7a981..160d9400 100644 --- a/init.lua +++ b/init.lua @@ -110,7 +110,7 @@ require('lazy').setup({ -- Useful plugin to show you pending keybinds. { 'folke/which-key.nvim', opts = {} }, { - -- Adds git releated signs to the gutter, as well as utilities for managing changes + -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { -- See `:help gitsigns.txt`