Skip to content

feature: Configuring individual keybinds #117

@mjhika

Description

@mjhika

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

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