Skip to content

Commit

Permalink
fix(mappings): move diagnostic mappings to always loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Apr 1, 2024
1 parent 6d4fcf8 commit e575551
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
8 changes: 7 additions & 1 deletion lua/astronvim/plugins/_astrocore_mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ return {
opts._map_section = {
f = { desc = get_icon("Search", 1, true) .. "Find" },
p = { desc = get_icon("Package", 1, true) .. "Packages" },
l = { desc = get_icon("ActiveLSP", 1, true) .. "LSP" },
l = { desc = get_icon("ActiveLSP", 1, true) .. "Language Tools" },
u = { desc = get_icon("Window", 1, true) .. "UI/UX" },
b = { desc = get_icon("Tab", 1, true) .. "Buffers" },
bs = { desc = get_icon("Sort", 1, true) .. "Sort Buffers" },
Expand Down Expand Up @@ -84,6 +84,12 @@ return {
maps.n["<Leader>bsi"] = { function() require("astrocore.buffer").sort "bufnr" end, desc = "By buffer number" }
maps.n["<Leader>bsm"] = { function() require("astrocore.buffer").sort "modified" end, desc = "By modification" }

maps.n["<Leader>l"] = sections.l
maps.n["<Leader>ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }
maps.n["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" }
maps.n["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" }
maps.n["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }

-- Navigate tabs
maps.n["]t"] = { function() vim.cmd.tabnext() end, desc = "Next tab" }
maps.n["[t"] = { function() vim.cmd.tabprevious() end, desc = "Previous tab" }
Expand Down
7 changes: 1 addition & 6 deletions lua/astronvim/plugins/_astrolsp_mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ return {
---@param opts AstroLSPOpts
opts = function(_, opts)
local maps = require("astrocore").empty_map_table()
maps.v["<Leader>l"] = { desc = " LSP" }

maps.n["<Leader>ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }
maps.n["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" }
maps.n["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" }
maps.n["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }
maps.v["<Leader>l"] = { desc = require("astroui").get_icon("ActiveLSP", 1, true) .. "Language Tools" }

maps.n["<Leader>la"] = {
function() vim.lsp.buf.code_action() end,
Expand Down
1 change: 0 additions & 1 deletion lua/astronvim/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ return {
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
maps.n["<Leader>l"] = opts._map_section.l
maps.n["<Leader>lS"] = { function() require("aerial").toggle() end, desc = "Symbols outline" }
end,
},
Expand Down
1 change: 0 additions & 1 deletion lua/astronvim/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ return {
end,
desc = "Find words in all files",
}
maps.n["<Leader>l"] = opts._map_section.l
maps.n["<Leader>ls"] = {
function()
if is_available "aerial.nvim" then
Expand Down

0 comments on commit e575551

Please sign in to comment.