feat: fennelize oil
This commit is contained in:
parent
c34683821c
commit
257cc6bb90
2 changed files with 40 additions and 50 deletions
32
fnl/plugins/oil.fnl
Normal file
32
fnl/plugins/oil.fnl
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{1 :oil.nvim
|
||||||
|
:after (fn []
|
||||||
|
((. (require :oil) :setup) {:columns [:size :icon]
|
||||||
|
:default_file_explorer false
|
||||||
|
:keymaps {:<C-h> :actions.select_split
|
||||||
|
:<C-l> :actions.refresh
|
||||||
|
:<C-p> :actions.preview
|
||||||
|
:<C-s> :actions.select_vsplit
|
||||||
|
:<C-t> :actions.select_tab
|
||||||
|
:<CR> :actions.select
|
||||||
|
:J :actions.parent
|
||||||
|
:K :actions.select
|
||||||
|
:Q :actions.close
|
||||||
|
:_ :actions.open_cwd
|
||||||
|
"`" :actions.cd
|
||||||
|
:g. :actions.toggle_hidden
|
||||||
|
:g? :actions.show_help
|
||||||
|
"g\\" :actions.toggle_trash
|
||||||
|
:gs :actions.change_sort
|
||||||
|
:gx :actions.open_external
|
||||||
|
"~" :actions.tcd}
|
||||||
|
:use_default_keymaps false}))
|
||||||
|
:cmd :Oil
|
||||||
|
:keys [{1 :<leader>bf
|
||||||
|
2 (fn []
|
||||||
|
(vim.cmd (.. "Oil " (vim.fn.getcwd))))
|
||||||
|
:desc "Open oil in current working directory"
|
||||||
|
:mode :n}
|
||||||
|
{1 :<leader>be
|
||||||
|
2 vim.cmd.Oil
|
||||||
|
:desc "Open oil in current file directory"
|
||||||
|
:mode :n}]}
|
58
lua/plugins/oil.lua
generated
58
lua/plugins/oil.lua
generated
|
@ -1,50 +1,8 @@
|
||||||
-- we still use oil.nvim for more complex filesystem manipulations
|
-- [nfnl] Compiled from ./fnl/plugins/oil.fnl by https://github.com/Olical/nfnl, do not edit.
|
||||||
return {
|
local function _1_()
|
||||||
"oil.nvim",
|
return require("oil").setup({columns = {"size", "icon"}, keymaps = {["<C-h>"] = "actions.select_split", ["<C-l>"] = "actions.refresh", ["<C-p>"] = "actions.preview", ["<C-s>"] = "actions.select_vsplit", ["<C-t>"] = "actions.select_tab", ["<CR>"] = "actions.select", J = "actions.parent", K = "actions.select", Q = "actions.close", _ = "actions.open_cwd", ["`"] = "actions.cd", ["g."] = "actions.toggle_hidden", ["g?"] = "actions.show_help", ["g\\"] = "actions.toggle_trash", gs = "actions.change_sort", gx = "actions.open_external", ["~"] = "actions.tcd"}, default_file_explorer = false, use_default_keymaps = false})
|
||||||
cmd = "Oil",
|
end
|
||||||
keys = {
|
local function _2_()
|
||||||
{
|
return vim.cmd(("Oil " .. vim.fn.getcwd()))
|
||||||
"<leader>bf",
|
end
|
||||||
function()
|
return {"oil.nvim", after = _1_, cmd = "Oil", keys = {{"<leader>bf", _2_, desc = "Open oil in current working directory", mode = "n"}, {"<leader>be", vim.cmd.Oil, desc = "Open oil in current file directory", mode = "n"}}}
|
||||||
vim.cmd("Oil " .. vim.fn.getcwd())
|
|
||||||
end,
|
|
||||||
mode = "n",
|
|
||||||
desc = "Open oil in current working directory",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>be",
|
|
||||||
vim.cmd.Oil,
|
|
||||||
mode = "n",
|
|
||||||
desc = "Open oil in current file directory",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
after = function()
|
|
||||||
require("oil").setup({
|
|
||||||
columns = {
|
|
||||||
"size",
|
|
||||||
"icon",
|
|
||||||
},
|
|
||||||
default_file_explorer = false,
|
|
||||||
use_default_keymaps = false,
|
|
||||||
keymaps = {
|
|
||||||
["J"] = "actions.parent",
|
|
||||||
["Q"] = "actions.close",
|
|
||||||
["<C-h>"] = "actions.select_split",
|
|
||||||
["<C-l>"] = "actions.refresh",
|
|
||||||
["<C-p>"] = "actions.preview",
|
|
||||||
["<C-s>"] = "actions.select_vsplit",
|
|
||||||
["<C-t>"] = "actions.select_tab",
|
|
||||||
["<CR>"] = "actions.select",
|
|
||||||
["K"] = "actions.select",
|
|
||||||
["_"] = "actions.open_cwd",
|
|
||||||
["`"] = "actions.cd",
|
|
||||||
["g."] = "actions.toggle_hidden",
|
|
||||||
["g?"] = "actions.show_help",
|
|
||||||
["g\\"] = "actions.toggle_trash",
|
|
||||||
["gs"] = "actions.change_sort",
|
|
||||||
["gx"] = "actions.open_external",
|
|
||||||
["~"] = "actions.tcd",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue