diff --git a/archived/nvim-tree.lua b/archived/nvim-tree.lua new file mode 100644 index 0000000..e091d72 --- /dev/null +++ b/archived/nvim-tree.lua @@ -0,0 +1,40 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = "nvim-tree/nvim-web-devicons", + config = function() + local nvimtree = require("nvim-tree") + -- recommended settings from nvim-tree documentation + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + nvimtree.setup({ + view = { + -- width = 35, + adaptive_size = true, + relativenumber = true, + }, + -- disable window_picker for explorer to work well with window splits + actions = { + open_file = { + window_picker = { + enable = true, + }, + }, + }, + -- Custom list of vim regex for names that will not be shown + filters = { + custom = { ".DS_Store" }, + }, + -- Show files ignored by git + git = { + ignore = false, + }, + }) + + -- set nvim-tree keypmaps + local keymap = vim.keymap + keymap.set('n', 'nt', ':NvimTreeToggle', {desc = "Toggle file explorer"}) + keymap.set('n', 'nf', ':NvimTreeFindFileToggle', {desc = "Toggle file explorer on current file"}) + + end +} diff --git a/lua/t0xa/core/keybindings.lua b/lua/t0xa/core/keybindings.lua index a08dc9b..341f03f 100644 --- a/lua/t0xa/core/keybindings.lua +++ b/lua/t0xa/core/keybindings.lua @@ -6,3 +6,5 @@ vim.keymap.set("n", "or", "ObsidianRename", { silent = true, no vim.keymap.set("n", "ol", "ObsidianToggleCheckbox", { silent = true, noremap = true, desc="Obsidian: toggle checkbox" }) vim.keymap.set("n", "on", "ObsidianNew", { silent = true, noremap = true, desc="Obsidian: new file" }) vim.keymap.set("n", "otoc", "ObsidianTOC", { silent = true, noremap = true, desc="Obsidian: open TOC" }) +-- Oil keybinds +vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) diff --git a/lua/t0xa/plugins/nvim-tree.lua b/lua/t0xa/plugins/nvim-tree.lua index e091d72..2e4098a 100644 --- a/lua/t0xa/plugins/nvim-tree.lua +++ b/lua/t0xa/plugins/nvim-tree.lua @@ -1,40 +1,43 @@ return { - "nvim-tree/nvim-tree.lua", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - local nvimtree = require("nvim-tree") - -- recommended settings from nvim-tree documentation - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - nvimtree.setup({ - view = { - -- width = 35, - adaptive_size = true, - relativenumber = true, - }, - -- disable window_picker for explorer to work well with window splits - actions = { - open_file = { - window_picker = { - enable = true, - }, - }, - }, - -- Custom list of vim regex for names that will not be shown - filters = { - custom = { ".DS_Store" }, - }, - -- Show files ignored by git - git = { - ignore = false, - }, - }) - - -- set nvim-tree keypmaps - local keymap = vim.keymap - keymap.set('n', 'nt', ':NvimTreeToggle', {desc = "Toggle file explorer"}) - keymap.set('n', 'nf', ':NvimTreeFindFileToggle', {desc = "Toggle file explorer on current file"}) - - end } +-- return { +-- "nvim-tree/nvim-tree.lua", +-- dependencies = "nvim-tree/nvim-web-devicons", +-- config = function() +-- local nvimtree = require("nvim-tree") +-- -- recommended settings from nvim-tree documentation +-- vim.g.loaded_netrw = 1 +-- vim.g.loaded_netrwPlugin = 1 +-- +-- nvimtree.setup({ +-- view = { +-- -- width = 35, +-- adaptive_size = true, +-- relativenumber = true, +-- }, +-- -- disable window_picker for explorer to work well with window splits +-- actions = { +-- open_file = { +-- window_picker = { +-- enable = true, +-- }, +-- }, +-- }, +-- -- Custom list of vim regex for names that will not be shown +-- filters = { +-- custom = { ".DS_Store" }, +-- }, +-- -- Show files ignored by git +-- git = { +-- ignore = false, +-- }, +-- }) +-- +-- -- set nvim-tree keypmaps +-- local keymap = vim.keymap +-- keymap.set('n', 'nt', ':NvimTreeToggle', {desc = "Toggle file explorer"}) +-- keymap.set('n', 'nf', ':NvimTreeFindFileToggle', {desc = "Toggle file explorer on current file"}) +-- +-- end +-- } diff --git a/lua/t0xa/plugins/oil.lua b/lua/t0xa/plugins/oil.lua new file mode 100644 index 0000000..9dc8700 --- /dev/null +++ b/lua/t0xa/plugins/oil.lua @@ -0,0 +1,28 @@ +return { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = { + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, + [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, + [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" }, + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + }, + -- Optional dependencies + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons +}