1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
local oil=require("oil")
local fzf=require("fzf-lua")
local map = vim.keymap.set
local unmap = vim.keymap.del
oil.setup({
default_file_explorer = true,
skip_confirm_for_simple_edits = true,
columns = {"size","permissions"},
view_options = {
show_hidden = false,
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
is_always_hidden = function(name, bufnr) return false end,
sort = { {"type" ,"asc"}, {"name","asc"} }
},
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = function()
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(
":Sh<up><c-f>",
true, false, true
),
"n", false
)
vim.schedule(function()
vim.cmd("let v:searchforward = 0")
map("n","/","/Sh.*",{buffer=true})
map("n","?","?Sh.*",{buffer=true})
end)
end,
[ "<C-h>" ] = "actions.select_split",
[ "<C-t>" ] = "actions.select_tab",
[ "<C-p>" ] = fzf.files,
[ "<C-c>" ] = "actions.close",
[ "<C-l>" ] = "actions.refresh",
[ "." ] = "actions.open_cmdline",
[ "gx" ] = {
callback = function()
local file, dir = oil.get_cursor_entry(), oil.get_current_dir()
if dir and file then
vim.cmd("argadd " .. dir .. file.name)
vim.cmd "args"
end
end
},
[ "gX" ] = {
callback = function()
local file, dir = oil.get_cursor_entry(), oil.get_current_dir()
if dir and file then
vim.cmd("argdel " .. dir .. file.name)
vim.cmd "args"
end
end
},
[ "gc" ] = {
callback = function()
vim.cmd("argdel *")
vim.cmd("args")
end
},
[ "-" ] = "actions.parent",
[ "_" ] = "actions.open_cwd",
[ "cd" ] = "actions.cd",
[ "~" ] = "actions.tcd",
[ "gs" ] = "actions.change_sort",
[ "g." ] = "actions.toggle_hidden"
}
})
|