diff options
Diffstat (limited to 'fnl/plugins/editor')
-rw-r--r-- | fnl/plugins/editor/lir.fnl | 52 | ||||
-rw-r--r-- | fnl/plugins/editor/neo-tree.fnl | 43 |
2 files changed, 43 insertions, 52 deletions
diff --git a/fnl/plugins/editor/lir.fnl b/fnl/plugins/editor/lir.fnl deleted file mode 100644 index 8caa8e4..0000000 --- a/fnl/plugins/editor/lir.fnl +++ /dev/null @@ -1,52 +0,0 @@ -;; Simple file manager. - -(fn opts [actions mark-actions clipboard-actions] - {:show_hidden_files false - :devicons {:enable true :highlight_dirname false} - :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 [] - (vim.api.nvim_buf_set_keymap 0 :x :J - ":<C-u>lua require(\"lir.mark.actions\").toggle_mark(\"v\")<CR>" - {:noremap true :silent true}))}) - -(fn setup [] - (let [actions (require :lir.actions) - clipboard-actions (require :lir.clipboard.actions) - mark-actions (require :lir.mark.actions) - lir (require :lir)] - (tset vim.g :loaded_netrw 1) - (tset vim.g :loaded_netrwPlugin 1) - (lir.setup (opts actions mark-actions clipboard-actions)) - (vim.keymap.set :n "-" ":lua require'lir.float'.toggle()<cr>" - {:noremap true :silent true}))) - -{1 :tamago324/lir.nvim - :keys "-" - :config (fn [] - (setup)) - :dependencies [:kyazdani42/nvim-web-devicons]} 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]} |