From e2bfa0c66f474f7d8863a8bc05e3d5bdf704f7bf Mon Sep 17 00:00:00 2001 From: rdvm Date: Tue, 16 Apr 2024 10:29:27 -0500 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 05/10] 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 06/10] 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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.