From 6021565a28e4925b77d4997a553dfad5fbb521fd Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 10 Jun 2023 14:27:06 +0200 Subject: Fix cursorline in neo-tree --- fnl/plugins/editor/neo-tree.fnl | 49 +++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-) (limited to 'fnl/plugins') diff --git a/fnl/plugins/editor/neo-tree.fnl b/fnl/plugins/editor/neo-tree.fnl index 725049b..121cd82 100644 --- a/fnl/plugins/editor/neo-tree.fnl +++ b/fnl/plugins/editor/neo-tree.fnl @@ -1,5 +1,7 @@ ;; File manager. +(local cursorline (require :util.cursorline)) + (fn init [] (set vim.g.neo_tree_remove_legacy_commands 1) (if (= (vim.fn.argc) 1) @@ -10,28 +12,37 @@ (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 {: :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}}}) +(local opts {:sources [:filesystem :buffers :git_status :document_symbols] + :source_selector {:winbar false :statusline false} + :use_popups_for_input 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 + :hijack_netrw_behavior :open_default + :use_libuv_file_watcher true} + :window {:position :float + :popup {:position {:col "50%" :row :10}} + :mappings {: :none + :P {1 :toggle_preview + :config {:use_float true}} + :l :open + :h :close_node + :. :toggle_hidden + :e :focus_preview}} + :default_component_configs {:indent {:with_expanders true + :expander_collapsed "" + :expander_expanded "" + :expander_highlight :NeoTreeExpander}} + :event_handlers [{:event :neo_tree_buffer_enter + :handler cursorline.show} + {:event :neo_tree_buffer_leave + :handler cursorline.show}]}) {1 :nvim-neo-tree/neo-tree.nvim :keys [{1 "-" 2 :Neotree :desc "Open Neotree"}] + :event :VeryLazy :cmd :Neotree : init : deactivate -- cgit v1.2.3-70-g09d2