@@ -37,13 +37,14 @@ I hope you enjoy your Neovim journey,
3737
3838P.S. You can delete this when you're done too. It's your config now :)
3939--]]
40+
4041-- Set <space> as the leader key
4142-- See `:help mapleader`
4243-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
4344vim .g .mapleader = ' '
4445vim .g .maplocalleader = ' '
4546
46- -- Install package manager
47+ -- [[ Install `lazy.nvim` plugin manager ]]
4748-- https://github.com/folke/lazy.nvim
4849-- `:help lazy.nvim.txt` for more info
4950local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
@@ -59,6 +60,7 @@ if not vim.loop.fs_stat(lazypath) then
5960end
6061vim .opt .rtp :prepend (lazypath )
6162
63+ -- [[ Configure plugins ]]
6264-- NOTE: Here is where you install your plugins.
6365-- You can configure plugins using the `config` key.
6466--
@@ -281,6 +283,12 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
281283vim .keymap .set (' n' , ' k' , " v:count == 0 ? 'gk' : 'k'" , { expr = true , silent = true })
282284vim .keymap .set (' n' , ' j' , " v:count == 0 ? 'gj' : 'j'" , { expr = true , silent = true })
283285
286+ -- Diagnostic keymaps
287+ vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous diagnostic message' })
288+ vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next diagnostic message' })
289+ vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Open floating diagnostic message' })
290+ vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostics list' })
291+
284292-- [[ Highlight on yank ]]
285293-- See `:help vim.highlight.on_yank()`
286294local highlight_group = vim .api .nvim_create_augroup (' YankHighlight' , { clear = true })
@@ -433,12 +441,6 @@ vim.defer_fn(function()
433441 }
434442end , 0 )
435443
436- -- Diagnostic keymaps
437- vim .keymap .set (' n' , ' [d' , vim .diagnostic .goto_prev , { desc = ' Go to previous diagnostic message' })
438- vim .keymap .set (' n' , ' ]d' , vim .diagnostic .goto_next , { desc = ' Go to next diagnostic message' })
439- vim .keymap .set (' n' , ' <leader>e' , vim .diagnostic .open_float , { desc = ' Open floating diagnostic message' })
440- vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostics list' })
441-
442444-- [[ Configure LSP ]]
443445-- This function gets run when an LSP connects to a particular buffer.
444446local on_attach = function (_ , bufnr )
0 commit comments