Closed alanxoc3 closed 5 years ago
Hi, thanks, yep, makes sense, good suggestion :) Though just to check - are you referring to files on unix starting with a period (dot) - or files on DOS with the "Hidden" attribute set? I had a look and the latter looks somewhat harder to deal with than the former!
Yeah. Just Unix. Forget about windows! :smile:
Took a while, but if you're still interested, I just added a first pass as this. Hit Ctrl-T to toggle hidden files (including recursively if multiple levels are displayed with the '>' key). You can also set g:RenamerShowHidden (hmm - which I've not actually tested yet...) to enable hidden files by default. If you try it, please let me know how it goes!
I get an error that b:RenamerShowHiddenEnabled
cannot be found (on windows 10). Shouldn't be
s:RenamerShowHiddenEnabled
in autoload/renamer.vim
?
b:RenamerShowHiddenEnabled
seems also to exist on linux (linux mint 19.1)
Sorry, I didn't reply yet, but cool!!! Both setting the variable and the ctrl-T toggle work fine and as expected as I tested a little bit. Thank you!
EDIT: I don't know what you mean by b:RenamerShowHiddenEnabled
or s:RenamerShowHiddenFileEnabled
, but g:RenamerShowHiddenEnabled
worked fine for me.
@kraxli Thanks for the merge request and bug report - though like alanxoc3, I'm a little confused by the b:RenamerShowHiddenEnabled or s:RenamerShowHiddenFileEnabled thing too. My thought was that it's entirely possible to have two windows or tabs in vim with renamer running in them, and this toggle should be specific to each instance. My understanding was that that means it should be at buffer level (b:) not script level (s:) - because we wouldn't want the two instances sharing the same setting necessarily (besides the default setting, which can be set via g:RenamerShowHidden). The autoload script contains the code:
if !exists('b:RenamerShowHiddenEnabled') if exists('g:RenamerShowHidden') && g:RenamerShowHidden let b:RenamerShowHiddenEnabled = 1 else let b:RenamerShowHiddenEnabled = 0 endif endif
in the start function - which should ensure that b:RenamerShowHiddenEnabled exists. So... as I say, I'm a bit confused! Any further thoughts?
*dammit - shouldn't "Insert code" keep the formatting... maybe it needs both carriage return and new line and I only gave it the latter... second try...
if !exists('b:RenamerShowHiddenEnabled') if exists('g:RenamerShowHidden') && g:RenamerShowHidden let b:RenamerShowHiddenEnabled = 1 else let b:RenamerShowHiddenEnabled = 0 endif endif
ah well - check the renamer/autoload/renamer.vim file yourself, about line 81
I found a bunch of files that were hidden in a directory and I wanted to rename them with vim, but the files didn't show up with ':Ren'... So, it would be nice to show hidden files as well as non-hidden files. Maybe this could be a documented option, but I would argue that it would be fine to make this a default as well (Maybe just putting all hidden files at the end.)