Skip to content

Eliminate Paste Mode #43

Description

@ryneeverett

I'm sure there's a history behind it and a good rationale for initially adding it, but is there any possibility of getting rid of it? I'd prefer to not have to choose between clipboard access and "returning".

Activity

  1. jonathanslenders commented on May 22, 2015

    @jonathanslenders
    Member

    Hi @ryneeverett

    How would you distinguish between a user pasting text and a user typing text? As far as i know from the application's point of view there is no difference.
    It's like Vi also has a :set paste option.

    In paste mode, automatic indentation is off. This will paste verbatim and not insert additional spaces.

    Jonathan

  2. ryneeverett commented on May 22, 2015

    @ryneeverett
    Author

    @jonathanslenders Got it. I understand why it is currently needed. But couldn't we bind y, p, etc. to clipboard operations?

  3. jonathanslenders commented on May 31, 2015

    @jonathanslenders
    Member

    That could be possible, but system clipboard synchronisation is hard to do correctly without using libraries like gtk or qt. I prefer to not depend on this for now.

  4. ryneeverett commented on Jun 14, 2015

    @ryneeverett
    Author

    @jonathanslenders Have you seen pyperclip? It's cross platform, lean (~200 loc), and appears to depend on any one of xclip, xsel, gtk, or qt on Linux. Would you be open to adding pyperclip as a dependency?

  5. jonathanslenders commented on Jun 16, 2015

    @jonathanslenders
    Member

    Yes, I have seen that. I'm not going to add another dependency, but I'll try to create an example of how to create an extension using this clipboard.

    You can pass in any clipboard object in prompt-toolkit: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/application.py#L49 I'll try to update ptpython, so that you can pass that through.

  6. shanechin commented on Jul 26, 2015

    @shanechin

    Is it possible to add this in via some configuration? or would it require a fork as of today?

  7. jonathanslenders commented on Jul 30, 2015

    @jonathanslenders
    Member

    This is work in progress. I'm going to make this easier.

    A PyperclipClipboard is already in prompt-toolkit: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/examples/system-clipboard-integration.py

  8. ryneeverett commented on Aug 2, 2015

    @ryneeverett
    Author

    Sweet! The example implementation looks pretty good.

    It doesn't appear that there is any way to override the clipboard without forking ptpython so I'm assuming such a mechanism is forthcoming.

  9. added a commit that references this issue on Dec 3, 2015
    3bf8958
  10. ryneeverett commented on Dec 3, 2015

    @ryneeverett
    Author

    A tip for my fellow vi users: repl.enable_open_in_editor = False.

  11. added a commit that references this issue on Dec 15, 2016
    21ca02f
  12. mixmastamyk commented on Oct 31, 2017

    @mixmastamyk

    Wouldn't bracketed paste be useful here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions