Skip to content

Enhance filters.exclude For More Granularity #1146

Closed
@sarmong

Description

@sarmong

Description

I have the following line

  filters = {
    dotfiles = true,
    exclude = { ".config", ".local" },
  },

And now gitignore files are always shown, and using I to toggle them doesn't work.

If I remove the line with exclude, all works fine.

Neovim version

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Operating system and version

Arch Linux , kernel - 5.17.1-arch1-1

nvim-tree version

commit 618ea25

Steps to reproduce

  1. Create a folder with .gitignore and a couple of files
  2. Gitignore file1
  3. nvim -nu /tmp/nvt-min.lua
  4. :NvimTreeToggle
  5. Observe the gitignored file being show
  6. Press I - gitignored file still shown

Expected behavior

  1. Gitignored files are not shown by default
  2. Gitignored files are toggled with I

Actual behavior

No response

Minimal config

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvt-min/site]])
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
	require("packer").startup({
		{
			"wbthomason/packer.nvim",
			"kyazdani42/nvim-tree.lua",
			"kyazdani42/nvim-web-devicons",
		},
		config = {
			package_root = package_root,
			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 })
end
load_plugins()
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()
	require("nvim-tree").setup({
		filters = {
			dotfiles = true,
			exclude = { ".config", ".local" },
		},
	})
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions