Closed 80aff123-9163-4f3e-a93d-4a2f35af9be1 closed 4 years ago
I expected it to work as well but ended up needing a more verbose approach to make it work:
vis:command( 'map! normal <Space>p <vis-register>*p' )
maybe someone else can explain why the alternative doesn't.
Try to use vis:map
instead. Also i think *
has changed to +
for system clipboard ( *
is now primary clipboard ).
Try this:
vis:map(vis.modes.NORMAL, ' p', '"+p')
"copy from" = paste to :)
@3dc1d3 @erf
thank you! that worked :)
Hi, the map
command takes 3 arguments and argument splitting is performed on single and double quotes, a backslash is used as escape character.
Also you can't currently use <Space>
but have to use a literal space
.
Meaning the following should work interactively:
map! normal ' p' \"*p
map! normal " p" \"*p
If you want to do the same through the Lua API then you have to take its rules for string quoting into account:
vis:command([[map! normal " p" \"*p]])
As was already shown, vis:map
lets you specify the arguments individually.
Hi,
I'm trying to bind to a shortcut the following command:
I want space + p to copy from my system clipboard. Do I have an error in my code?
Any help is greatly appreciated.
- Carla