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

Possible solution for inner and outer local objects #302

Open
bigodel opened this issue Jun 7, 2022 · 1 comment
Open

Possible solution for inner and outer local objects #302

bigodel opened this issue Jun 7, 2022 · 1 comment

Comments

@bigodel
Copy link

bigodel commented Jun 7, 2022

on line 2036 there is the following TODO:

lispyville/lispyville.el

Lines 2036 to 2050 in 32d6b1f

;; TODO only define in `lispyville-mode-map'
(evil-define-key nil evil-inner-text-objects-map
"a" #'lispyville-inner-atom
"l" #'lispyville-inner-list
"x" #'lispyville-inner-sexp
"f" #'lispyville-inner-function
"c" #'lispyville-inner-comment
"S" #'lispyville-inner-string)
(evil-define-key nil evil-outer-text-objects-map
"a" #'lispyville-a-atom
"l" #'lispyville-a-list
"x" #'lispyville-a-sexp
"f" #'lispyville-a-function
"c" #'lispyville-a-comment
"S" #'lispyville-a-string))

looking that the documentation for evil-surround i saw that they have a way to define local inner and outer text objects. i haven't been deep into their code, but it seems like lispyville could take a look into it to try and replicate. i opened up the issue in order to keep track of it, and i might tackle it if i manage to get some free time.

@noctuid
Copy link
Owner

noctuid commented Jun 7, 2022

Yes you can do buffer-local but not mode-local text objects. There is an issue somewhere where I evaluated different methods of working around this. The current suggestion in the lispyville readme is to bind in operator/visual state instead of those keymaps. Assuming that works, I think that would be the better solution.

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

2 participants