summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/oil.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/editor/oil.fnl')
-rw-r--r--fnl/plugins/editor/oil.fnl19
1 files changed, 14 insertions, 5 deletions
diff --git a/fnl/plugins/editor/oil.fnl b/fnl/plugins/editor/oil.fnl
index e326663..44ad7a4 100644
--- a/fnl/plugins/editor/oil.fnl
+++ b/fnl/plugins/editor/oil.fnl
@@ -1,5 +1,11 @@
;; File explorer that lets you edit your filesystem.
+(local user-cmds [[:Oil
+ (lambda []
+ (let [oil (require :oil)]
+ (oil.open)))
+ {:nargs 0}]])
+
(local keymaps {:g? :actions.show_help
:<CR> :actions.select
:<C-s> :actions.select_vsplit
@@ -17,11 +23,14 @@
:g. :actions.toggle_hidden
"g\\\\" :actions.toggle_trash})
+(local keys [{1 "-" 2 :<cmd>Oil<cr> :desc "Open parent directory"}])
+
+(fn init []
+ (let [cmds (require :util.cmds)]
+ (cmds.create-user-cmds user-cmds)))
+
(fn config []
(let [oil (require :oil)]
- (oil.setup {: keymaps})
- (vim.keymap.set :n "-" (fn []
- (oil.open))
- {:desc "Open parent directory"})))
+ (oil.setup {: keymaps})))
-{1 :stevearc/oil.nvim : config :event :VeryLazy}
+{1 :stevearc/oil.nvim : init : config : keys}