Repository navigation
Add Vim-style word boundaries to evil-ghostel - #661
Merged
Merged
Conversation
While evil-ghostel-mode is on, install a syntax table matching Vim's default iskeyword (letters, digits, and underscore are word constituents) so w/b/e/ciw stop at path components instead of treating a whole path as one word. Configurable via the new evil-ghostel-word-boundaries option; nil keeps ghostel's path-aware table. Disabling the mode restores the previously active table. The table is a child of ghostel-mode-syntax-table realized through a ghostel--realize-word-boundaries helper extracted from the core rebuild function, so non-ASCII boundary chars keep inheriting from the core table and live customization propagates to open buffers.
dakra
force-pushed
the
feat/evil-vim-word-boundaries
branch
from
August 30, 2026 22:02
4f5740c to
1206070
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
While
evil-ghostel-modeis on, install a syntax table matching Vim's defaultiskeyword(letters, digits,_are word constituents) sow/b/e/ciwstop at path components (barin~/src/foo/bar.txt) instead of treating the whole path as one word. Disabling the mode restores the previously active table;W/ciWWORD motions are whitespace-based and unaffected.evil-ghostel-word-boundaries(string of boundary characters;nilkeeps ghostel's path-awareghostel-mode-syntax-table). Global-only; livesetopt/customize propagates to open buffers.evil-ghostel-syntax-tableis a child ofghostel-mode-syntax-table: printable ASCII is set explicitly tow/.(preserving the no-paren/quote-syntax invariant that keepsmouse-start-endaway fromforward-sexp), non-ASCII inherits from the core table, so│and other non-ASCII boundaries keep working.ghostel--realize-word-boundaries (table boundary-string)extracted fromghostel--rebuild-mode-syntax-tableand made stateless — non-ASCII entries are reset to inherit before each realize, so a boundary char dropped from the string reverts to its inherited syntax.setqbefore enabling still yields a correct table; install is guarded onghostel-modebuffers.Package-Requiresfloor forghostelbumped to 0.51.0 (the helper is new there).Tradeoff, documented in the option docstring, both READMEs, and the changelog: while the mode is on, double-click selects a path component rather than the whole path, and
ghostel-word-boundary-stringonly governs non-ASCII characters in these buffers.Tests
setqrealization, opt-out, live customization, non-ASCII inheritance) plus a core test for stale non-ASCII cleanup.make test-evil142/142, core word-boundary suite 6/6.test/elate/matrix/shells.json(ciw-path,b-dw-path,ciW-path,opt-out) — PASS on bash/zsh/fish/nu, andciw-path/b-dw-path/opt-outfail onmain, so they discriminate the feature. Newtest/elate/matrix/word-boundaries-ghostel.jsonpins the double-click tradeoff with real mouse events (mode on → component, off → whole path, re-enable → component). Boundary suites on all four shells stay green.