Skip to content

#1050 #1068 various default options tweaks #1074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 12 additions & 84 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,108 +63,36 @@ body:
value: |
vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = '/tmp/nvt-min/site/pack'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stylua

local install_path = package_root .. '/packer/start/packer.nvim'
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require('packer').startup {
require("packer").startup {
{
'wbthomason/packer.nvim',
'kyazdani42/nvim-tree.lua',
'kyazdani42/nvim-web-devicons',
"wbthomason/packer.nvim",
"kyazdani42/nvim-tree.lua",
"kyazdani42/nvim-web-devicons",
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
},
config = {
package_root = package_root,
compile_path = install_path .. '/plugin/packer_compiled.lua',
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
}
end
if vim.fn.isdirectory(install_path) == 0 then
print("Installing nvim-tree and dependencies.")
vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
print "Installing nvim-tree and dependencies."
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require('packer').sync()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
vim.g.nvim_tree_indent_markers = 0
vim.g.nvim_tree_git_hl = 0
vim.g.nvim_tree_highlight_opened_files = 0
vim.g.nvim_tree_root_folder_modifier = ':~'
vim.g.nvim_tree_add_trailing = 0
vim.g.nvim_tree_group_empty = 0
vim.g.nvim_tree_icon_padding = ' '
vim.g.nvim_tree_symlink_arrow = ' ➛ '
vim.g.nvim_tree_respect_buf_cwd = 0
vim.g.nvim_tree_create_in_closed_folder = 0
vim.g.nvim_tree_special_files = { ["Cargo.toml"] = true, Makefile = true, ["README.md"] = true, ["readme.md"] = true, }
vim.g.nvim_tree_show_icons = { git = 1, folders = 1, files = 1, folder_arrows = 1 }
require'nvim-tree'.setup {
auto_close = false,
auto_reload_on_write = true,
disable_netrw = false,
hide_root_folder = false,
hijack_cursor = false,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
ignore_buffer_on_setup = false,
open_on_setup = false,
open_on_tab = false,
sort_by = "name",
update_cwd = false,
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {}
},
ignore_ft_on_setup = {},
system_open = {
cmd = nil,
args = {}
},
diagnostics = {
enable = false,
show_on_dirs = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
}
},
filters = {
dotfiles = false,
custom = {},
exclude = {}
},
git = {
enable = true,
ignore = true,
timeout = 400,
},
actions = {
change_dir = {
enable = true,
global = false,
},
open_file = {
quit_on_open = false,
resize_window = false,
window_picker = {
enable = true,
}
}
},
}
require("nvim-tree").setup {}
end
validations:
required: true
Expand Down
105 changes: 59 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,68 +108,76 @@ highlight NvimTreeFolderIcon guibg=blue
```lua
-- init.lua

-- following options are the default
-- empty setup using defaults: add your own options
Copy link
Member Author

@alex-courtis alex-courtis Mar 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have been very useful for me when starting out with nvim-tree.

I thought you had to specify all the options 🤦

require'nvim-tree'.setup {
}

-- OR

-- setup with all defaults
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
require'nvim-tree'.setup {
disable_netrw = false,
hijack_netrw = true,
open_on_setup = false,
ignore_buffer_on_setup = false,
ignore_ft_on_setup = {},
auto_close = false,
[//]: <> (BEGIN_DEFAULT_OPTS)
auto_close = false,
auto_reload_on_write = true,
open_on_tab = false,
hijack_cursor = false,
update_cwd = false,
disable_netrw = false,
hide_root_folder = false,
hijack_cursor = false,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
hijack_directories = {
ignore_buffer_on_setup = false,
open_on_setup = false,
open_on_tab = false,
sort_by = "name",
update_cwd = false,
view = {
width = 30,
height = 30,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
mappings = {
custom_only = false,
list = {
-- user mappings go here
},
},
},
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {},
},
ignore_ft_on_setup = {},
system_open = {
cmd = nil,
args = {},
},
diagnostics = {
enable = false,
show_on_dirs = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
}
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {}
},
system_open = {
cmd = nil,
args = {}
},
},
filters = {
dotfiles = false,
custom = {}
custom = {},
exclude = {},
},
git = {
enable = true,
ignore = true,
timeout = 500,
},
view = {
width = 30,
height = 30,
hide_root_folder = false,
side = 'left',
preserve_window_proportions = false,
mappings = {
custom_only = false,
list = {}
},
number = false,
relativenumber = false,
signcolumn = "yes"
},
trash = {
cmd = "trash",
require_confirm = true
timeout = 400,
},
actions = {
change_dir = {
Expand All @@ -183,11 +191,15 @@ require'nvim-tree'.setup {
enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },
buftype = { "nofile", "terminal", "help", },
}
}
}
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" },
},
},
},
},
trash = {
cmd = "trash",
require_confirm = true,
},
log = {
enable = false,
Expand All @@ -198,6 +210,7 @@ require'nvim-tree'.setup {
git = false,
},
},
[//]: <> (END_DEFAULT_OPTS)
}
```

Expand Down
Loading