@@ -172,9 +172,6 @@ vim.opt.hlsearch = true
172172vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
173173
174174-- Diagnostic keymaps
175- vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous [D]iagnostic message' })
176- vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next [D]iagnostic message' })
177- vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Show diagnostic [E]rror messages' })
178175vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
179176
180177-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -217,7 +214,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
217214-- [[ Install `lazy.nvim` plugin manager ]]
218215-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
219216local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
220- if not vim .loop .fs_stat (lazypath ) then
217+ if not vim .uv .fs_stat (lazypath ) then
221218 local lazyrepo = ' https://github.com/folke/lazy.nvim.git'
222219 local out = vim .fn .system { ' git' , ' clone' , ' --filter=blob:none' , ' --branch=stable' , lazyrepo , lazypath }
223220 if vim .v .shell_error ~= 0 then
@@ -247,11 +244,6 @@ require('lazy').setup({
247244 --
248245 -- Use `opts = {}` to force a plugin to be loaded.
249246 --
250- -- This is equivalent to:
251- -- require('Comment').setup({})
252-
253- -- "gc" to comment visual regions/lines
254- { ' numToStr/Comment.nvim' , opts = {} },
255247
256248 -- Here is a more advanced example where we pass configuration
257249 -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
@@ -434,9 +426,19 @@ require('lazy').setup({
434426 -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
435427 { ' j-hui/fidget.nvim' , opts = {} },
436428
437- -- `neodev ` configures Lua LSP for your Neovim config, runtime and plugins
429+ -- `lazydev ` configures Lua LSP for your Neovim config, runtime and plugins
438430 -- used for completion, annotations and signatures of Neovim apis
439- { ' folke/neodev.nvim' , opts = {} },
431+ {
432+ ' folke/lazydev.nvim' ,
433+ ft = ' lua' ,
434+ opts = {
435+ library = {
436+ -- Load luvit types when the `vim.uv` word is found
437+ { path = ' luvit-meta/library' , words = { ' vim%.uv' } },
438+ },
439+ },
440+ },
441+ { ' Bilal2453/luvit-meta' , lazy = true },
440442 },
441443 config = function ()
442444 -- Brief aside: **What is LSP?**
@@ -513,10 +515,6 @@ require('lazy').setup({
513515 -- or a suggestion from your LSP for this to activate.
514516 map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
515517
516- -- Opens a popup that displays documentation about the word under your cursor
517- -- See `:help K` for why this keymap.
518- map (' K' , vim .lsp .buf .hover , ' Hover Documentation' )
519-
520518 -- WARN: This is not Goto Definition, this is Goto Declaration.
521519 -- For example, in C this would take you to the header.
522520 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
@@ -527,7 +525,7 @@ require('lazy').setup({
527525 --
528526 -- When you move your cursor, the highlights will be cleared (the second autocommand).
529527 local client = vim .lsp .get_client_by_id (event .data .client_id )
530- if client and client .server_capabilities . documentHighlightProvider then
528+ if client and client .supports_method ( vim . lsp . protocol . Methods . textDocument_documentHighlight ) then
531529 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
532530 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
533531 buffer = event .buf ,
@@ -550,13 +548,13 @@ require('lazy').setup({
550548 })
551549 end
552550
553- -- The following autocommand is used to enable inlay hints in your
551+ -- The following code creates a keymap to toggle inlay hints in your
554552 -- code, if the language server you are using supports them
555553 --
556554 -- This may be unwanted, since they displace some of your code
557- if client and client .server_capabilities . inlayHintProvider and vim .lsp .inlay_hint then
555+ if client and client .supports_method ( vim .lsp .protocol . Methods . textDocument_inlayHint ) then
558556 map (' <leader>th' , function ()
559- vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled () )
557+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event . buf } )
560558 end , ' [T]oggle Inlay [H]ints' )
561559 end
562560 end ,
@@ -654,7 +652,8 @@ require('lazy').setup({
654652
655653 { -- Autoformat
656654 ' stevearc/conform.nvim' ,
657- lazy = false ,
655+ event = { ' BufWritePre' },
656+ cmd = { ' ConformInfo' },
658657 keys = {
659658 {
660659 ' <leader>f' ,
@@ -814,6 +813,11 @@ require('lazy').setup({
814813 -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
815814 },
816815 sources = {
816+ {
817+ name = ' lazydev' ,
818+ -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
819+ group_index = 0 ,
820+ },
817821 { name = ' nvim_lsp' },
818822 { name = ' luasnip' },
819823 { name = ' path' },
@@ -850,7 +854,7 @@ require('lazy').setup({
850854 --
851855 -- Examples:
852856 -- - va) - [V]isually select [A]round [)]paren
853- -- - yinq - [Y]ank [I]nside [N]ext [']quote
857+ -- - yinq - [Y]ank [I]nside [N]ext [Q]uote
854858 -- - ci' - [C]hange [I]nside [']quote
855859 require (' mini.ai' ).setup { n_lines = 500 }
856860
0 commit comments