Skip to content
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

Feature request: gp and gP #27

Open
ajitid opened this issue May 4, 2021 · 4 comments
Open

Feature request: gp and gP #27

ajitid opened this issue May 4, 2021 · 4 comments

Comments

@ajitid
Copy link

ajitid commented May 4, 2021

Is it possible to add gp and gP shortcuts to Yoink? These commands in Vim put cursor after the pasted item. Currently doing gp followed by [p (YoinkPostPasteSwapBack) results in "Last action was not paste — swap ignored".

@svermeulen
Copy link
Owner

Ok I've now added new plug bindings for this. Try adding something like this to your vimrc after updating to latest:

nmap gp <plug>(YoinkPaste_gp)
nmap gP <plug>(YoinkPaste_gP)

@ajitid
Copy link
Author

ajitid commented May 4, 2021

@svermeulen swapping works but cursor isn't moved to the end with these mappings when pasted

@svermeulen svermeulen reopened this May 4, 2021
@svermeulen
Copy link
Owner

Seems like it works for me. Can you give me an example ? In my tests, yoink gp behaves the same as default vim gp

@ajitid
Copy link
Author

ajitid commented May 4, 2021

@svermeulen

Animation

  1. Here I yanked word else using yiw then
  2. moved in b/w a b .... c d,
  3. first pasted using p, then
  4. used u to undo, then
  5. again pasted using gp

Here is Vim's gp:

Animation

Also in Yoink swapping after gp behaves like p, it keeps cursor at the start of paste items.

kar9222 pushed a commit to kar9222/vim-yoink that referenced this issue Aug 30, 2021
kar9222 pushed a commit to kar9222/vim-yoink that referenced this issue Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants