mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-28 18:43:50 -03:00
chore: move plugins to an upper level
This commit is contained in:
parent
9569774c7b
commit
99bcb4ca97
50 changed files with 69 additions and 69 deletions
69
lua/plugins/oil.lua
Normal file
69
lua/plugins/oil.lua
Normal file
|
@ -0,0 +1,69 @@
|
|||
local M = {
|
||||
"stevearc/oil.nvim",
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
local function max_height()
|
||||
local height = vim.fn.winheight(0)
|
||||
if height >= 40 then
|
||||
return 30
|
||||
elseif height >= 30 then
|
||||
return 20
|
||||
else
|
||||
return 10
|
||||
end
|
||||
end
|
||||
|
||||
require("oil").setup({
|
||||
keymaps = {
|
||||
["<C-p>"] = false,
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-s>"] = "actions.select_vsplit",
|
||||
["<C-h>"] = "actions.select_split",
|
||||
["<C-t>"] = "actions.select_tab",
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
-- Set to false if you still want to use netrw.
|
||||
default_file_explorer = true,
|
||||
delete_to_trash = true,
|
||||
|
||||
-- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
|
||||
skip_confirm_for_simple_edits = true,
|
||||
|
||||
view_options = {
|
||||
natural_order = true,
|
||||
-- Show files and directories that start with "."
|
||||
show_hidden = false,
|
||||
-- This function defines what is considered a "hidden" file
|
||||
is_hidden_file = function(name)
|
||||
local ignore_folders = { "node_modules", "dist", "build", "coverage" }
|
||||
return vim.startswith(name, ".") or vim.tbl_contains(ignore_folders, name)
|
||||
end,
|
||||
wrap = true,
|
||||
},
|
||||
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
padding = 2,
|
||||
max_width = 120,
|
||||
max_height = max_height(),
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "-", function()
|
||||
require("oil").open()
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue