Skip to content

Commit 20797a8

Browse files
authored
#1050 #1068 various default options tweaks (#1074)
1 parent ecbe3ad commit 20797a8

File tree

7 files changed

+188
-218
lines changed

7 files changed

+188
-218
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 12 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -63,108 +63,36 @@ body:
6363
value: |
6464
vim.cmd [[set runtimepath=$VIMRUNTIME]]
6565
vim.cmd [[set packpath=/tmp/nvt-min/site]]
66-
local package_root = '/tmp/nvt-min/site/pack'
67-
local install_path = package_root .. '/packer/start/packer.nvim'
66+
local package_root = "/tmp/nvt-min/site/pack"
67+
local install_path = package_root .. "/packer/start/packer.nvim"
6868
local function load_plugins()
69-
require('packer').startup {
69+
require("packer").startup {
7070
{
71-
'wbthomason/packer.nvim',
72-
'kyazdani42/nvim-tree.lua',
73-
'kyazdani42/nvim-web-devicons',
71+
"wbthomason/packer.nvim",
72+
"kyazdani42/nvim-tree.lua",
73+
"kyazdani42/nvim-web-devicons",
7474
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
7575
},
7676
config = {
7777
package_root = package_root,
78-
compile_path = install_path .. '/plugin/packer_compiled.lua',
78+
compile_path = install_path .. "/plugin/packer_compiled.lua",
7979
display = { non_interactive = true },
8080
},
8181
}
8282
end
8383
if vim.fn.isdirectory(install_path) == 0 then
84-
print("Installing nvim-tree and dependencies.")
85-
vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
84+
print "Installing nvim-tree and dependencies."
85+
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
8686
end
8787
load_plugins()
88-
require('packer').sync()
88+
require("packer").sync()
8989
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
9090
vim.opt.termguicolors = true
9191
vim.opt.cursorline = true
92-
92+
9393
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
9494
_G.setup = function()
95-
vim.g.nvim_tree_indent_markers = 0
96-
vim.g.nvim_tree_git_hl = 0
97-
vim.g.nvim_tree_highlight_opened_files = 0
98-
vim.g.nvim_tree_root_folder_modifier = ':~'
99-
vim.g.nvim_tree_add_trailing = 0
100-
vim.g.nvim_tree_group_empty = 0
101-
vim.g.nvim_tree_icon_padding = ' '
102-
vim.g.nvim_tree_symlink_arrow = ' ➛ '
103-
vim.g.nvim_tree_respect_buf_cwd = 0
104-
vim.g.nvim_tree_create_in_closed_folder = 0
105-
vim.g.nvim_tree_special_files = { ["Cargo.toml"] = true, Makefile = true, ["README.md"] = true, ["readme.md"] = true, }
106-
vim.g.nvim_tree_show_icons = { git = 1, folders = 1, files = 1, folder_arrows = 1 }
107-
require'nvim-tree'.setup {
108-
auto_close = false,
109-
auto_reload_on_write = true,
110-
disable_netrw = false,
111-
hide_root_folder = false,
112-
hijack_cursor = false,
113-
hijack_netrw = true,
114-
hijack_unnamed_buffer_when_opening = false,
115-
ignore_buffer_on_setup = false,
116-
open_on_setup = false,
117-
open_on_tab = false,
118-
sort_by = "name",
119-
update_cwd = false,
120-
hijack_directories = {
121-
enable = true,
122-
auto_open = true,
123-
},
124-
update_focused_file = {
125-
enable = false,
126-
update_cwd = false,
127-
ignore_list = {}
128-
},
129-
ignore_ft_on_setup = {},
130-
system_open = {
131-
cmd = nil,
132-
args = {}
133-
},
134-
diagnostics = {
135-
enable = false,
136-
show_on_dirs = false,
137-
icons = {
138-
hint = "",
139-
info = "",
140-
warning = "",
141-
error = "",
142-
}
143-
},
144-
filters = {
145-
dotfiles = false,
146-
custom = {},
147-
exclude = {}
148-
},
149-
git = {
150-
enable = true,
151-
ignore = true,
152-
timeout = 400,
153-
},
154-
actions = {
155-
change_dir = {
156-
enable = true,
157-
global = false,
158-
},
159-
open_file = {
160-
quit_on_open = false,
161-
resize_window = false,
162-
window_picker = {
163-
enable = true,
164-
}
165-
}
166-
},
167-
}
95+
require("nvim-tree").setup {}
16896
end
16997
validations:
17098
required: true

README.md

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -108,68 +108,76 @@ highlight NvimTreeFolderIcon guibg=blue
108108
```lua
109109
-- init.lua
110110

111-
-- following options are the default
111+
-- empty setup using defaults: add your own options
112+
require'nvim-tree'.setup {
113+
}
114+
115+
-- OR
116+
117+
-- setup with all defaults
112118
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
113119
require'nvim-tree'.setup {
114-
disable_netrw = false,
115-
hijack_netrw = true,
116-
open_on_setup = false,
117-
ignore_buffer_on_setup = false,
118-
ignore_ft_on_setup = {},
119-
auto_close = false,
120+
[//]: <> (BEGIN_DEFAULT_OPTS)
121+
auto_close = false,
120122
auto_reload_on_write = true,
121-
open_on_tab = false,
122-
hijack_cursor = false,
123-
update_cwd = false,
123+
disable_netrw = false,
124+
hide_root_folder = false,
125+
hijack_cursor = false,
126+
hijack_netrw = true,
124127
hijack_unnamed_buffer_when_opening = false,
125-
hijack_directories = {
128+
ignore_buffer_on_setup = false,
129+
open_on_setup = false,
130+
open_on_tab = false,
131+
sort_by = "name",
132+
update_cwd = false,
133+
view = {
134+
width = 30,
135+
height = 30,
136+
side = "left",
137+
preserve_window_proportions = false,
138+
number = false,
139+
relativenumber = false,
140+
signcolumn = "yes",
141+
mappings = {
142+
custom_only = false,
143+
list = {
144+
-- user mappings go here
145+
},
146+
},
147+
},
148+
hijack_directories = {
126149
enable = true,
127150
auto_open = true,
128151
},
152+
update_focused_file = {
153+
enable = false,
154+
update_cwd = false,
155+
ignore_list = {},
156+
},
157+
ignore_ft_on_setup = {},
158+
system_open = {
159+
cmd = nil,
160+
args = {},
161+
},
129162
diagnostics = {
130163
enable = false,
164+
show_on_dirs = false,
131165
icons = {
132166
hint = "",
133167
info = "",
134168
warning = "",
135169
error = "",
136-
}
137-
},
138-
update_focused_file = {
139-
enable = false,
140-
update_cwd = false,
141-
ignore_list = {}
142-
},
143-
system_open = {
144-
cmd = nil,
145-
args = {}
170+
},
146171
},
147172
filters = {
148173
dotfiles = false,
149-
custom = {}
174+
custom = {},
175+
exclude = {},
150176
},
151177
git = {
152178
enable = true,
153179
ignore = true,
154-
timeout = 500,
155-
},
156-
view = {
157-
width = 30,
158-
height = 30,
159-
hide_root_folder = false,
160-
side = 'left',
161-
preserve_window_proportions = false,
162-
mappings = {
163-
custom_only = false,
164-
list = {}
165-
},
166-
number = false,
167-
relativenumber = false,
168-
signcolumn = "yes"
169-
},
170-
trash = {
171-
cmd = "trash",
172-
require_confirm = true
180+
timeout = 400,
173181
},
174182
actions = {
175183
change_dir = {
@@ -183,11 +191,15 @@ require'nvim-tree'.setup {
183191
enable = true,
184192
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
185193
exclude = {
186-
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },
187-
buftype = { "nofile", "terminal", "help", },
188-
}
189-
}
190-
}
194+
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
195+
buftype = { "nofile", "terminal", "help" },
196+
},
197+
},
198+
},
199+
},
200+
trash = {
201+
cmd = "trash",
202+
require_confirm = true,
191203
},
192204
log = {
193205
enable = false,
@@ -198,6 +210,7 @@ require'nvim-tree'.setup {
198210
git = false,
199211
},
200212
},
213+
[//]: <> (END_DEFAULT_OPTS)
201214
}
202215
```
203216

0 commit comments

Comments
 (0)