/.lua
Created
April 22, 2025 10:34
Oil.nvim dynamically remap h and l keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Creamos un grupo de autocomandos para organizar mejor | |
-- Aplicar mapeos cuando se abre un buffer de oil | |
vim.api.nvim_create_autocmd("FileType", { | |
pattern = "oil", | |
callback = function() | |
local bufnr = vim.api.nvim_get_current_buf() | |
-- Establecer h para ir al directorio padre | |
vim.keymap.set("n", "h", function() | |
require("oil.actions").parent.callback() | |
end, { buffer = bufnr, nowait = true, desc = "Oil: Ir al directorio padre" }) | |
-- Establecer l para seleccionar | |
vim.keymap.set("n", "l", function() | |
require("oil.actions").select.callback() | |
end, { buffer = bufnr, nowait = true, desc = "Oil: Seleccionar" }) | |
end, | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This work with toggle
gt
from this question :