Merge branch 'master' into my-nvim-config

This commit is contained in:
Charlie McGoldrick 2026-02-12 16:54:08 +00:00 committed by GitHub
commit abbbb99da1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 124 additions and 86 deletions

5
.gitignore vendored
View File

@ -4,4 +4,9 @@ test.sh
nvim nvim
spell/ spell/
# You can uncomment this yourself if you want to lock the lazy-lock.json,
# but for kickstart, it makes sense to leave it ignored.
lazy-lock.json lazy-lock.json
.DS_Store

View File

@ -4,3 +4,4 @@ indent_type = "Spaces"
indent_width = 2 indent_width = 2
quote_style = "AutoPreferSingle" quote_style = "AutoPreferSingle"
call_parentheses = "None" call_parentheses = "None"
collapse_simple_statement = "Always"

View File

@ -17,7 +17,14 @@ A starting point for Neovim that is:
Kickstart.nvim targets *only* the latest Kickstart.nvim targets *only* the latest
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
If you are experiencing issues, please make sure you have the latest versions. If you are experiencing issues, please make sure you have at least the latest
stable version. Most likely, you want to install neovim via a [package
manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package).
To check your neovim version, run `nvim --version` and make sure it is not
below the latest
['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If
your chosen install method only gives you an outdated version of neovim, find
alternative [installation methods below](#alternative-neovim-installation-methods).
### Install External Dependencies ### Install External Dependencies
@ -154,7 +161,7 @@ examples of adding popularly requested plugins.
Below you can find OS specific install instructions for Neovim and dependencies. 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. After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step.
#### Windows Installation #### Windows Installation
@ -239,3 +246,77 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
``` ```
</details> </details>
### Alternative neovim installation methods
For some systems it is not unexpected that the [package manager installation
method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
recommended by neovim is significantly behind. If that is the case for you,
pick one of the following methods that are known to deliver fresh neovim versions very quickly.
They have been picked for their popularity and because they make installing and updating
neovim to the latest versions easy. You can also find more detail about the
available methods being discussed
[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583).
<details><summary>Bob</summary>
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
all plattforms. Simply install
[rustup](https://rust-lang.github.io/rustup/installation/other.html),
and run the following commands:
```bash
rustup default stable
rustup update stable
cargo install bob-nvim
bob use stable
```
</details>
<details><summary>Homebrew</summary>
[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux.
Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim).
</details>
<details><summary>Flatpak</summary>
Flatpak is a package manager for applications that allows developers to package their applications
just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/)
and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim).
</details>
<details><summary>asdf and mise-en-place</summary>
[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers,
mostly aimed towards project-specific tool versioning. However both support managing tools
globally in the user-space as well:
<details><summary>mise</summary>
[Install mise](https://mise.jdx.dev/getting-started.html), then run:
```bash
mise plugins install neovim
mise use neovim@stable
```
</details>
<details><summary>asdf</summary>
[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run:
```bash
asdf plugin add neovim
asdf install neovim stable
asdf set neovim stable --home
asdf reshim neovim
```
</details>
</details>

View File

@ -33,9 +33,7 @@ vim.o.showmode = false
-- Sync clipboard between OS and Neovim. -- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Schedule the setting after `UiEnter` because it can increase startup-time.
-- See `:help 'clipboard'` -- See `:help 'clipboard'`
vim.schedule(function() vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
vim.o.clipboard = 'unnamedplus'
end)
vim.o.breakindent = true -- Enable break indent vim.o.breakindent = true -- Enable break indent
vim.o.undofile = true -- Save undo history vim.o.undofile = true -- Save undo history
@ -64,7 +62,7 @@ vim.o.splitbelow = true
-- Notice listchars is set using `vim.opt` instead of `vim.o`. -- Notice listchars is set using `vim.opt` instead of `vim.o`.
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
-- See `:help lua-options` -- See `:help lua-options`
-- and `:help lua-options-guide` -- and `:help lua-guide-options`
vim.o.list = true vim.o.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' } vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
@ -96,7 +94,22 @@ vim.o.confirm = true
-- See `:help hlsearch` -- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostic keymaps -- Diagnostic Config & Keymaps
-- See :help vim.diagnostic.Opts
vim.diagnostic.config {
update_in_insert = false,
severity_sort = true,
float = { border = 'rounded', source = 'if_many' },
underline = { severity = vim.diagnostic.severity.ERROR },
-- Can switch between these as you prefer
virtual_text = true, -- Text shows up at the end of the line
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
jump = { float = true },
}
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@ -139,9 +152,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
vim.api.nvim_create_autocmd('TextYankPost', { vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text', desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function() callback = function() vim.hl.on_yank() end,
vim.hl.on_yank()
end,
}) })
-- Terminal auto command -- Terminal auto command
@ -188,9 +199,7 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = 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 if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end
error('Error cloning lazy.nvim:\n' .. out)
end
end end
---@type vim.Option ---@type vim.Option
@ -245,51 +254,15 @@ require('lazy').setup({
{ -- Useful plugin to show you pending keybinds. { -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim', 'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter' event = 'VimEnter',
opts = { opts = {
-- delay between pressing a key and opening which-key (milliseconds) -- delay between pressing a key and opening which-key (milliseconds)
-- this setting is independent of vim.o.timeoutlen
delay = 0, delay = 0,
icons = { icons = { mappings = vim.g.have_nerd_font },
-- set icon mappings to true if you have a Nerd Font
mappings = vim.g.have_nerd_font,
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ',
Down = '<Down> ',
Left = '<Left> ',
Right = '<Right> ',
C = '<C-…> ',
M = '<M-…> ',
D = '<D-…> ',
S = '<S-…> ',
CR = '<CR> ',
Esc = '<Esc> ',
ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ',
NL = '<NL> ',
BS = '<BS> ',
Space = '<Space> ',
Tab = '<Tab> ',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
-- Document existing key chains -- Document existing key chains
spec = { spec = {
{ '<leader>s', group = '[S]earch' }, { '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
{ '<leader>t', group = '[T]oggle' }, { '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
}, },

View File

@ -12,7 +12,7 @@ local check_version = function()
return return
end end
if vim.version.ge(vim.version(), '0.10-dev') then if vim.version.ge(vim.version(), '0.11') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr)) vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))

View File

@ -28,52 +28,38 @@ return {
-- Basic debugging keymaps, feel free to change to your liking! -- Basic debugging keymaps, feel free to change to your liking!
{ {
'<F5>', '<F5>',
function() function() require('dap').continue() end,
require('dap').continue()
end,
desc = 'Debug: Start/Continue', desc = 'Debug: Start/Continue',
}, },
{ {
'<F1>', '<F1>',
function() function() require('dap').step_into() end,
require('dap').step_into()
end,
desc = 'Debug: Step Into', desc = 'Debug: Step Into',
}, },
{ {
'<F2>', '<F2>',
function() function() require('dap').step_over() end,
require('dap').step_over()
end,
desc = 'Debug: Step Over', desc = 'Debug: Step Over',
}, },
{ {
'<F3>', '<F3>',
function() function() require('dap').step_out() end,
require('dap').step_out()
end,
desc = 'Debug: Step Out', desc = 'Debug: Step Out',
}, },
{ {
'<leader>b', '<leader>b',
function() function() require('dap').toggle_breakpoint() end,
require('dap').toggle_breakpoint()
end,
desc = 'Debug: Toggle Breakpoint', desc = 'Debug: Toggle Breakpoint',
}, },
{ {
'<leader>B', '<leader>B',
function() function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end,
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end,
desc = 'Debug: Set Breakpoint', desc = 'Debug: Set Breakpoint',
}, },
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
{ {
'<F7>', '<F7>',
function() function() require('dapui').toggle() end,
require('dapui').toggle()
end,
desc = 'Debug: See last session result.', desc = 'Debug: See last session result.',
}, },
}, },

View File

@ -34,12 +34,8 @@ return {
-- Actions -- Actions
-- visual mode -- visual mode
map('v', '<leader>hs', function() map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [r]eset hunk' })
-- normal mode -- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
@ -49,9 +45,7 @@ return {
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles -- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })

View File

@ -50,9 +50,7 @@ return {
-- Only run the linter in buffers that you can modify in order to -- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that -- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown. -- describe the hovered symbol using Markdown.
if vim.bo.modifiable then if vim.bo.modifiable then lint.try_lint() end
lint.try_lint()
end
end, end,
}) })
end, end,