lunes, 6 de febrero de 2012

new emacs mode: expand-region



There's a new mode for emacs that has recently came out. It's called expand-region, and it's probably the nearest we can get to text-objects in emacs. In fact, it's quite interesting that it can be extended for specific major modes.

I had much of the same idea 1 month ago, and tried to implement the same functionality, but failed miserably (kind of worked, but really ad-hoc and hackish).

The basic idea of the plugin is selecting incrementally different semantic units with the same shortcuts.

Mangars is the author, and has kindly applied a couple of pull requests I made (hey, it's my first collaboration in any emacs plugin). I basically added support for disabled transient-mark-mode, and extensions for feature-mode.

On the way, I found out that ecukes and espuds. Nice discover.

And here's my fork of expand-region (that hopefully, you won't need to clone, because the central one is magnars')

4 comentarios:

David dijo...

Hey man!

This is a really nice feature!! Is there something similar for Vim?

kenanb dijo...

great share, thanks. i am fascinated how that works correctly with many languages and provides specialized features.

Raimon Grau dijo...

@david: Not that I know of. but vim already provides many 'sintactic' movement shortcuts.

@kenanb: yup, it's really nice. And I hope people will chip in by writing smarter extensions for specific file types.

Thanks for visiting!

Terry dijo...

@David: I just created something for Vim that utilizes the existing text objects: https://github.com/terryma/vim-expand-region