Skip to content
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

How to show hidden files in file tree #631

Closed
eagle-tex opened this issue Jun 12, 2022 · 9 comments
Closed

How to show hidden files in file tree #631

eagle-tex opened this issue Jun 12, 2022 · 9 comments
Labels
question Further information is requested

Comments

@eagle-tex
Copy link

I'm having trouble finding how to show hidden files or folders in the file tree.

What file(s), which option(s) should I edit and what should I change to be able to see files such as .prettierrc, .gitignore, .eslintrc, etc.

What about folders? (.git for example). Can I show hidden files without showing hidden folders?

@eagle-tex eagle-tex added the question Further information is requested label Jun 12, 2022
@eagle-tex
Copy link
Author

I think I found the answer
I changed the "hide_dotfiles = true" line to "hide_dotfiles = false" in the ~/.config/nvim/lua/neo-tree.lua file.
It was line 41 in my file.

    filesystem = {
      filtered_items = {
        visible = false,
        hide_dotfiles = false,                       **// <-- THIS LINE**
        hide_gitignored = false,
        hide_by_name = {
          ".DS_Store",
          "thumbs.db",
          "node_modules",
          "__pycache__",
        },
      },

@mehalter
Copy link
Member

That is the best option to change. You will want to change this in your user/ folder in your user configuration so that you do not break receiving updates. All changes to the config should be in the user/ folder and not in the base files.

@mehalter
Copy link
Member

Also the binding I'm neo-tree is H for toggling hidden files. Which can be used whenever you want if you prefer them being hidden most of the time until you need to access them.

@eagle-tex
Copy link
Author

My bad.
Thanks for your reply.
I guess I should just revert the changes in the file I changed (nvim/lua/neo-tree.lua) and change just that line in the user/init.lua

@mehalter
Copy link
Member

No problem, here's an example user/init.lua with the change:

return {
  plugins = {
    ["neo-tree"] = {
      hide_dotfiles = false,
    }
  }
}

@eagle-tex
Copy link
Author

eagle-tex commented Jun 12, 2022

I've seen that return pattern in many places in the documentation and I don't understand it.
I guess it doesn't mean I should delete everything in the file and place the snippet in the file.
I don't know where to put that return statement in the file.
My user/init.lua is one big object (236 lines long). It looks like this

local config = {
-- Configure AstroNvim updates
  updater = {
    ...
  }
  many other lines
}

return config

Where do I put the return snippet, please?

@mehalter
Copy link
Member

The return snippet is the same as

local config = { ... }
return config

You would just add those sections to the object. Your config should all be captured in that single object. Each code snippet in the documentation is a complete user/init.lua file with the minimal additions to that object that are necessary.

@eagle-tex
Copy link
Author

eagle-tex commented Jun 12, 2022

I think I'm starting to undersand.
When I added the snippet you gave me earlier, it did not work.

return {
  plugins = {
    ["neo-tree"] = {
      hide_dotfiles = false,
    }
  }
}

After more than an hour of twisting my hair, I changed it to (template from the ~/.config/nvim/lua/configs/neo-tree.lua):

return {
  plugins = {
    ["neo-tree"] = {
      filesystem = {
        filtered_items = {
          hide_dotfiles = false,
        }
      }
    }
  }
}

And this one worked.

@eagle-tex
Copy link
Author

eagle-tex commented Jun 12, 2022

Anyway, thanks a lot for your time and your great work, sir.
Very much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants