diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-06-08 22:25:15 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-06-08 22:25:15 +0200 |
commit | b9e9bb394660968d97afb9c579899d7676a0a25f (patch) | |
tree | d0aea5b6b32b4091bf019dcea0f94d1bde0a9160 | |
parent | afb8d6765f6b33b86887f537c877a84b7622dc59 (diff) |
Replace lir with neo-tree
-rw-r--r-- | fnl/plugins/editor/lir.fnl | 52 | ||||
-rw-r--r-- | fnl/plugins/editor/neo-tree.fnl | 43 | ||||
-rw-r--r-- | fnl/plugins/icons.fnl | 4 | ||||
-rw-r--r-- | fnl/plugins/ui/lualine.fnl | 3 | ||||
-rw-r--r-- | fnl/plugins/ui/minibar.fnl | 2 | ||||
-rw-r--r-- | lazy-lock.json | 2 |
6 files changed, 53 insertions, 53 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]} diff --git a/fnl/plugins/icons.fnl b/fnl/plugins/icons.fnl index 86eec76..870aa3d 100644 --- a/fnl/plugins/icons.fnl +++ b/fnl/plugins/icons.fnl @@ -38,4 +38,8 @@ :play "" :star "" :line "‒" + :ignored "" + :unstaged "" + :staged "" + :conflict "" } diff --git a/fnl/plugins/ui/lualine.fnl b/fnl/plugins/ui/lualine.fnl index e2b533b..80adf55 100644 --- a/fnl/plugins/ui/lualine.fnl +++ b/fnl/plugins/ui/lualine.fnl @@ -7,6 +7,7 @@ :lir :lazy :alpha + :neo-tree :Outline :NeogitStatus :NeogitCommitMessage]) @@ -87,4 +88,4 @@ {1 :nvim-lualine/lualine.nvim :event :BufReadPost : opts - :dependencies [:kyazdani42/nvim-web-devicons :arkav/lualine-lsp-progress]} + :dependencies [:nvim-tree/nvim-web-devicons :arkav/lualine-lsp-progress]} diff --git a/fnl/plugins/ui/minibar.fnl b/fnl/plugins/ui/minibar.fnl index 66b2ff7..ed80330 100644 --- a/fnl/plugins/ui/minibar.fnl +++ b/fnl/plugins/ui/minibar.fnl @@ -14,6 +14,8 @@ :lazy :netrw :Outline + :neo-tree + :neo-tree-popup :NeogitStatus :NeogitCommitMessage :NeogitNotification diff --git a/lazy-lock.json b/lazy-lock.json index 547f44e..89fc0f1 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -28,8 +28,10 @@ "mason-null-ls.nvim": { "branch": "main", "commit": "54d702020bf94e4eefd357f0b738317af30217eb" }, "mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" }, "minibar.nvim": { "branch": "master", "commit": "353ca4efaf7fff1566bb02e0d7cb51133c41f660" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "8c89efb93b8383666a6f989762c2f610f5f2c930" }, "neogit": { "branch": "master", "commit": "4cebc271b13cb7af6b5a3e8ad76a356660c0c00c" }, "no-clown-fiesta.nvim": { "branch": "master", "commit": "f8e2b3fe8ecefaddf9ded87db03daa891a6975e2" }, + "nui.nvim": { "branch": "main", "commit": "d5a82aae64426a805e19d8ef5a379292f9dc55d3" }, "null-ls.nvim": { "branch": "main", "commit": "c89333e034a8daba654ebfcf9a4ec9f87765f01e" }, "nvim-autopairs": { "branch": "master", "commit": "59df87a84c80a357ca8d8fe86e451b93ac476ccc" }, "nvim-bqf": { "branch": "main", "commit": "1276701ed0216b94d7919d5c07845dcdf05fbde5" }, |