summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/neo-tree.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-06-08 22:25:15 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-06-08 22:25:15 +0200
commitb9e9bb394660968d97afb9c579899d7676a0a25f (patch)
treed0aea5b6b32b4091bf019dcea0f94d1bde0a9160 /fnl/plugins/editor/neo-tree.fnl
parentafb8d6765f6b33b86887f537c877a84b7622dc59 (diff)
Replace lir with neo-tree
Diffstat (limited to 'fnl/plugins/editor/neo-tree.fnl')
-rw-r--r--fnl/plugins/editor/neo-tree.fnl43
1 files changed, 43 insertions, 0 deletions
diff --git a/fnl/plugins/editor/neo-tree.fnl b/fnl/plugins/editor/neo-tree.fnl
new file mode 100644
index 0000000..5630c7e
--- /dev/null
+++ b/fnl/plugins/editor/neo-tree.fnl
@@ -0,0 +1,43 @@
+;; File manager.
+
+(local icons (require :plugins.icons))
+
+(fn init []
+ (set vim.g.neo_tree_remove_legacy_commands 1)
+ (if (= (vim.fn.argc) 1)
+ (let [stat (vim.loop.fs_stat (vim.fn.argv 1))]
+ (if (and stat (= stat.type :directory))
+ (require :neo-tree)))))
+
+(fn deactivate []
+ (vim.cmd "Neotree close"))
+
+(local opts
+ {:sources [:filesystem :buffers :git_status :document_symbols]
+ :source_selector {:winbar false :statusline false}
+ :enable_git_status false
+ :enable_diagnostics false
+ :open_files_do_not_replace_types [:terminal :Trouble :qf :Outline]
+ :filesystem {:bind_to_cwd false
+ :follow_current_file true
+ :use_libuv_file_watcher true}
+ :window {:position :float
+ :mappings {:<space> :none
+ :l :open
+ :h :close_node
+ :. :toggle_hidden
+ :e :focus_preview}}
+ :default_component_configs {:indent {:with_expanders true
+ :expander_collapsed ""
+ :expander_expanded ""
+ :expander_highlight :NeoTreeExpander}}})
+
+{1 :nvim-neo-tree/neo-tree.nvim
+ :keys [{1 "-" 2 :<cmd>Neotree<cr> :desc "Open Neotree"}]
+ :cmd :Neotree
+ : init
+ : deactivate
+ : opts
+ :dependencies [:nvim-lua/plenary.nvim
+ :nvim-tree/nvim-web-devicons
+ :MunifTanjim/nui.nvim]}