Skip to content

Commit a005f15

Browse files
authored
Merge pull request nvim-lua#495 from dam9000/pr-minor-cleanup
Minor cleanups
2 parents 47974f7 + c8dd8e7 commit a005f15

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

init.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ I hope you enjoy your Neovim journey,
3737
3838
P.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)
4344
vim.g.mapleader = ' '
4445
vim.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
4950
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
@@ -59,6 +60,7 @@ if not vim.loop.fs_stat(lazypath) then
5960
end
6061
vim.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 })
281283
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
282284
vim.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()`
286294
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
@@ -433,12 +441,6 @@ vim.defer_fn(function()
433441
}
434442
end, 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.
444446
local on_attach = function(_, bufnr)

0 commit comments

Comments
 (0)