-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
term: Add % expansion for relative path to current file #7090
Conversation
This is especially useful for creating a file next to the current one, and is inspired by vim's expansions (but only handles the basic case of course).
See #6979 |
hm. I'm not sure these should be related. Maybe
|
In this PR the % char will be added as a register which allows to paste the current filename quickly: #6985 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we need yet another way to expand to.the current file. Instead we could add %val{filename}
(and all the other possible placeholders) to the list of completions. This automatically teaches users about the syntax without adding anything new. You couls rebase this PR on #6979 and implement that
How would this be done and how would it work? If the placeholders themselves would appear in completions, that would be useless for me. My desired workflow is exactly as in the screencast, that is I need to be able to type The editing is the point. I'm surprised this wasn't a feature from the beginning. How do y'all currently create files in some nested hierarchy similar to the one of the current file? I'm tired of copy-pasting the path with the mouse from the status bar! |
It's literally not a duplicate @kirawi, it's a different approach for a different place. I guess using the register isn't the worst considering that there apparently is a keybinding in prompts to paste from a register, but right now that But also I really want to specifically exactly press |
This is especially useful for creating a file next to the current one, and is inspired by vim's expansions (but only handles the basic case of course).
I've been missing this from nvim (kakoune too iirc??) ever since I switched, finally got frustrated enough to just implement it :)