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

RFE: Better integration with X selections #15

Open
siebenmann opened this issue Aug 16, 2016 · 2 comments
Open

RFE: Better integration with X selections #15

siebenmann opened this issue Aug 16, 2016 · 2 comments

Comments

@siebenmann
Copy link
Contributor

Right now, one of the awkward bits about using sam as an editor in the broader X ecosystem is that it's kind of painful to move text between sam and other X programs. X has a selection system, and sam has a selection system, and you have to <exch> between the two. I think that there are good reasons to keep the two at least somewhat separate, but I also think that it could be easier. My current set of ideas:

  • Add a 'paste from X' operation along side the regular paste, both as a menu item and as, say, shift + chord-23. This would make it much easier to get text in to sam from eg xterm.
  • make sam assert the X selection any time that you cut or snarf something. sam should not discard its own internal buffer if it loses the X selection, but I think it's perfectly sensible to assert the selection when you snarf.

These two changes combined would mostly remove the need to use <exch>, while still keeping the separation between sam's own buffer and the X selection that insures you don't accidentally lose cut or snarf'd data that exists only in sam's buffer.

@RamKromberg
Copy link
Contributor

@siebenmann Behold in horror at xsel ( https://github.com/kfish/xsel ) to understand why is hacked in a way that separates \ avoids ICCCM where possible.

That being said, sam already maintains a command stream and buffer so it should be possible to avoid the multiple entry points by targeting the command language itself.

@m-cz
Copy link

m-cz commented Jun 19, 2017

Just to provide an example:

bind C c command send > xclip -i -selection c
bind C v command send < xclip -o -selection c

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

3 participants