Skip to content

Commit e1d6094

Browse files
committed
Merge 'upstream' Neovim 0.10 updates and more
Merged commits from upstream: Update comment about the toggle inlay hints keymap lint: fix lsp warning in `vim.lsp.inlay_hint.is_enabled` Update lazydev config to fix "Undefined field `fs_stat`" LSP error Neovim 0.10 updates Fix comment about mini.ai example Make conform.nvim be lazy-loadable again Update README.md | %userprofile%\appdata\local -> %localappdata% Make debug lazy loadable Remove redundant require Fix neo-tree keymap description fix: add required parsers from nvim-treesitter
2 parents a6442e8 + 56b9114 commit e1d6094

13 files changed

Lines changed: 57 additions & 43 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Neovim's configurations are located under the following paths, depending on your
4848
| OS | PATH |
4949
| :- | :--- |
5050
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
51-
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
52-
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
51+
| Windows (cmd)| `%localappdata%\nvim\` |
52+
| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` |
5353

5454
#### Recommended Step
5555

@@ -79,13 +79,13 @@ git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HO
7979
If you're using `cmd.exe`:
8080

8181
```
82-
git clone https://github.com/dam9000/kickstart-modular.nvim.git %userprofile%\AppData\Local\nvim\
82+
git clone https://github.com/dam9000/kickstart.nvim.git %localappdata%\nvim\
8383
```
8484

8585
If you're using `powershell.exe`
8686

8787
```
88-
git clone https://github.com/dam9000/kickstart-modular.nvim.git $env:USERPROFILE\AppData\Local\nvim\
88+
git clone https://github.com/dam9000/kickstart.nvim.git $env:LOCALAPPDATA\nvim\
8989
```
9090

9191
</details>

lua/keymaps.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ vim.opt.hlsearch = true
66
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
77

88
-- Diagnostic keymaps
9-
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
10-
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
11-
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
129
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
1310

1411
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier

lua/kickstart/health.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
--]]
77

88
local check_version = function()
9-
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
10-
if not vim.version.cmp then
9+
local verstr = tostring(vim.version())
10+
if not vim.version.ge then
1111
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
1212
return
1313
end
1414

15-
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
15+
if vim.version.ge(vim.version(), '0.10-dev') then
1616
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
1717
else
1818
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))

lua/kickstart/plugins/cmp.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ return {
102102
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
103103
},
104104
sources = {
105+
{
106+
name = 'lazydev',
107+
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
108+
group_index = 0,
109+
},
105110
{ name = 'nvim_lsp' },
106111
{ name = 'luasnip' },
107112
{ name = 'path' },

lua/kickstart/plugins/conform.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
return {
22
{ -- Autoformat
33
'stevearc/conform.nvim',
4-
lazy = false,
4+
event = { 'BufWritePre' },
5+
cmd = { 'ConformInfo' },
56
keys = {
67
{
78
'<leader>f',

lua/kickstart/plugins/debug.lua

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ return {
2424
-- Add your own debuggers here
2525
'leoluz/nvim-dap-go',
2626
},
27+
keys = function(_, keys)
28+
local dap = require 'dap'
29+
local dapui = require 'dapui'
30+
return {
31+
-- Basic debugging keymaps, feel free to change to your liking!
32+
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
33+
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
34+
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
35+
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
36+
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
37+
{
38+
'<leader>B',
39+
function()
40+
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
41+
end,
42+
desc = 'Debug: Set Breakpoint',
43+
},
44+
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
45+
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
46+
unpack(keys),
47+
}
48+
end,
2749
config = function()
2850
local dap = require 'dap'
2951
local dapui = require 'dapui'
@@ -45,16 +67,6 @@ return {
4567
},
4668
}
4769

48-
-- Basic debugging keymaps, feel free to change to your liking!
49-
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
50-
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
51-
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
52-
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
53-
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
54-
vim.keymap.set('n', '<leader>B', function()
55-
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
56-
end, { desc = 'Debug: Set Breakpoint' })
57-
5870
-- Dap UI setup
5971
-- For more information, see |:help nvim-dap-ui|
6072
dapui.setup {
@@ -77,9 +89,6 @@ return {
7789
},
7890
}
7991

80-
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
81-
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
82-
8392
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
8493
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
8594
dap.listeners.before.event_exited['dapui_config'] = dapui.close

lua/kickstart/plugins/lint.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ return {
4747
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
4848
group = lint_augroup,
4949
callback = function()
50-
require('lint').try_lint()
50+
lint.try_lint()
5151
end,
5252
})
5353
end,

lua/kickstart/plugins/lspconfig.lua

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ return {
1111
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
1212
{ 'j-hui/fidget.nvim', opts = {} },
1313

14-
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
14+
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
1515
-- used for completion, annotations and signatures of Neovim apis
16-
{ 'folke/neodev.nvim', opts = {} },
16+
{
17+
'folke/lazydev.nvim',
18+
ft = 'lua',
19+
opts = {
20+
library = {
21+
-- Load luvit types when the `vim.uv` word is found
22+
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
23+
},
24+
},
25+
},
26+
{ 'Bilal2453/luvit-meta', lazy = true },
1727
},
1828
config = function()
1929
-- Brief aside: **What is LSP?**
@@ -90,10 +100,6 @@ return {
90100
-- or a suggestion from your LSP for this to activate.
91101
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
92102

93-
-- Opens a popup that displays documentation about the word under your cursor
94-
-- See `:help K` for why this keymap.
95-
map('K', vim.lsp.buf.hover, 'Hover Documentation')
96-
97103
-- WARN: This is not Goto Definition, this is Goto Declaration.
98104
-- For example, in C this would take you to the header.
99105
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
@@ -104,7 +110,7 @@ return {
104110
--
105111
-- When you move your cursor, the highlights will be cleared (the second autocommand).
106112
local client = vim.lsp.get_client_by_id(event.data.client_id)
107-
if client and client.server_capabilities.documentHighlightProvider then
113+
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
108114
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
109115
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
110116
buffer = event.buf,
@@ -127,13 +133,13 @@ return {
127133
})
128134
end
129135

130-
-- The following autocommand is used to enable inlay hints in your
136+
-- The following code creates a keymap to toggle inlay hints in your
131137
-- code, if the language server you are using supports them
132138
--
133139
-- This may be unwanted, since they displace some of your code
134-
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
140+
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
135141
map('<leader>th', function()
136-
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
142+
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
137143
end, '[T]oggle Inlay [H]ints')
138144
end
139145
end,

lua/kickstart/plugins/mini.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ return {
66
--
77
-- Examples:
88
-- - va) - [V]isually select [A]round [)]paren
9-
-- - yinq - [Y]ank [I]nside [N]ext [']quote
9+
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
1010
-- - ci' - [C]hange [I]nside [']quote
1111
require('mini.ai').setup { n_lines = 500 }
1212

lua/kickstart/plugins/neo-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ return {
1111
},
1212
cmd = 'Neotree',
1313
keys = {
14-
{ '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
14+
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
1515
},
1616
opts = {
1717
filesystem = {

0 commit comments

Comments
 (0)