@@ -162,9 +162,6 @@ vim.opt.hlsearch = true
162
162
vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
163
163
164
164
-- Diagnostic keymaps
165
- vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous [D]iagnostic message' })
166
- vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next [D]iagnostic message' })
167
- vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Show diagnostic [E]rror messages' })
168
165
vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
169
166
170
167
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -207,7 +204,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
207
204
-- [[ Install `lazy.nvim` plugin manager ]]
208
205
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
209
206
local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
210
- if not vim .loop .fs_stat (lazypath ) then
207
+ if not vim .uv .fs_stat (lazypath ) then
211
208
local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
212
209
local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
213
210
if vim .v .shell_error ~= 0 then
@@ -237,11 +234,6 @@ require('lazy').setup({
237
234
--
238
235
-- Use `opts = {}` to force a plugin to be loaded.
239
236
--
240
- -- This is equivalent to:
241
- -- require('Comment').setup({})
242
-
243
- -- "gc" to comment visual regions/lines
244
- { ' numToStr/Comment.nvim' , opts = {} },
245
237
246
238
-- Here is a more advanced example where we pass configuration
247
239
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -421,9 +413,9 @@ require('lazy').setup({
421
413
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
422
414
{ ' j-hui/fidget.nvim' , opts = {} },
423
415
424
- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
416
+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
425
417
-- used for completion, annotations and signatures of Neovim apis
426
- { ' folke/neodev .nvim' , opts = {} },
418
+ { ' folke/lazydev .nvim' , ft = ' lua ' , opts = {} },
427
419
},
428
420
config = function ()
429
421
-- Brief aside: **What is LSP?**
@@ -500,10 +492,6 @@ require('lazy').setup({
500
492
-- or a suggestion from your LSP for this to activate.
501
493
map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
502
494
503
- -- Opens a popup that displays documentation about the word under your cursor
504
- -- See `:help K` for why this keymap.
505
- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
506
-
507
495
-- WARN: This is not Goto Definition, this is Goto Declaration.
508
496
-- For example, in C this would take you to the header.
509
497
map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -514,7 +502,7 @@ require('lazy').setup({
514
502
--
515
503
-- When you move your cursor, the highlights will be cleared (the second autocommand).
516
504
local client = vim .lsp .get_client_by_id (event .data .client_id )
517
- if client and client .server_capabilities . documentHighlightProvider then
505
+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
518
506
local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
519
507
vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
520
508
buffer = event .buf ,
@@ -541,9 +529,9 @@ require('lazy').setup({
541
529
-- code, if the language server you are using supports them
542
530
--
543
531
-- This may be unwanted, since they displace some of your code
544
- if client and client .server_capabilities . inlayHintProvider and vim .lsp .inlay_hint then
532
+ if client and client .supports_method ( vim .lsp .protocol . Methods . textDocument_inlayHint ) then
545
533
map (' <leader>th' , function ()
546
- vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled () )
534
+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event . buf } )
547
535
end , ' [T]oggle Inlay [H]ints' )
548
536
end
549
537
end ,
@@ -767,6 +755,11 @@ require('lazy').setup({
767
755
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
768
756
},
769
757
sources = {
758
+ {
759
+ name = ' lazydev' ,
760
+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
761
+ group_index = 0 ,
762
+ },
770
763
{ name = ' nvim_lsp' },
771
764
{ name = ' luasnip' },
772
765
{ name = ' path' },
0 commit comments