-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Is there any way to add an expanded macro to a map? #586
Comments
There might be a way, but have you seen
to get the desired behaviour. |
I didn't know the Nevertheless, I think a syntax to expand macros explicitily would be useful to build commands and let the user edit them before pressing Enter. |
In Vim one does this via expression register, I guess the same is needed here. Would look like: :nnoremap C :cd <c-r>=expand('%d:p')<cr> |
2020-09-11 09:56: xaizek escribió/skribis/wrote/scrit:
In Vim one does this via expression register, I guess the same is
needed here. Would look like:
```vim
:nnoremap C :cd <c-r>=expand('%d:p')<cr>
```
Yes, it would be great to do it exactly like Vim. I didn't remember that
Vim function.
…--
Marcos Cruz
http://programandala.net
|
Added expression register in 5ecaeaa, so the mapping above will work in the next release. Not sure why I didn't mention this way of doing it earlier: nnoremap C :cd <c-x><c-x>d |
I'd like to define a map to go to a variant of the current directory, edited by the user. Such a map is useful when you need to go to another branch of a parallel identical hierarchy, e.g. from </path/to/AAA/0/1/2/3/4/5/> to </path/to/BBB/0/1/2/3/4/5/>. In those cases it's faster to edit the current path than to navigate all the way up and down.
Say I need the following map, but forcing
%d:p
to be expanded before building the command, in order to let the path be edited by the user:I've read the documentation about macros, but found no way to expand a macro that way.
The text was updated successfully, but these errors were encountered: