Bug 273386 - vi mode: Make binding 'dd' or 'y' (delete / yank) copy to the global clipboard
Summary: vi mode: Make binding 'dd' or 'y' (delete / yank) copy to the global clipboard
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 06:23 UTC by Shaun Reich
Modified: 2013-12-02 18:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shaun Reich 2011-05-16 06:23:14 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Hello,

I would absolutely love it if the Vim bindings would use the clipboard. This way I could easily type in '5dd' and it would cut 5 lines of text into e.g. Klipper, to which I could paste somewhere else..notably another Kate/KDevelop instance.

Thanks.

Reproducible: Didn't try
Comment 1 Erlend Hamberg 2011-05-16 09:28:22 UTC
Hey, Shaun.

Thanks for your suggestion.

First of all: as you might know, you can yank to the ‘+’ register to put things in the clipboard (i.e. "+yy, "+5dd, etc.).

However, I think it would be a good idea to copy text to the clipboard every time a user copies (“yanks”) or cuts something – and this is the line with the goal of the Kate Vi Mode which is to bring Vi[m]-like editing to Kate but compromise on Vim compatibility where it makes sense to do so for a modern, GUI, text editor.

So, this raises a few questions.

1) Should it always be done? Even when deleting one character (“x”)?
2) Only when not specifying a register? (When it would go to the default
   register (").
3) Should it be configurable?

I personally feel like it should be copied to the clipboard when no register is
specified – i.e. when it goes into the default register ". And I’m not really
sure if it needs to be configurable.

Also, does it also go into X selection clipboard (the “middle mouse button”
clipboard)? In “regular” Kate one usually (always?) selects text before
copying/cutting it, so there clipboard == selection clipboard after copying
something.

Opinions are welcome. :-)
Comment 2 Shaun Reich 2011-05-16 19:51:18 UTC
1.) I  think it should always be done, except when it's 1 char. I doubt there is anything of importance which is one character, which is important enough to warrant pushing to the clipboard.

2.) Yeah, that sounds good.

3.) Configurability could perhaps come later if -absolutely- necessary and if it proves to be an issue. I doubt such a case would occur, but it's something to keep in mind later on. Again, not something to worry about right now.

Hm, not sure on the X selection clipboard. I think it should just push to the standard clipboard...because, think about it, you are explicitly going to paste something, and the idea is using 'p' for it. But that just fits my workflow more, honestly. The only times I use the selection cb is when I am trying to quickly select something and paste it without having to mount the keyboard.

But that's just my .5 cents..
Comment 3 Dominik Haumann 2011-08-12 09:58:04 UTC
Erlend, what's the state of this?
Comment 4 Fabian 2013-03-23 21:53:17 UTC
Git commit 081817ead7e893825646332efd64f0df93e3cf57 by Fabian Kosmale.
Committed on 15/03/2013 at 23:54.
Pushed by fabiank into branch 'master'.

put yanked/deleted text automatically into the clipboard if no
register is specified

REVIEW: 109512

M  +12   -2    part/vimode/katevimodebase.cpp
M  +1    -0    part/vimode/katevimodebase.h
M  +9    -3    part/vimode/katevinormalmode.cpp

http://commits.kde.org/kate/081817ead7e893825646332efd64f0df93e3cf57
Comment 5 Michal Humpula 2013-12-02 18:19:06 UTC
This should be fixed by the commit mentioned above, so closing.