emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.33k stars 282 forks source link

[Feature] Support `defclass` for evil motions #1925

Open krshrimali opened 1 month ago

krshrimali commented 1 month ago

Issue type

Pitch

Given that we have evil motions for going backwards (for defun: evil-backward-section-end) and forward for defun, it would be helpful to have the same for defclass as well. This would ideally make it easier to have a keymap to go back to previous/next class directly instead of moving between functions.

Going through the code-base, I didn't find functions that would support defclass like they do for defun (like beginning-of-defun, end-of-defun). Please point out if I missed anything here.

Environment

Emacs version: 29.4 Operating System: Endeavour OS Evil version: 1.15.0 Evil installation type: MELPA Graphical/Terminal: Terminal (/both)

Further notes

Happy to discuss this forward and any thoughts on implementations (can help with a PR if necessary).

Was just curious, was there any reasoning to not support motions for defclass? Maybe I'm missing some context here.

tomdl89 commented 1 month ago

@krshrimali can you give an example of a defclass that would be incorrectly navigated with the motions evil supplies?

also,

was there any reasoning to not support motions for defclass?

Evil primarily emulates vim functionality. As this is not functionality in vim, it would have to be a common emacs-specific need to be addressed. And defuns are much more commonly used than defclasses. For example, evil has zero usages.