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

Vi lisp word separators #1159

Merged
merged 3 commits into from
Nov 18, 2023

Conversation

ilya-fiveisky
Copy link
Contributor

@ilya-fiveisky ilya-fiveisky commented Nov 15, 2023

Motivation.

For word

In Lisp, characters /, ., :, and - syntactically can be part of a symbol or package name but semantically they are separators because typical symbol name is a phrase consisting of several words separated by - like some-symbol-name and package name looks like some-package/some-subpackage.
It would be natural to expect vi motion commands to take this into account.

For WORD

In Lisp code like (qwer [a]sdf-uiop) or "qwer [a]sdf", where [] is a cursor position, nobody would expect commands like DE to create unbalanced parentheses or double quotes.

Implementation

Implemented via specializing iskeyword and isseparator options initialization on option names and syntax tables. For Lisp syntax table characters /, ., :, and - are removed from iskeyword option and characters (, ) and " are added to isseparator option.

@fukamachi
Copy link
Collaborator

LGTM, thanks!

@fukamachi fukamachi merged commit 1c0db48 into lem-project:main Nov 18, 2023
1 check failed
@ilya-fiveisky ilya-fiveisky deleted the vi-lisp-word-separators branch November 18, 2023 22:58
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

Successfully merging this pull request may close these issues.

2 participants