Skip to content

Commit c97a82e

Browse files
Peter-McKinneyrmacklinsmiggiddyPerMalmbergVlaDexa
authored
update with upstream (#12)
* Add diff to treesitter's ensure_installed languages (nvim-lua#908) * fix: debug.lua (nvim-lua#918) * Automatically set detached state as needed. (nvim-lua#925) * Automatically set detached state as needed. * Use vim.fn.has instead. * Fix int vs bool. * which-key v3 update (nvim-lua#1022) * which-key v3 update * remove unneeded brackets from which-key registration * fix(lazy): added error handling for bootstrap (nvim-lua#1001) * fix: add required parsers from nvim-treesitter * Fix neo-tree keymap description (nvim-lua#932) The lazy.nvim keys parameter does not need the `desc` to be inside a table in the way that vim.keymap.set() does. With this fix the keymap description will be properly shown for example in telescope keymap search * Remove redundant require (nvim-lua#959) * Make debug lazy loadable (nvim-lua#978) * Update README.md | %userprofile%\appdata\local -> %localappdata% (nvim-lua#963) - Replace `%userprofile%\AppData\Local\nvim\` and `$env:USERPROFILE\AppData\Local\nvim` to `%localappdata%\nvim` and `$env:LOCALAPPDATA\nvim respectfully` * Make conform.nvim be lazy-loadable again (nvim-lua#977) The PR that disabled lazy loading (nvim-lua#818) was to fix plugin not being loaded before write. This sets up lazy to load conform before write. * Fix comment about mini.ai example (nvim-lua#985) This example wasn't using `'` so this makes more sense * Neovim 0.10 updates (nvim-lua#936) * Neovim 0.10 updates Provide the buffer for which to enable inlay hints Co-authored-by: Matt Mirus <[email protected]> * refactor: replace vim.loop with vim.uv * Upgrade folke/neodev (sunsetting) to folke/lazydev * Update checkhealth for 0.10 release --------- Co-authored-by: Matt Mirus <[email protected]> Co-authored-by: mrr11k <[email protected]> Co-authored-by: Seb Tomasini <[email protected]> * Update lazydev config to fix "Undefined field `fs_stat`" LSP error (nvim-lua#1040) 7513ec8 switched from neodev to lazydev, but in the process it introduced an LSP error in `init.lua`, which degrades the desired "first timer" experience of kickstart.nvim. This commit follows the configuration suggested in https://github.com/folke/lazydev.nvim/tree/6184ebbbc8045d70077659b7d30c705a588dc62f#-installation which resolves the LSP error. * lint: fix lsp warning in `vim.lsp.inlay_hint.is_enabled` (nvim-lua#947) * fix: lsp warning * review suggestion Co-authored-by: Tom Kuson <[email protected]> --------- Co-authored-by: Tom Kuson <[email protected]> * Update comment about the toggle inlay hints keymap (nvim-lua#1041) * Remove hint toggle in favor of default --------- Co-authored-by: Richard Macklin <[email protected]> Co-authored-by: Smig <[email protected]> Co-authored-by: Per Malmberg <[email protected]> Co-authored-by: Vladislav Grechannik <[email protected]> Co-authored-by: Folke Lemaitre <[email protected]> Co-authored-by: TJ DeVries <[email protected]> Co-authored-by: Damjan 9000 <[email protected]> Co-authored-by: Tom Kuson <[email protected]> Co-authored-by: Artyom <[email protected]> Co-authored-by: Matt Mirus <[email protected]> Co-authored-by: mrr11k <[email protected]> Co-authored-by: Seb Tomasini <[email protected]> Co-authored-by: srdtrk <[email protected]>
1 parent 5ef5842 commit c97a82e

File tree

6 files changed

+77
-60
lines changed

6 files changed

+77
-60
lines changed

README.md

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

5252
#### Recommended Step
5353

@@ -77,13 +77,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO
7777
If you're using `cmd.exe`:
7878

7979
```
80-
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
80+
git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\
8181
```
8282

8383
If you're using `powershell.exe`
8484

8585
```
86-
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
86+
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\
8787
```
8888

8989
</details>

init.lua

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ vim.opt.hlsearch = true
164164
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
165165

166166
-- Diagnostic keymaps
167-
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
168-
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
169-
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
170167
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
171168

172169
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -209,9 +206,12 @@ vim.api.nvim_create_autocmd('TextYankPost', {
209206
-- [[ Install `lazy.nvim` plugin manager ]]
210207
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
211208
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
212-
if not vim.loop.fs_stat(lazypath) then
209+
if not vim.uv.fs_stat(lazypath) then
213210
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
214-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
211+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
212+
if vim.v.shell_error ~= 0 then
213+
error('Error cloning lazy.nvim:\n' .. out)
214+
end
215215
end ---@diagnostic disable-next-line: undefined-field
216216
vim.opt.rtp:prepend(lazypath)
217217

@@ -236,11 +236,6 @@ require('lazy').setup({
236236
--
237237
-- Use `opts = {}` to force a plugin to be loaded.
238238
--
239-
-- This is equivalent to:
240-
-- require('Comment').setup({})
241-
242-
-- "gc" to comment visual regions/lines
243-
{ 'numToStr/Comment.nvim', opts = {} },
244239

245240
-- Here is a more advanced example where we pass configuration
246241
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -289,16 +284,15 @@ require('lazy').setup({
289284
require('which-key').setup()
290285

291286
-- Document existing key chains
292-
require('which-key').register {
293-
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
294-
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
295-
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
296-
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
287+
require('which-key').add {
288+
{ '<leader>c', group = '[C]ode' },
289+
{ '<leader>d', group = '[D]ocument' },
290+
{ '<leader>r', group = '[R]ename' },
291+
{ '<leader>s', group = '[S]earch' },
292+
{ '<leader>w', group = '[W]orkspace' },
293+
{ '<leader>t', group = '[T]oggle' },
294+
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
297295
}
298-
-- visual mode
299-
require('which-key').register({
300-
['<leader>h'] = { 'Git [H]unk' },
301-
}, { mode = 'v' })
302296
end,
303297
},
304298

@@ -426,9 +420,19 @@ require('lazy').setup({
426420
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
427421
{ 'j-hui/fidget.nvim', opts = {} },
428422

429-
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
423+
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
430424
-- used for completion, annotations and signatures of Neovim apis
431-
{ 'folke/neodev.nvim', opts = {} },
425+
{
426+
'folke/lazydev.nvim',
427+
ft = 'lua',
428+
opts = {
429+
library = {
430+
-- Load luvit types when the `vim.uv` word is found
431+
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
432+
},
433+
},
434+
},
435+
{ 'Bilal2453/luvit-meta', lazy = true },
432436
},
433437
config = function()
434438
-- Brief aside: **What is LSP?**
@@ -505,10 +509,6 @@ require('lazy').setup({
505509
-- or a suggestion from your LSP for this to activate.
506510
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
507511

508-
-- Opens a popup that displays documentation about the word under your cursor
509-
-- See `:help K` for why this keymap.
510-
map('K', vim.lsp.buf.hover, 'Hover Documentation')
511-
512512
-- WARN: This is not Goto Definition, this is Goto Declaration.
513513
-- For example, in C this would take you to the header.
514514
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
@@ -519,7 +519,7 @@ require('lazy').setup({
519519
--
520520
-- When you move your cursor, the highlights will be cleared (the second autocommand).
521521
local client = vim.lsp.get_client_by_id(event.data.client_id)
522-
if client and client.server_capabilities.documentHighlightProvider then
522+
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
523523
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
524524
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
525525
buffer = event.buf,
@@ -542,13 +542,13 @@ require('lazy').setup({
542542
})
543543
end
544544

545-
-- The following autocommand is used to enable inlay hints in your
545+
-- The following code creates a keymap to toggle inlay hints in your
546546
-- code, if the language server you are using supports them
547547
--
548548
-- This may be unwanted, since they displace some of your code
549-
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
549+
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
550550
map('<leader>th', function()
551-
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
551+
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
552552
end, '[T]oggle Inlay [H]ints')
553553
end
554554
end,
@@ -639,7 +639,8 @@ require('lazy').setup({
639639

640640
{ -- Autoformat
641641
'stevearc/conform.nvim',
642-
lazy = false,
642+
event = { 'BufWritePre' },
643+
cmd = { 'ConformInfo' },
643644
keys = {
644645
{
645646
'<leader>f',
@@ -795,6 +796,11 @@ require('lazy').setup({
795796
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
796797
},
797798
sources = {
799+
{
800+
name = 'lazydev',
801+
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
802+
group_index = 0,
803+
},
798804
{ name = 'nvim_lsp' },
799805
{ name = 'luasnip' },
800806
{ name = 'path' },
@@ -813,7 +819,7 @@ require('lazy').setup({
813819
--
814820
-- Examples:
815821
-- - va) - [V]isually select [A]round [)]paren
816-
-- - yinq - [Y]ank [I]nside [N]ext [']quote
822+
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
817823
-- - ci' - [C]hange [I]nside [']quote
818824
require('mini.ai').setup { n_lines = 500 }
819825

@@ -850,7 +856,7 @@ require('lazy').setup({
850856
},
851857
build = ':TSUpdate',
852858
opts = {
853-
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
859+
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
854860
-- Autoinstall languages that are not installed
855861
auto_install = true,
856862
highlight = {
@@ -1062,10 +1068,6 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos
10621068
vim.keymap.set('n', '<leader>ld', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
10631069
vim.o.shellcmdflag = '-ic'
10641070

1065-
vim.keymap.set('n', '<leader>h', function()
1066-
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
1067-
end)
1068-
10691071
-- toggle hidden file searching in telescope
10701072
function _G.toggle_hidden_file_searching()
10711073
_G.hidden_files = not _G.hidden_files

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/debug.lua

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,36 @@ 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'
3052

3153
require('mason-nvim-dap').setup {
3254
-- Makes a best effort to setup the various debuggers with
3355
-- reasonable debug configurations
34-
automatic_setup = true,
56+
automatic_installation = true,
3557

3658
-- You can provide additional configuration to the handlers,
3759
-- see mason-nvim-dap README for more information
@@ -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,14 +89,17 @@ 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
8695

8796
-- Install golang specific config
88-
require('dap-go').setup()
97+
require('dap-go').setup {
98+
delve = {
99+
-- On Windows delve must be run attached or it crashes.
100+
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
101+
detached = vim.fn.has 'win32' == 0,
102+
},
103+
}
89104
end,
90105
}

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/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)