From 77305f6043ffdd878ebd7471ef9ddd32e80aa9c5 Mon Sep 17 00:00:00 2001 From: Ray Andrew <4437323+rayandrew@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:36:04 -0500 Subject: [PATCH] add oil --- lazy-lock.json | 1 + lua/rayandrew/plugins.lua | 22 ++++++++++++++++------ lua/rayandrew/remap.lua | 18 +++++++++++------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 9cdd03f..bcc9e50 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -32,6 +32,7 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, + "oil.nvim": { "branch": "master", "commit": "eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" }, diff --git a/lua/rayandrew/plugins.lua b/lua/rayandrew/plugins.lua index aa08982..5538c9a 100644 --- a/lua/rayandrew/plugins.lua +++ b/lua/rayandrew/plugins.lua @@ -218,6 +218,16 @@ return { -- File Management ------------------------------ + { + "stevearc/oil.nvim", + opts = { + default_file_explorer = true, + restore_win_options = true, + }, + -- Optional dependencies + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + -- file explorer { "nvim-neo-tree/neo-tree.nvim", @@ -266,12 +276,12 @@ return { vim.cmd([[Neotree close]]) end, init = function() - if vim.fn.argc() == 1 then - local stat = vim.loop.fs_stat(vim.fn.argv(0)) - if stat and stat.type == "directory" then - require("neo-tree") - end - end + -- if vim.fn.argc() == 1 then + -- local stat = vim.loop.fs_stat(vim.fn.argv(0)) + -- if stat and stat.type == "directory" then + -- require("neo-tree") + -- end + -- end end, opts = { sources = { "filesystem", "buffers", "git_status", "document_symbols" }, diff --git a/lua/rayandrew/remap.lua b/lua/rayandrew/remap.lua index fddc561..a4e97bd 100644 --- a/lua/rayandrew/remap.lua +++ b/lua/rayandrew/remap.lua @@ -109,19 +109,20 @@ end, { desc = "Lazygit (cwd)" }) local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end -Util.map("n", "ft", lazyterm, { desc = "Terminal (root dir)" }) -Util.map("n", "fT", function() +Util.map("n", "tt", lazyterm, { desc = "Terminal (root dir)" }) +Util.map("n", "tT", function() Util.float_term() end, { desc = "Terminal (cwd)" }) -Util.map("n", "", lazyterm, { desc = "Terminal (root dir)" }) +Util.map("n", "`", lazyterm, { desc = "Terminal (root dir)" }) +-- Util.map("n", "", lazyterm, { desc = "Terminal (root dir)" }) Util.map("n", "", lazyterm, { desc = "Terminal (root dir)" }) Util.map("n", "", lazyterm, { desc = "which_key_ignore" }) Util.map("t", "", "", { desc = "Enter Normal Mode" }) -Util.map("t", "", "wincmd h", { desc = "Go to left window" }) -Util.map("t", "", "wincmd j", { desc = "Go to lower window" }) -Util.map("t", "", "wincmd k", { desc = "Go to upper window" }) -Util.map("t", "", "wincmd l", { desc = "Go to right window" }) +-- Util.map("t", "", "wincmd h", { desc = "Go to left window" }) +-- Util.map("t", "", "wincmd j", { desc = "Go to lower window" }) +-- Util.map("t", "", "wincmd k", { desc = "Go to upper window" }) +-- Util.map("t", "", "wincmd l", { desc = "Go to right window" }) Util.map("t", "", "close", { desc = "Hide Terminal" }) Util.map("t", "", "close", { desc = "which_key_ignore" }) @@ -131,3 +132,6 @@ Util.map("t", "", "close", { desc = "which_key_ignore" }) -- lazy Util.map("n", "l", "Lazy", { desc = "Lazy" }) + +-- oil +vim.keymap.set("n", "-", require("oil").open, { desc = "Open parent directory" })