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

feature: Configuring individual keybinds #117

Open
mjhika opened this issue Nov 10, 2024 · 0 comments
Open

feature: Configuring individual keybinds #117

mjhika opened this issue Nov 10, 2024 · 0 comments

Comments

@mjhika
Copy link

mjhika commented Nov 10, 2024

First off, thanks for publishing this great plugin. It makes working with these lisps so much easier with Vim bindings.

Problem

Standard Vim keybindings use some of the changed keys as a prefix. Since the project will rebind those Vim defaults like <, >, [ and ] the new bindings are conflicting and a forced and inconvenient change. Right now the configurations either allow you to disable the feature all together or use the defaults.

I just started using evil-clevarparens. I really have enjoyed the simplicity and most of the opinions. But the following claim for the project is a bit inconsistent when there is no easy way to disable or change specific unwanted keybindings.

3. Provide but don't force additional features on the user.

Solution

One possibility could be just checking if the alist was already defined before defining that default alist thus requiring the user to configure that individual feature's key map.

Workaround

  1. Remove the key from the alist
  2. Add-to-list the new binding or nil
  3. run the setup function again

as an example:

(use-package evil-cleverparens
  :config
  ;; rebind <, >
  (rassq-delete-all 'evil-cp-> evil-cp-regular-bindings)
  (rassq-delete-all 'evil-cp-< evil-cp-regular-bindings)
  (add-to-list #'evil-cp-regular-bindings '("<" . evil-shift-left))
  (add-to-list #'evil-cp-regular-bindings '(">" . evil-shift-right))
:hook ...)

This gets unwieldy after changing several keys, but hopefully this could help another beginner like myself.

Related Issues:

#39
#61

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

1 participant