diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-12-01 12:15:42 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-12-01 12:15:42 +0100 |
commit | a732c5a1f42165df19299d26e737c39d9101ccb5 (patch) | |
tree | a9a31f832e8f21177b84ae9d4a1c31a2948cb368 | |
parent | d474f377a09950b33b77bc6722df0e4129f94193 (diff) |
Load oil on key
-rw-r--r-- | fnl/plugins/editor/oil.fnl | 19 |
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} |