@@ -164,9 +164,6 @@ vim.opt.hlsearch = true
164
164
vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
165
165
166
166
-- 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' })
170
167
vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
171
168
172
169
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -222,7 +219,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
222
219
-- [[ Install `lazy.nvim` plugin manager ]]
223
220
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
224
221
local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
225
- if not vim .loop .fs_stat (lazypath ) then
222
+ if not vim .uv .fs_stat (lazypath ) then
226
223
local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
227
224
local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
228
225
if vim .v .shell_error ~= 0 then
@@ -252,11 +249,6 @@ require('lazy').setup({
252
249
--
253
250
-- Use `opts = {}` to force a plugin to be loaded.
254
251
--
255
- -- This is equivalent to:
256
- -- require('Comment').setup({})
257
-
258
- -- "gc" to comment visual regions/lines
259
- { ' numToStr/Comment.nvim' , opts = {} },
260
252
261
253
-- Here is a more advanced example where we pass configuration
262
254
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -438,9 +430,9 @@ require('lazy').setup({
438
430
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
439
431
{ ' j-hui/fidget.nvim' , opts = {} },
440
432
441
- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
433
+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
442
434
-- used for completion, annotations and signatures of Neovim apis
443
- { ' folke/neodev .nvim' , opts = {} },
435
+ { ' folke/lazydev .nvim' , ft = ' lua ' , opts = {} },
444
436
},
445
437
config = function ()
446
438
-- Brief aside: **What is LSP?**
@@ -517,10 +509,6 @@ require('lazy').setup({
517
509
-- or a suggestion from your LSP for this to activate.
518
510
map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
519
511
520
- -- Opens a popup that displays documentation about the word under your cursor
521
- -- See `:help K` for why this keymap.
522
- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
523
-
524
512
-- WARN: This is not Goto Definition, this is Goto Declaration.
525
513
-- For example, in C this would take you to the header.
526
514
map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -531,7 +519,7 @@ require('lazy').setup({
531
519
--
532
520
-- When you move your cursor, the highlights will be cleared (the second autocommand).
533
521
local client = vim .lsp .get_client_by_id (event .data .client_id )
534
- if client and client .server_capabilities . documentHighlightProvider then
522
+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
535
523
local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
536
524
vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
537
525
buffer = event .buf ,
@@ -558,9 +546,9 @@ require('lazy').setup({
558
546
-- code, if the language server you are using supports them
559
547
--
560
548
-- This may be unwanted, since they displace some of your code
561
- 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
562
550
map (' <leader>th' , function ()
563
- 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 } )
564
552
end , ' [T]oggle Inlay [H]ints' )
565
553
end
566
554
end ,
@@ -786,6 +774,11 @@ require('lazy').setup({
786
774
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
787
775
},
788
776
sources = {
777
+ {
778
+ name = ' lazydev' ,
779
+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
780
+ group_index = 0 ,
781
+ },
789
782
{ name = ' nvim_lsp' },
790
783
{ name = ' luasnip' },
791
784
{ name = ' path' },
0 commit comments