@@ -162,9 +162,6 @@ vim.opt.hlsearch = true
162162vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
163163
164164-- 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' })
168165vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
169166
170167-- 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', {
207204-- [[ Install `lazy.nvim` plugin manager ]]
208205-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
209206local 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
211208 local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
212209 local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
213210 if vim .v .shell_error ~= 0 then
@@ -237,11 +234,6 @@ require('lazy').setup({
237234 --
238235 -- Use `opts = {}` to force a plugin to be loaded.
239236 --
240- -- This is equivalent to:
241- -- require('Comment').setup({})
242-
243- -- "gc" to comment visual regions/lines
244- { ' numToStr/Comment.nvim' , opts = {} },
245237
246238 -- Here is a more advanced example where we pass configuration
247239 -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -419,9 +411,9 @@ require('lazy').setup({
419411 -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
420412 { ' j-hui/fidget.nvim' , opts = {} },
421413
422- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
414+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
423415 -- used for completion, annotations and signatures of Neovim apis
424- { ' folke/neodev .nvim' , opts = {} },
416+ { ' folke/lazydev .nvim' , ft = ' lua ' , opts = {} },
425417 },
426418 config = function ()
427419 -- Brief aside: **What is LSP?**
@@ -498,10 +490,6 @@ require('lazy').setup({
498490 -- or a suggestion from your LSP for this to activate.
499491 map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
500492
501- -- Opens a popup that displays documentation about the word under your cursor
502- -- See `:help K` for why this keymap.
503- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
504-
505493 -- WARN: This is not Goto Definition, this is Goto Declaration.
506494 -- For example, in C this would take you to the header.
507495 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -512,7 +500,7 @@ require('lazy').setup({
512500 --
513501 -- When you move your cursor, the highlights will be cleared (the second autocommand).
514502 local client = vim .lsp .get_client_by_id (event .data .client_id )
515- if client and client .server_capabilities . documentHighlightProvider then
503+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
516504 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
517505 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
518506 buffer = event .buf ,
@@ -539,9 +527,9 @@ require('lazy').setup({
539527 -- code, if the language server you are using supports them
540528 --
541529 -- This may be unwanted, since they displace some of your code
542- if client and client .server_capabilities . inlayHintProvider and vim .lsp .inlay_hint then
530+ if client and client .supports_method ( vim .lsp .protocol . Methods . textDocument_inlayHint ) then
543531 map (' <leader>th' , function ()
544- vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled () )
532+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event . buf } )
545533 end , ' [T]oggle Inlay [H]ints' )
546534 end
547535 end ,
@@ -765,6 +753,11 @@ require('lazy').setup({
765753 -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
766754 },
767755 sources = {
756+ {
757+ name = ' lazydev' ,
758+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
759+ group_index = 0 ,
760+ },
768761 { name = ' nvim_lsp' },
769762 { name = ' luasnip' },
770763 { name = ' path' },
0 commit comments