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

evil-forward-word-begin doesn't work with superword-mode #721

Open
TheBB opened this issue Oct 19, 2016 · 3 comments
Open

evil-forward-word-begin doesn't work with superword-mode #721

TheBB opened this issue Oct 19, 2016 · 3 comments

Comments

@TheBB
Copy link
Member

TheBB commented Oct 19, 2016

Originally reported by: arianaut (Bitbucket: arianaut, GitHub: Unknown)


superword-mode, which ships with Emacs, changes symbol characters like underscore into word characters (so forward-word, backward-word skip over them).

However, evil-forward-word-begin behaves erratically on words containing underscores when superword-mode is enabled.


@modulitos
Copy link

I am experiencing this issue as well.

If it helps, I found that disabling superword-mode and using this workaround helps: https://emacs.stackexchange.com/a/27350/2676

;; For python
(add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
;; For ruby
(add-hook 'ruby-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
;; For Javascript
(add-hook 'js2-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))

which allows evil-mode to consider _ as part of the word. It's not a great solution, but it somewhat mimics superword-mode

@johanatan
Copy link

That workaround actually does not work. If a line contains "_" near its end (in combination with a handful of other symbols or by itself), the cursor will still get stuck there.

@jleonard-r7
Copy link

Hi, has there been any progress on this issue? It is also affecting me.

AjaiKN added a commit to AjaiKN/evil that referenced this issue Aug 27, 2024
Since superword-mode makes forward-word behave like forward-symbol, it
seems reasonable to make forward-evil-word behave like
forward-evil-symbol when superword-mode is on.

Fix emacs-evil#721
Fix emacs-evil#728
Fix emacs-evil#1492
AjaiKN added a commit to AjaiKN/evil that referenced this issue Aug 27, 2024
Since superword-mode makes forward-word behave like forward-symbol, it
seems reasonable to make forward-evil-word behave like
forward-evil-symbol when superword-mode is on.

Fix emacs-evil#721
Fix emacs-evil#728
Fix emacs-evil#1492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants