@@ -161,9 +161,6 @@ vim.opt.hlsearch = true
161161vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
162162
163163-- Diagnostic keymaps
164- vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous [D]iagnostic message' })
165- vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next [D]iagnostic message' })
166- vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Show diagnostic [E]rror messages' })
167164vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
168165
169166-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -206,7 +203,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
206203-- [[ Install `lazy.nvim` plugin manager ]]
207204-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
208205local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
209- if not vim .loop .fs_stat (lazypath ) then
206+ if not vim .uv .fs_stat (lazypath ) then
210207 local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
211208 local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
212209 if vim .v .shell_error ~= 0 then
@@ -236,11 +233,6 @@ require('lazy').setup({
236233 --
237234 -- Use `opts = {}` to force a plugin to be loaded.
238235 --
239- -- This is equivalent to:
240- -- require('Comment').setup({})
241-
242- -- "gc" to comment visual regions/lines
243- { ' numToStr/Comment.nvim' , opts = {} },
244236 -- Here is a more advanced example where we pass configuration
245237 -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
246238 -- require('gitsigns').setup({ ... })
@@ -417,9 +409,9 @@ require('lazy').setup({
417409 -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
418410 { ' j-hui/fidget.nvim' , opts = {} },
419411
420- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
412+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
421413 -- used for completion, annotations and signatures of Neovim apis
422- { ' folke/neodev .nvim' , opts = {} },
414+ { ' folke/lazydev .nvim' , ft = ' lua ' , opts = {} },
423415 },
424416 config = function ()
425417 -- Brief aside: **What is LSP?**
@@ -496,10 +488,6 @@ require('lazy').setup({
496488 -- or a suggestion from your LSP for this to activate.
497489 map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
498490
499- -- Opens a popup that displays documentation about the word under your cursor
500- -- See `:help K` for why this keymap.
501- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
502-
503491 -- WARN: This is not Goto Definition, this is Goto Declaration.
504492 -- For example, in C this would take you to the header.
505493 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -510,7 +498,7 @@ require('lazy').setup({
510498 --
511499 -- When you move your cursor, the highlights will be cleared (the second autocommand).
512500 local client = vim .lsp .get_client_by_id (event .data .client_id )
513- if client and client .server_capabilities . documentHighlightProvider then
501+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
514502 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
515503 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
516504 buffer = event .buf ,
@@ -537,9 +525,9 @@ require('lazy').setup({
537525 -- code, if the language server you are using supports them
538526 --
539527 -- This may be unwanted, since they displace some of your code
540- if client and client .server_capabilities . inlayHintProvider and vim .lsp .inlay_hint then
528+ if client and client .supports_method ( vim .lsp .protocol . Methods . textDocument_inlayHint ) then
541529 map (' <leader>th' , function ()
542- vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled () )
530+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event . buf } )
543531 end , ' [T]oggle Inlay [H]ints' )
544532 end
545533 end ,
@@ -763,6 +751,11 @@ require('lazy').setup({
763751 -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
764752 },
765753 sources = {
754+ {
755+ name = ' lazydev' ,
756+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
757+ group_index = 0 ,
758+ },
766759 { name = ' nvim_lsp' },
767760 { name = ' luasnip' },
768761 { name = ' path' },
0 commit comments