-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
return { | ||
{ | ||
"stevearc/oil.nvim", | ||
dependencies = { "nvim-tree/nvim-web-devicons" }, | ||
config = function() | ||
CustomOilBar = function() | ||
local path = vim.fn.expand "%" | ||
path = path:gsub("oil://", "") | ||
|
||
return " " .. vim.fn.fnamemodify(path, ":.") | ||
end | ||
|
||
require("oil").setup { | ||
columns = { "icon" }, | ||
keymaps = { | ||
["<C-h>"] = false, | ||
["<C-l>"] = false, | ||
["<C-k>"] = false, | ||
["<C-j>"] = false, | ||
["<M-h>"] = "actions.select_split", | ||
}, | ||
win_options = { | ||
winbar = "%{v:lua.CustomOilBar()}", | ||
}, | ||
view_options = { | ||
show_hidden = true, | ||
is_always_hidden = function(name, _) | ||
local folder_skip = { "dev-tools.locks", "dune.lock", "_build" } | ||
return vim.tbl_contains(folder_skip, name) | ||
end, | ||
}, | ||
} | ||
|
||
-- Open parent directory in current window | ||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" }) | ||
|
||
-- Open parent directory in floating window | ||
vim.keymap.set("n", "<space>-", require("oil").toggle_float) | ||
end, | ||
}, | ||
} |