Migrate options to setup

This migrates and renamed the following options to `nvim_tree.setup` in accordance to nvim-tree migration guide:

* vim.g.nvim_tree_icons -> moved to setup.renderer.icons.glyphs
* setup.auto_close -> feature has been removed
* setup.update_to_buf_dir -> renamed to hijack_directories
* setup.quit_on_open -> moved to setup.actions.open_file
* setup.git_hl -> renamed to highlight_git and moved to setup.renderer
* setup.disable_window_picker -> renamed to window_picker and moved to setup.actions
* setup.root_folder_modifier -> moved to setup.renderer
* setup.show_icons -> moved to setup.renderer.icons.show; removed tree_width

Migration guide: https://github.com/kyazdani42/nvim-tree.lua/issues/674
nvim-tree docs : https://github.com/kyazdani42/nvim-tree.lua/blob/master/doc/nvim-tree-lua.txt
pull/221/head
Darylle Villanueva 2 years ago
parent dd004512f2
commit f721dba894

@ -1,25 +1,5 @@
-- following options are the default
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
vim.g.nvim_tree_icons = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
deleted = "",
untracked = "U",
ignored = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
},
}
local status_ok, nvim_tree = pcall(require, "nvim-tree")
if not status_ok then
@ -42,11 +22,10 @@ nvim_tree.setup {
"dashboard",
"alpha",
},
auto_close = true,
open_on_tab = false,
hijack_cursor = false,
update_cwd = true,
update_to_buf_dir = {
hijack_directories = {
enable = true,
auto_open = true,
},
@ -86,15 +65,40 @@ nvim_tree.setup {
number = false,
relativenumber = false,
},
quit_on_open = 0,
git_hl = 1,
disable_window_picker = 0,
actions = {
quit_on_open = true,
window_picker = { enable = true },
},
renderer = {
highlight_git = true,
root_folder_modifier = ":t",
show_icons = {
git = 1,
folders = 1,
files = 1,
folder_arrows = 1,
tree_width = 30,
icons = {
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
},
glyphs = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
deleted = "",
untracked = "U",
ignored = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
},
}
}
}
}

Loading…
Cancel
Save