3 ms·
Emacs has a nice package called expand-region[1] which works in a similar, although more context-sensitive fashion. There's a nice intro screencast by Emacs Roc
by shabble 14y ago
Emacs has a nice package called expand-region[1] which works in a similar, although more context-sensitive fashion. There's a nice intro screencast by Emacs Rocks[2] as well.
The context-sensitivity is handled by having a list of expansion/contraction functions to try in sequence, so your region grows outwards by different units. Or you can specify a specific expansion function (like, er/mark-outside-python-string) upfront.
As an example, the expand function list I have for a python buffer open is:
(er/mark-word
er/mark-symbol
er/mark-symbol-with-prefix
er/mark-next-accessor
er/mark-method-call
er/mark-inside-pairs
er/mark-outside-pairs
er/mark-comment
er/mark-inside-python-string
er/mark-outside-python-string
er/mark-python-statement
er/mark-python-block
er/mark-python-block-and-decorator
er/mark-outer-python-block)
[1] https://github.com/magnars/expand-region.el https://github.com/magnars/expand-region.el or from ELPA
[2] http://emacsrocks.com/e09.html http://emacsrocks.com/e09.html
- frou_dh 14y agoVery cool.