From 31b34f3520cba81853261a1094d2a0f927c599ab Mon Sep 17 00:00:00 2001 From: pml68 Date: Tue, 19 Mar 2024 20:48:40 +0100 Subject: feat: remap a to % and r to R in Netrw --- lua/pml68/remap.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lua/pml68/remap.lua') diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua index 1456161..c1fe1c7 100644 --- a/lua/pml68/remap.lua +++ b/lua/pml68/remap.lua @@ -50,3 +50,18 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) end }) + +-- Netrw (u/vonheikemen) +vim.api.nvim_create_autocmd('filetype', { + pattern = 'netrw', + desc = 'Better mappings for netrw', + callback = function() + local bind = function(lhs, rhs) + vim.keymap.set('n', lhs, rhs, {remap = true, buffer = true}) + end + + bind('a', '%') + + bind('r', 'R') + end +}) -- cgit v1.2.3