7 Nov
2011
7 Nov
'11
11:08 a.m.
On 2011-11-01 14:31 +0100, Nikolai Weibull wrote:
I was thinking that it would be nice to, for example, be able to type gqac and have the current comment be formatted.
As it happens, Evil defines the functions `evil-comment-beginning' and `evil-comment-end' for finding the beginning and end of a comment block. Thus, creating a text object for comments is straightforward: (evil-define-text-object evil-a-comment () "Select a comment." (list (evil-comment-beginning) (evil-comment-end))) (define-key evil-outer-text-objects-map "c" 'evil-a-comment) Please pull the latest commits before using this, because of some recent bugfixes. -- Vegard