Skip to content

The pyenv keybinds conflict with magit/org #35

Open

Description

@hjpotter92

The key binding for C-c C-s is bound to git-commit-signoff when editing a commit message in magit, however, if we're working in a python project, the same gets overwritten by pyenv mode.

Activity

  1. CeleritasCelery commented on Dec 30, 2020

    @CeleritasCelery
    Contributor

    You can bind it to something else with

    (setq pyenv-mode-map
      (let ((map (make-sparse-keymap)))
        (define-key map (kbd "C-c C-m") 'pyenv-mode-set)
        (define-key map (kbd "C-c C-u") 'pyenv-mode-unset)
        map))
  2. hjpotter92 commented on Dec 31, 2020

    @hjpotter92
    Author

    My issue is with pyenv-mode overriding keybinds for other major modes, when it is set as a hook for python-mode only.

  3. CeleritasCelery commented on Jan 1, 2021

    @CeleritasCelery
    Contributor

    It is actually a global minor mode, which is why you are seeing the conflict.

  4. grauschnabel commented on Feb 10, 2021

    @grauschnabel

    It would be great to make it only enable with python-mode and not global. It is also conflicting with org-schedule (C-c C-s) - and when I'm inside org, I'm not at all working on any python project - no need of pyenv, but projectile is on. So can we use it as python-mode hook too?

  5. changed the title [-]The pyenv keybinds conflict with magit's commit sign-off[/-] [+]The pyenv keybinds conflict with magit/org[/+] on Feb 10, 2021
  6. CeleritasCelery commented on Feb 10, 2021

    @CeleritasCelery
    Contributor

    It looks like #31 was submitted to do exactly that.

  7. wenzlawski commented on Jan 27, 2024

    @wenzlawski

    For anyone still annoyed by the overriding of keys, a workaround I've found is to delete the keymap of pyenv-mode-map and rebind the commands in the python-mode-map. One obvious downside to this is having the keys mapped permanently, whether in pyenv-mode or not, but since I use it pretty much all the time it works for me.

    (use-package pyenv-mode
      :init
      (setq pyenv-mode-map
    	(let ((map (make-sparse-keymap)))
    	  map))
      :hook python-ts-mode python-mode
      :bind
      (:map python-ts-mode-map
    	("C-c C-s" . pyenv-mode-set)
    	("C-c C-u" . pyenv-mode-unset)))
  8. CeleritasCelery commented on Jan 29, 2024

    @CeleritasCelery
    Contributor

    I don't use pyenv-mode so I can't answer this myself, but would making this mode buffer local be the right solution? If so, we can do that.

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