-
-
Save pierodev0/d2973a5c7aaa73b8e4d117602d34282f to your computer and use it in GitHub Desktop.
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 :