The only way i know to make NeoTree show hidden files is to use neotree-hidden-file-toggle
, but this is meant to be used interactively when the NeoTree buffer is the active buffer. Is there a way to globally set in my .emacs
init file to make NeoTree always have the behavior of showing hidden files?
1 Answer
Found here: https://github.com/jaypei/emacs-neotree/issues/117#issuecomment-126751086
add (setq-default neo-show-hidden-files t)
to your init.el.
Just in case you use Spacemacs:
add '(neo-show-hidden-files t)
in custom-set-variables
of your .spacemacs file.
-
1When a variable is global (like
neo-show-hidden-files
),setq
is sufficient.setq-default
is generally used for things likebuffer-local
variables where a user wishes to start with a particular default value which may or may not be set differently in certain buffers. Usingsetq-default
in an answer leads the reader to believe that the variable isbuffer-local
, which is not the case here.– lawlistMay 25, 2017 at 18:27 -
@lawlist Thank you rounding out the answer. However, I actually do want to be able to set this differently in different NeoTree buffers, so only setting the initial default buffer behavior is correct. Thus the answer is best suited to my needs, even though my question doesn't indicate the need for such flexibility.– eestradaMay 27, 2017 at 16:55
-
1@eestrada -- Making a global variable capable of buffer local settings is normally achieved by adding
(make-variable-buffer-local 'neo-show-hidden-files)
and then it can be set locally in any buffer usingsetq
. However, it is possible to usesetq-local
to make a global variable local in a current buffer. There are a few other methods to take a global variable and use it locally ...– lawlistMay 27, 2017 at 17:04 -
1Shouldn't the instructions for spacemacs say the same thing, that is to use
t
instead ofnil
? Oct 13, 2020 at 5:43 -
@JurajMartinka you are correct. I don't know what i was thinking back then. I updated the answer. Thanks! Oct 13, 2020 at 14:45