Trying oil instead of Nvim tree
This commit is contained in:
parent
903ac95d2b
commit
a70585a4ec
4 changed files with 110 additions and 37 deletions
40
archived/nvim-tree.lua
Normal file
40
archived/nvim-tree.lua
Normal file
|
@ -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', '<leader>nt', ':NvimTreeToggle<CR>', {desc = "Toggle file explorer"})
|
||||||
|
keymap.set('n', '<leader>nf', ':NvimTreeFindFileToggle<CR>', {desc = "Toggle file explorer on current file"})
|
||||||
|
|
||||||
|
end
|
||||||
|
}
|
|
@ -6,3 +6,5 @@ vim.keymap.set("n", "<leader>or", "<cmd>ObsidianRename<CR>", { silent = true, no
|
||||||
vim.keymap.set("n", "<leader>ol", "<cmd>ObsidianToggleCheckbox<CR>", { silent = true, noremap = true, desc="Obsidian: toggle checkbox" })
|
vim.keymap.set("n", "<leader>ol", "<cmd>ObsidianToggleCheckbox<CR>", { silent = true, noremap = true, desc="Obsidian: toggle checkbox" })
|
||||||
vim.keymap.set("n", "<leader>on", "<cmd>ObsidianNew<CR>", { silent = true, noremap = true, desc="Obsidian: new file" })
|
vim.keymap.set("n", "<leader>on", "<cmd>ObsidianNew<CR>", { silent = true, noremap = true, desc="Obsidian: new file" })
|
||||||
vim.keymap.set("n", "<leader>otoc", "<cmd>ObsidianTOC<CR>", { silent = true, noremap = true, desc="Obsidian: open TOC" })
|
vim.keymap.set("n", "<leader>otoc", "<cmd>ObsidianTOC<CR>", { silent = true, noremap = true, desc="Obsidian: open TOC" })
|
||||||
|
-- Oil keybinds
|
||||||
|
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
|
|
@ -1,40 +1,43 @@
|
||||||
return {
|
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', '<leader>nt', ':NvimTreeToggle<CR>', {desc = "Toggle file explorer"})
|
|
||||||
keymap.set('n', '<leader>nf', ':NvimTreeFindFileToggle<CR>', {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', '<leader>nt', ':NvimTreeToggle<CR>', {desc = "Toggle file explorer"})
|
||||||
|
-- keymap.set('n', '<leader>nf', ':NvimTreeFindFileToggle<CR>', {desc = "Toggle file explorer on current file"})
|
||||||
|
--
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
|
28
lua/t0xa/plugins/oil.lua
Normal file
28
lua/t0xa/plugins/oil.lua
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
return {
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
---@module 'oil'
|
||||||
|
---@type oil.SetupOpts
|
||||||
|
opts = {
|
||||||
|
keymaps = {
|
||||||
|
["g?"] = "actions.show_help",
|
||||||
|
["<CR>"] = "actions.select",
|
||||||
|
["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
|
||||||
|
["<C-h>"] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" },
|
||||||
|
["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
|
||||||
|
["<C-p>"] = "actions.preview",
|
||||||
|
["<C-c>"] = "actions.close",
|
||||||
|
["<C-l>"] = "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
|
||||||
|
}
|
Loading…
Reference in a new issue