summaryrefslogtreecommitdiff
path: root/mut
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2023-12-08 08:16:39 +0100
committerMike Vink <ivi@vinkies.net>2023-12-09 07:22:14 +0100
commit2cd43f8fbd7e404354be740866744d0c9c9fcc98 (patch)
tree380c11c3a8b836949d2e45bb1d222e0f18f9b737 /mut
parent3ef1d76ddeb9249bfa7bb87f27f529f931fcb99c (diff)
try oil
Diffstat (limited to 'mut')
-rw-r--r--mut/neovim/fnl/conf/init.fnl1
-rw-r--r--mut/neovim/fnl/conf/pkgs.fnl1
-rw-r--r--mut/neovim/fnl/conf/pkgs/oil.fnl45
3 files changed, 47 insertions, 0 deletions
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl
index 0279375..4ec8b76 100644
--- a/mut/neovim/fnl/conf/init.fnl
+++ b/mut/neovim/fnl/conf/init.fnl
@@ -29,6 +29,7 @@
(local cope #(vim.cmd (.. ":copen " (math.floor (/ vim.o.lines 2.1)))))
(let [map vim.keymap.set]
+ (map :n :- ::Oil<cr>)
(map :v :y "<Plug>OSCYankVisual|gvy")
(map :n :<leader>qf cope)
(map :n :<leader>q<BS> ":cclose<cr>")
diff --git a/mut/neovim/fnl/conf/pkgs.fnl b/mut/neovim/fnl/conf/pkgs.fnl
index 7c5f503..37ebc52 100644
--- a/mut/neovim/fnl/conf/pkgs.fnl
+++ b/mut/neovim/fnl/conf/pkgs.fnl
@@ -4,5 +4,6 @@
(require :conf.pkgs.dap)
(require :conf.pkgs.venn)
(require :conf.pkgs.gitsigns)
+(require :conf.pkgs.oil)
;; (require :conf.pkgs.lsp_lines)
;; (require :conf.pkgs.null-ls)
diff --git a/mut/neovim/fnl/conf/pkgs/oil.fnl b/mut/neovim/fnl/conf/pkgs/oil.fnl
new file mode 100644
index 0000000..2365872
--- /dev/null
+++ b/mut/neovim/fnl/conf/pkgs/oil.fnl
@@ -0,0 +1,45 @@
+(local oil (require :oil))
+
+(oil.setup
+ {
+ :default_file_explorer true
+ :skip_confirm_for_simple_edits true
+
+ :columns [:size :permissions]
+ :view_options
+ {
+ :show_hidden false
+ :is_hidden_file (fn [name bufnr]
+ (vim.startswith name "."))
+ :is_always_hidden (fn [name bufnr] false)
+ :sort [["type" "asc"] ["name" "asc"]]}
+
+
+ :keymaps
+ {
+ "g?" "actions.show_help"
+ "<CR>" "actions.select"
+ "<C-s>" "actions.select_vsplit"
+ "<C-h>" "actions.select_split"
+ "<C-t>" "actions.select_tab"
+ "<C-p>" "actions.preview"
+ "<C-c>" "actions.close"
+ "<C-l>" "actions.refresh"
+ "." "actions.open_cmdline"
+ "gx" {:callback (fn []
+ (local file (oil.get_cursor_entry))
+ (vim.cmd (.. :argadd " " file.name))
+ (vim.cmd :args))}
+ "gX" {:callback (fn []
+ (local file (oil.get_cursor_entry))
+ (vim.cmd (.. :argdel " " file.name))
+ (vim.cmd :args))}
+ "gc" {:callback (fn []
+ (vim.cmd "argdel *")
+ (vim.cmd "args"))}
+ "-" "actions.parent"
+ "_" "actions.open_cwd"
+ "cd" "actions.cd"
+ "~" "actions.tcd"
+ "gs" "actions.change_sort"
+ "g." "actions.toggle_hidden"}})