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
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
local nvimtree = require("nvim-tree")
|
||||||
if not config_status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
nvimtree.setup {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local api = require("nvim-tree.api")
|
||||||
|
|
||||||
nvim_tree.setup {
|
local function opts(desc)
|
||||||
|
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||||
|
end
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
vim.keymap.set("n", "<space>", api.node.open.edit, opts("Open"))
|
||||||
|
end,
|
||||||
renderer = {
|
renderer = {
|
||||||
icons = {
|
icons = {
|
||||||
webdev_colors = true,
|
webdev_colors = true,
|
||||||
@ -86,18 +86,10 @@ 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",
|
||||||
|
Loading…
Reference in New Issue
Block a user