Skip to content

Commit c65b956

Browse files
committed
Add keymap to save file and trigger oil in one go
1 parent 5444fae commit c65b956

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lua/custom/plugins/oil.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@ return {
66
dependencies = { { 'nvim-mini/mini.icons', opts = {} } },
77
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
88
lazy = false,
9+
config = function(_, opts)
10+
require('oil').setup(opts)
11+
-- add keymap to save file and trigger oil afterwards
12+
vim.keymap.set('n', '<A-o>', function()
13+
vim.cmd 'w'
14+
vim.cmd 'Oil'
15+
end, {})
16+
end,
917
}

0 commit comments

Comments
 (0)