summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl')
-rw-r--r--fnl/config/autocmd.fnl6
-rw-r--r--fnl/config/lir.fnl44
-rw-r--r--fnl/config/lualine.fnl1
-rw-r--r--fnl/config/minibar.fnl1
-rw-r--r--fnl/plugins.fnl4
-rw-r--r--fnl/settings/keymaps.fnl1
6 files changed, 56 insertions, 1 deletions
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
+ :<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})))
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 :<m-n> :<cmd>nohlsearch<CR> opts)
(map :n :Q "<cmd>:q<CR>" opts)
-(map :n "-" "<cmd>:Explore<cr>" opts)