From 2cd43f8fbd7e404354be740866744d0c9c9fcc98 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 8 Dec 2023 08:16:39 +0100 Subject: try oil --- mut/neovim/fnl/conf/init.fnl | 1 + mut/neovim/fnl/conf/pkgs.fnl | 1 + mut/neovim/fnl/conf/pkgs/oil.fnl | 45 ++++++++++++++++++++++++++++++++++++++++ profiles/core/neovim.nix | 4 +--- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 mut/neovim/fnl/conf/pkgs/oil.fnl 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) (map :v :y "OSCYankVisual|gvy") (map :n :qf cope) (map :n :q ":cclose") 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" + "" "actions.select" + "" "actions.select_vsplit" + "" "actions.select_split" + "" "actions.select_tab" + "" "actions.preview" + "" "actions.close" + "" "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 ]; }; }; -- cgit v1.2.3