diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-08 02:49:49 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-08 02:49:49 +0100 |
commit | 86fc163e549d78136855ac2b45e91ffb2f43affc (patch) | |
tree | 20fab78a2ff2635af5ac95f2b2a11d9d07ace0e1 /fnl/config/lir.fnl | |
parent | 0d7f782cb4e68cff000beb00e8ab64308a66f3f0 (diff) |
Refactor config loading
Diffstat (limited to 'fnl/config/lir.fnl')
-rw-r--r-- | fnl/config/lir.fnl | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/fnl/config/lir.fnl b/fnl/config/lir.fnl index 45fb052..22b15cf 100644 --- a/fnl/config/lir.fnl +++ b/fnl/config/lir.fnl @@ -1,44 +1,50 @@ ;; Simple file manager. -(module config.lir {autoload {util config.util nvim aniseed.nvim}}) -(defn- opts [actions mark-actions clipboard-actions] - {:show_hidden_files false - :devicons_enable true - :mappings {:l actions.edit - :<C-s> actions.split - :v actions.vsplit - :<C-t> actions.tabedit - :h actions.up - :q actions.quit - :A actions.mkdir - :a actions.newfile - :r actions.rename - "@" actions.cd - :Y actions.yank_path - :i actions.toggle_show_hidden - :d actions.delete - :J (fn [] - (mark-actions.toggle_mark) - (vim.cmd "normal! j")) - :c clipboard-actions.copy - :x clipboard-actions.cut - :p clipboard-actions.paste} - :float {:winblend 0 - :curdir_window {:enable false :highlight_dirname true} - :win_opts (fn [] - (let [width (math.floor (* vim.o.columns 0.7)) - height (math.floor (* vim.o.lines 0.7))] - {:border :rounded : width : height}))} - :hide_cursor false - :on_init (fn [] - (nvim.buf_set_keymap 0 :x :J - ":<C-u>lua require(\"lir.mark.actions\").toggle_mark(\"v\")<CR>" - {:noremap true :silent true}))}) +(fn opts [actions mark-actions clipboard-actions] + {:show_hidden_files false + :devicons_enable true + :mappings {:l actions.edit + :<C-s> actions.split + :v actions.vsplit + :<C-t> actions.tabedit + :h actions.up + :q actions.quit + :A actions.mkdir + :a actions.newfile + :r actions.rename + "@" actions.cd + :Y actions.yank_path + :i actions.toggle_show_hidden + :d actions.delete + :J (fn [] + (mark-actions.toggle_mark) + (vim.cmd "normal! j")) + :c clipboard-actions.copy + :x clipboard-actions.cut + :p clipboard-actions.paste} + :float {:winblend 0 + :curdir_window {:enable false :highlight_dirname true} + :win_opts (fn [] + (let [width (math.floor (* vim.o.columns 0.7)) + height (math.floor (* vim.o.lines 0.7))] + {:border :rounded : width : height}))} + :hide_cursor false + :on_init (fn [] + (nvim.buf_set_keymap 0 :x :J + ":<C-u>lua require(\"lir.mark.actions\").toggle_mark(\"v\")<CR>" + {:noremap true :silent true}))}) -(let [lir (util.prequire :lir)] - (let [actions (require :lir.actions) - mark-actions (require :lir.mark.actions) - clipboard-actions (require :lir.clipboard.actions)] - (lir.setup (opts actions mark-actions clipboard-actions)) - (nvim.set_keymap :n "-" ":lua require'lir.float'.toggle()<cr>" - {:noremap true :silent true}))) +(fn setup [] + (let [lir (require :lir)] + (let [actions (require :lir.actions) + mark-actions (require :lir.mark.actions) + clipboard-actions (require :lir.clipboard.actions)] + (lir.setup (opts actions mark-actions clipboard-actions)) + (nvim.set_keymap :n "-" ":lua require'lir.float'.toggle()<cr>" + {:noremap true :silent true})))) + +{1 :tamago324/lir.nvim + :keys "-" + :config (fn [] + (setup)) + :dependencies [:kyazdani42/nvim-web-devicons]} |