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

Plugins: vi-mode: extra vi-like bindings, vi-like commands clipboard #3616

Closed
wants to merge 4 commits into from

Conversation

alx741
Copy link
Contributor

@alx741 alx741 commented Feb 20, 2015

  • Added standard ctrl-r for incremental history searching
  • Added G gg u ^-R vim commands behavior
  • Added X clipboard interaction with standard vim commands ( y/p/d/c )
  • From zsh wiki vim bindings [examples|suggestions?]

Added the standard behaviour of ctrl-r for history incremental searching.
- 'gg': go to the beginning of the buffer history
- 'G': go to the end of the buffer history
- 'u': properly undo multiple changes
- '^R: while in normal mode re-do changes
Enable to use vim commands ( y/p/d/c/s ) to interact with the X window
system clipboard, thus with other applications.
@robbyrussell robbyrussell added Area: plugin Issue or PR related to a plugin Status: testers needed Pull Requests that are waiting for testers to merge labels Feb 20, 2015
@regagain
Copy link
Contributor

ctrl-r for history searching & the extra vim-like bindings work well and are much appreciated (I have not tested the copy/paste from the clipboard).

@alx741
Copy link
Contributor Author

alx741 commented Mar 22, 2015

A way copy/paste can be used/tested (that is actually useful) is by copy an URL from the browser and then in the terminal (<ESC> is used to get into normal mode -of course-):

$ wget <ESC>p

Another example for youtube video downloading:

$ youtube-dl <ESC>p

The Copy function can be tested like this:

$ command -i -am <ESC>yy

So we have command -i -am in the clipboard that can be pasted into an external editor or a browser (for Google searching for example)

@regagain
Copy link
Contributor

OK! I've tested it now and it's really cool. One strange thing, though: it seems yy cease to properly update the vi-like buffer once something has been copied from the clipboard.
For example:
ctrl+c from the browser or anything else, then:

$ <ESC>p

results in

$ from_browser

But after this:

$ from_zsh<ESC>yy
$ <ESC>p

still results in

$ from_browser

(but ctrl+v is still working as expected, i.e. gives from_zsh).

@alx741
Copy link
Contributor Author

alx741 commented Mar 22, 2015

Thank you very much for testing,

I didn't notice that, it's strange indeed... I'll check it out!

@giorgio-ops
Copy link

Excellent ... +1

@Alibru
Copy link

Alibru commented Mar 25, 2015

Interesting and useful! +1

@alx741
Copy link
Contributor Author

alx741 commented Mar 29, 2015

@0arthur Added in pull request message

@kingarrrt
Copy link

Daniel,
This is fine.

Cheers,
Arthur

On Sun, Mar 29, 2015 at 16:33 -0700, Daniel Campoverde Carri�n wrote:

@0arthur Added in pull request message, but.. do you mean inside the file?


Reply to this email directly or view it on GitHub:
#3616 (comment)

Arthur Noel
arthur@0compute.net
+44 (0)7967 385514

@regagain
Copy link
Contributor

Hello there!

I've been using this for almost two months now, and find it useful & reliable. Can we please merge it?

Thanks,

@rosshadden
Copy link

The X clipboard functionality should be broken out into a separate merge request, so as not to prevent this one from being merged. There are many things that need to be discussed and ironed out.

For instance, it is unexpected that y, p, d, c would alter the system clipboard. For one thing this adds an xclip dependency, but more importantly that's just not how vim itself works. When you use these operations in vim, it uses the internal register just like zsh's vi-mode does natively. To get X integration you tell it to use the " register (for example). Having vim use the system clipboard for all change/delete operations does not sound like a good idea, as you would be unnecessarily polluting the clipboard.

Now that being said, it would be very useful to make vicmd commands that yank/put with the system clipboard, which users could bind themselves, or this project could bind to a different set of keys.

@mcornella mcornella added the Topic: bindkey Pull Request or issue regarding keyboard shortcuts label Dec 13, 2015
@afwlehmann
Copy link

The latest changes seem to have happened quite some time ago. Since I'm very much interested in vim-like copy/paste functionality, may I ask whether there's any progress or related solution?

@mcornella mcornella added the Status: conflicts Pull Request that has conflicts with the master branch label Mar 24, 2019
@felipe-vieira0
Copy link

@alx741 ,

Unfortunately, this is interfering with navigation (the up and down keys do not search correctly anymore). I would love to see this implemented.

Thanks!

@alx741
Copy link
Contributor Author

alx741 commented Aug 19, 2020

@felipe-vieira0 yeah... I suppose at this point its impossible to make it work without pretty much re-implementing it, I stopped using oh-my-zh years ago though and went with just a personal .zshrc for improved performance. So I guess there will not be further progress from my side on this... sorry about that.

@mcornella mcornella closed this Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin Status: conflicts Pull Request that has conflicts with the master branch Status: testers needed Pull Requests that are waiting for testers to merge Topic: bindkey Pull Request or issue regarding keyboard shortcuts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants