feat: Review configuration of key mappings

This commit is contained in:
2025-11-01 19:50:01 +01:00
parent 58e86b8435
commit 6787aef5cd
2 changed files with 16 additions and 16 deletions

View File

@@ -93,15 +93,27 @@ return {
-- Mappings can be configured through AstroCore as well. -- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized -- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = { mappings = {
-- first key is the mode
n = { n = {
-- second key is the lefthand side of the map
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
-- Visual selection of pasted text
["gp"] = { "`[v`]", desc = "Visual selection of pasted text" },
-- navigate buffer tabs -- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, ["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
-- mappings seen under group name "Buffer" -- mappings seen under group name "Buffer"
["<Leader>b"] = { desc = "Buffers" },
["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>bd"] = { ["<Leader>bd"] = {
function() function()
require("astroui.status.heirline").buffer_picker( require("astroui.status.heirline").buffer_picker(
@@ -113,13 +125,6 @@ return {
["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, ["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
-- Normal mode : Custom mappings -- Normal mode : Custom mappings
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard ["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
["<F3>"] = { ["<F3>"] = {
@@ -155,7 +160,7 @@ return {
-- Clear Ctrl+l so that we can use it to clear the terminal -- Clear Ctrl+l so that we can use it to clear the terminal
["<C-l>"] = false, ["<C-l>"] = false,
["<C-h>"] = false, ["<C-h>"] = false,
-- Clear Ctrl-J and Ctrl-K so that we can use them to navigate the terminal (for lazygit) -- Clear Ctrl-J and Ctrl-K so that we can use them for apps running in the terminal (for example lazygit)
["<C-j>"] = false, ["<C-j>"] = false,
["<C-k>"] = false, ["<C-k>"] = false,
-- My terms -- My terms

View File

@@ -2,14 +2,9 @@
-- This is just pure lua so anything that doesn't -- This is just pure lua so anything that doesn't
-- fit in the normal config locations above can go here -- fit in the normal config locations above can go here
-- Custom keymaps
-- use gp to set visual selection on the recently pasted text
vim.keymap.set('n', 'gp', '`[v`]', { desc = 'Visual selection of pasted text' })
-- Needed for python3 through mise -- Needed for python3 through mise
-- Locate python3 using PATH -- Locate python3 using PATH
local python_path = vim.fn.exepath("python3") local python_path = vim.fn.exepath "python3"
if python_path == nil or python_path == "" then if python_path == nil or python_path == "" then
else else
vim.g.python3_host_prog = python_path vim.g.python3_host_prog = python_path