fixed nvim tree setup
This commit is contained in:
parent
228f20862a
commit
54e0dbd116
@ -1,18 +1,18 @@
|
|||||||
-- following options are the default
|
-- following options are the default
|
||||||
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
|
||||||
if not status_ok then
|
local nvimtree = require("nvim-tree")
|
||||||
return
|
|
||||||
|
nvimtree.setup {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local api = require("nvim-tree.api")
|
||||||
|
|
||||||
|
local function opts(desc)
|
||||||
|
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||||
end
|
end
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
vim.keymap.set("n", "<space>", api.node.open.edit, opts("Open"))
|
||||||
if not config_status_ok then
|
end,
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
|
||||||
|
|
||||||
nvim_tree.setup {
|
|
||||||
renderer = {
|
renderer = {
|
||||||
icons = {
|
icons = {
|
||||||
webdev_colors = true,
|
webdev_colors = true,
|
||||||
@ -86,19 +86,11 @@ nvim_tree.setup {
|
|||||||
},
|
},
|
||||||
view = {
|
view = {
|
||||||
width = 30,
|
width = 30,
|
||||||
hide_root_folder = false,
|
|
||||||
side = "left",
|
side = "left",
|
||||||
mappings = {
|
float = {
|
||||||
custom_only = false,
|
quit_on_focus_loss = true,
|
||||||
list = {
|
|
||||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
|
||||||
{ key = "h", cb = tree_cb "close_node" },
|
|
||||||
{ key = "v", cb = tree_cb "vsplit" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
number = false,
|
|
||||||
relativenumber = false,
|
|
||||||
},
|
|
||||||
trash = {
|
trash = {
|
||||||
cmd = "trash",
|
cmd = "trash",
|
||||||
require_confirm = true,
|
require_confirm = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user