Skip to content

Commit ebaf948

Browse files
committed
oil: Add file system editor and explorer
1 parent d48d2ea commit ebaf948

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ require('lazy').setup({
980980
-- require 'kickstart.plugins.lint',
981981
-- require 'kickstart.plugins.autopairs',
982982
-- require 'kickstart.plugins.neo-tree',
983+
require 'kickstart.plugins.oil',
983984
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
984985

985986
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`

lua/kickstart/plugins/oil.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
return {
2+
{ -- Oil filesystem editor and explorer
3+
'stevearc/oil.nvim',
4+
dependencies = { 'nvim-tree/nvim-web-devicons' },
5+
config = function()
6+
require('oil').setup {
7+
columns = { 'icon' },
8+
keymaps = {
9+
['<C-h>'] = false,
10+
['<M-h>'] = 'actions.select_split',
11+
},
12+
view_options = {
13+
show_hidden = true,
14+
},
15+
}
16+
17+
-- Open parent directory in current window
18+
vim.keymap.set('n', '-', '<CMD>Oil<CR>', { desc = 'Open parent directorv' })
19+
20+
-- Open parent directory in floating window
21+
vim.keymap.set('n', '<space>-', require('oil').toggle_float)
22+
end,
23+
},
24+
}
25+
26+
-- The line beneath this is called `modeline`. See `:help modeline`
27+
-- vim: ts=2 sts=2 sw=2 et

0 commit comments

Comments
 (0)