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
add variable to customize behavior of the magic slash on non-existing directories #998
add variable to customize behavior of the magic slash on non-existing directories #998
Conversation
I don't see the need to disable the feature altogether. You can turn off just the 5th You can even add more magic: the slash could create a directory if it doesn't exist. |
Is it possible to prompt the user from the ivy minibuffer? I.e. if a user were to enter If we could do that, then I would be in favor of the magic solution. However, I don't think it'd be a great idea to create directories behind the scenes if a slash is added. If that is the case I'll just add a configuration to prevent the magic slash functionality on non-matches (case 5). |
60c50a7
to
a5dd8c1
Compare
@abo-abo I've updated this pull request to allow the magic slash behavior to be customized when added to the end of a non-existing directory. I've added the variable:
The setting defaults to the current behavior ( Also, tried out adding a y/n prompt on creating the directory, but it resulted in a pretty poor user experience. The auto creation of directories works out pretty nicely. Thanks! |
Thanks, looks good. For changes over 15 lines you need an Emacs Copyright Assignment. If you want to get it, see README.org for more info. |
Cool, I'll get that done asap |
I've completed the copyright assignment ... you can find a copy of it here: http://drop.bryan.codes/Gilbert.1162228.EMACS.pdf Thanks! |
Thanks. |
think there's a small naming bug: #1009 |
Added variable
ivy-magic-slash
that controls whether or not the 'magic slash' is applied when selecting files. If non-nil (default) the magic slash will be applied, if set to nil then the magic slash will not be applied.The personal pain point this solved for me is creating files in non-existing directories. As an example, with the 'magic-slash' enabled I found it impossible to create
~/docs/todo.org
when the folder~/docs
did not exist and the folder~/Documents
did exist. Adding the/
afterdocs
resulted inivy--cd
being called with theDocuments
directory.