@@ -163,9 +163,6 @@ vim.opt.hlsearch = true
163163vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
164164
165165-- Diagnostic keymaps
166- vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous [D]iagnostic message' })
167- vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next [D]iagnostic message' })
168- vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Show diagnostic [E]rror messages' })
169166vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
170167
171168-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -208,7 +205,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
208205-- [[ Install `lazy.nvim` plugin manager ]]
209206-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
210207local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
211- if not vim .loop .fs_stat (lazypath ) then
208+ if not vim .uv .fs_stat (lazypath ) then
212209 local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
213210 local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
214211 if vim .v .shell_error ~= 0 then
@@ -241,11 +238,6 @@ require('lazy').setup({
241238 --
242239 -- Use `opts = {}` to force a plugin to be loaded.
243240 --
244- -- This is equivalent to:
245- -- require('Comment').setup({})
246-
247- -- "gc" to comment visual regions/lines
248- { ' numToStr/Comment.nvim' , opts = {} },
249241
250242 -- Here is a more advanced example where we pass configuration
251243 -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -423,9 +415,9 @@ require('lazy').setup({
423415 -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
424416 { ' j-hui/fidget.nvim' , opts = {} },
425417
426- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
418+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
427419 -- used for completion, annotations and signatures of Neovim apis
428- { ' folke/neodev .nvim' , opts = {} },
420+ { ' folke/lazydev .nvim' , ft = ' lua ' , opts = {} },
429421 },
430422 config = function ()
431423 -- Brief aside: **What is LSP?**
@@ -502,10 +494,6 @@ require('lazy').setup({
502494 -- or a suggestion from your LSP for this to activate.
503495 map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
504496
505- -- Opens a popup that displays documentation about the word under your cursor
506- -- See `:help K` for why this keymap.
507- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
508-
509497 -- WARN: This is not Goto Definition, this is Goto Declaration.
510498 -- For example, in C this would take you to the header.
511499 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -516,7 +504,7 @@ require('lazy').setup({
516504 --
517505 -- When you move your cursor, the highlights will be cleared (the second autocommand).
518506 local client = vim .lsp .get_client_by_id (event .data .client_id )
519- if client and client .server_capabilities . documentHighlightProvider then
507+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
520508 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
521509 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
522510 buffer = event .buf ,
@@ -543,9 +531,9 @@ require('lazy').setup({
543531 -- code, if the language server you are using supports them
544532 --
545533 -- This may be unwanted, since they displace some of your code
546- if client and client .server_capabilities . inlayHintProvider and vim .lsp .inlay_hint then
534+ if client and client .supports_method ( vim .lsp .protocol . Methods . textDocument_inlayHint ) then
547535 map (' <leader>th' , function ()
548- vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled () )
536+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event . buf } )
549537 end , ' [T]oggle Inlay [H]ints' )
550538 end
551539 end ,
@@ -769,6 +757,11 @@ require('lazy').setup({
769757 -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
770758 },
771759 sources = {
760+ {
761+ name = ' lazydev' ,
762+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
763+ group_index = 0 ,
764+ },
772765 { name = ' nvim_lsp' },
773766 { name = ' luasnip' },
774767 { name = ' path' },
0 commit comments