aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorpml68 <tutorialmester@gmail.com>2024-03-19 20:48:40 +0100
committerpml68 <tutorialmester@gmail.com>2024-03-19 20:48:40 +0100
commit31b34f3520cba81853261a1094d2a0f927c599ab (patch)
tree317e02d998a28f62229f57e7908106565a8d11cc /lua
parentfeat: add keymaps for moving in and out of terminal (diff)
downloadnvim-31b34f3520cba81853261a1094d2a0f927c599ab.tar.gz
feat: remap a to % and r to R in Netrw
Diffstat (limited to '')
-rw-r--r--lua/pml68/remap.lua15
1 files changed, 15 insertions, 0 deletions
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', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', 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
+})