about summary refs log tree commit diff
path: root/fnl/nvrc/packs
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-02-26 21:20:00 +0900
committersefidel <contact@sefidel.net>2022-02-26 21:20:00 +0900
commita2bf2823093778a3a77fb0a35efd45bffc7aeb29 (patch)
treeed8df8ae5fee6e6bdbeafd822d57aac918d8bc6b /fnl/nvrc/packs
parent899a50bf8eb2816305afb79bb1134209a5f3cbdb (diff)
downloadnvimrc-a2bf2823093778a3a77fb0a35efd45bffc7aeb29.tar.gz
nvimrc-a2bf2823093778a3a77fb0a35efd45bffc7aeb29.zip
feat(pack): add lir
Diffstat (limited to 'fnl/nvrc/packs')
-rw-r--r--fnl/nvrc/packs/lir.fnl36
1 files changed, 36 insertions, 0 deletions
diff --git a/fnl/nvrc/packs/lir.fnl b/fnl/nvrc/packs/lir.fnl
new file mode 100644
index 0000000..18b85d6
--- /dev/null
+++ b/fnl/nvrc/packs/lir.fnl
@@ -0,0 +1,36 @@
+(local lir (require :lir))
+(local actions (require :lir.actions))
+(local mark-actions (require :lir.mark.actions))
+(local clipboard-actions (require :lir.clipboard.actions))
+
+(lir.setup {:show_hidden_files false
+            :mappings {:l actions.edit
+                       :<C-s> actions.split
+                       :<C-v> actions.vsplit
+                       :<C-t> actions.tabedit
+                       :h actions.up
+                       :q actions.quit
+                       :K actions.mkdir
+                       :N actions.newfile
+                       :R actions.rename
+                       "@" actions.cd
+                       :Y actions.yank_path
+                       :. 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
+                    :win_opts (fn []
+                                (let [width (math.floor (* vim.o.columns 0.5))
+                                      height (math.floor (* vim.o.lines 0.5))]
+                                  {:border :rounded
+                                   : width
+                                   : height
+                                   :row (-> vim.o.lines (- height) (/ 2) (math.floor) (- 5))
+                                   :col (-> vim.o.columns (- width) (/ 2)
+                                            (math.floor))}))}
+            :hide_cursor false})