Skip to content

Commit 2706318

Browse files
nvim(oil): update keymap and show hidden
1 parent d48090d commit 2706318

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

modules/nvim/lua/minizilla/misc.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,21 @@ nmap('<Leader>5', function() ui.nav_file(5) end)
2727
nmap('<Leader>6', function() ui.nav_file(6) end)
2828

2929
require('oil').setup {
30+
use_default_keymaps = false,
3031
keymaps = {
31-
['<BS>'] = 'actions.parent',
32-
}
32+
['g?'] = { 'actions.show_help', mode = 'n', desc = 'Show default keymaps' },
33+
['g.'] = { 'actions.toggle_hidden', mode = 'n', desc = 'Toggle hidden files and directories' },
34+
['gp'] = { 'actions.preview', mode = 'n', desc = 'Open the entry under the cursor in a preview window, or close the preview window if already open' },
35+
['<C-l>'] = { 'actions.refresh', mode = 'n', desc = 'Refresh current directory list' },
36+
['<BS>'] = { 'actions.parent', mode = 'n', desc = 'Navigate to the parent path' },
37+
['<CR>'] = { 'actions.select', mode = 'n', desc = 'Open the entry under the cursor' },
38+
},
39+
view_options = {
40+
show_hidden = true,
41+
is_always_hidden = function(name)
42+
return name == ".."
43+
end,
44+
},
3345
}
3446
nmap('<BS>', '<Cmd>Oil<CR>')
3547

0 commit comments

Comments
 (0)