From d0bf87b97673000f692c68cfb8a94519ea639058 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 18 Dec 2022 21:13:34 +0100 Subject: Add lir again --- fnl/config/autocmd.fnl | 6 ++++++ fnl/config/lir.fnl | 44 ++++++++++++++++++++++++++++++++++++++++++++ fnl/config/lualine.fnl | 1 + fnl/config/minibar.fnl | 1 + fnl/plugins.fnl | 4 ++++ fnl/settings/keymaps.fnl | 1 - 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 fnl/config/lir.fnl (limited to 'fnl') diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index 2e3fee2..b76d68e 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -15,6 +15,12 @@ (vim.highlight.on_yank {:higroup :Visual :timeout 200}))}) +(create-autocmd :FileType {:pattern :lir + :callback (fn [] + (tset vim.opt_local :number false) + (tset vim.opt_local :relativenumber + false))}) + (create-autocmd :BufWinEnter {:command "setlocal formatoptions-=cro"}) (create-autocmd :FileType {:pattern :qf :command "set nobuflisted"}) diff --git a/fnl/config/lir.fnl b/fnl/config/lir.fnl new file mode 100644 index 0000000..45fb052 --- /dev/null +++ b/fnl/config/lir.fnl @@ -0,0 +1,44 @@ +;; 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 + : actions.split + :v actions.vsplit + : 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 + ":lua require(\"lir.mark.actions\").toggle_mark(\"v\")" + {: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()" + {:noremap true :silent true}))) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index eca6326..dd0f9de 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -3,6 +3,7 @@ (def- disable [:neogitstatus :netrw + :lir :alpha :Outline :NeogitStatus diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl index 342e4cd..5649b8d 100644 --- a/fnl/config/minibar.fnl +++ b/fnl/config/minibar.fnl @@ -4,6 +4,7 @@ :harpoon :startify :dashboard + :lir :alpha :packer :neogitstatus diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index a427bc8..9ae7c01 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -93,6 +93,10 @@ :nvim-lua/plenary.nvim :nvim-telescope/telescope-fzf-native.nvim :nvim-telescope/telescope-frecency.nvim]} + {1 :tamago324/lir.nvim + :config (fn [] + (require :config.lir)) + :requires [:kyazdani42/nvim-web-devicons]} {1 :ggandor/leap.nvim :event :BufWinEnter :config (fn [] diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 7695aab..30a6972 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -54,4 +54,3 @@ (map :n : :nohlsearch opts) (map :n :Q ":q" opts) -(map :n "-" ":Explore" opts) -- cgit v1.2.3-70-g09d2