diff options
| author | Mike Vink <ivi@vinkies.net> | 2023-12-08 08:16:39 +0100 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2023-12-09 07:22:14 +0100 |
| commit | 2cd43f8fbd7e404354be740866744d0c9c9fcc98 (patch) | |
| tree | 380c11c3a8b836949d2e45bb1d222e0f18f9b737 | |
| parent | 3ef1d76ddeb9249bfa7bb87f27f529f931fcb99c (diff) | |
try oil
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 1 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/pkgs.fnl | 1 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/pkgs/oil.fnl | 45 | ||||
| -rw-r--r-- | profiles/core/neovim.nix | 4 |
4 files changed, 48 insertions, 3 deletions
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 0279375..4ec8b76 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -29,6 +29,7 @@ (local cope #(vim.cmd (.. ":copen " (math.floor (/ vim.o.lines 2.1))))) (let [map vim.keymap.set] + (map :n :- ::Oil<cr>) (map :v :y "<Plug>OSCYankVisual|gvy") (map :n :<leader>qf cope) (map :n :<leader>q<BS> ":cclose<cr>") diff --git a/mut/neovim/fnl/conf/pkgs.fnl b/mut/neovim/fnl/conf/pkgs.fnl index 7c5f503..37ebc52 100644 --- a/mut/neovim/fnl/conf/pkgs.fnl +++ b/mut/neovim/fnl/conf/pkgs.fnl @@ -4,5 +4,6 @@ (require :conf.pkgs.dap) (require :conf.pkgs.venn) (require :conf.pkgs.gitsigns) +(require :conf.pkgs.oil) ;; (require :conf.pkgs.lsp_lines) ;; (require :conf.pkgs.null-ls) diff --git a/mut/neovim/fnl/conf/pkgs/oil.fnl b/mut/neovim/fnl/conf/pkgs/oil.fnl new file mode 100644 index 0000000..2365872 --- /dev/null +++ b/mut/neovim/fnl/conf/pkgs/oil.fnl @@ -0,0 +1,45 @@ +(local oil (require :oil)) + +(oil.setup + { + :default_file_explorer true + :skip_confirm_for_simple_edits true + + :columns [:size :permissions] + :view_options + { + :show_hidden false + :is_hidden_file (fn [name bufnr] + (vim.startswith name ".")) + :is_always_hidden (fn [name bufnr] false) + :sort [["type" "asc"] ["name" "asc"]]} + + + :keymaps + { + "g?" "actions.show_help" + "<CR>" "actions.select" + "<C-s>" "actions.select_vsplit" + "<C-h>" "actions.select_split" + "<C-t>" "actions.select_tab" + "<C-p>" "actions.preview" + "<C-c>" "actions.close" + "<C-l>" "actions.refresh" + "." "actions.open_cmdline" + "gx" {:callback (fn [] + (local file (oil.get_cursor_entry)) + (vim.cmd (.. :argadd " " file.name)) + (vim.cmd :args))} + "gX" {:callback (fn [] + (local file (oil.get_cursor_entry)) + (vim.cmd (.. :argdel " " file.name)) + (vim.cmd :args))} + "gc" {:callback (fn [] + (vim.cmd "argdel *") + (vim.cmd "args"))} + "-" "actions.parent" + "_" "actions.open_cwd" + "cd" "actions.cd" + "~" "actions.tcd" + "gs" "actions.change_sort" + "g." "actions.toggle_hidden"}}) diff --git a/profiles/core/neovim.nix b/profiles/core/neovim.nix index 0063bd8..765df70 100644 --- a/profiles/core/neovim.nix +++ b/profiles/core/neovim.nix @@ -50,7 +50,7 @@ vim-helm # external - vim-dirvish + oil-nvim vim-fugitive vim-oscyank venn-nvim @@ -81,8 +81,6 @@ vim-racket nvim-parinfer hotpot-nvim - - oil-nvim ]; }; }; |
