HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
magnars
expand-region.el
Emacs Lisp2012–2024
magnars / expand-region.el

expand-region.el

Emacs extension to increase selected region by semantic units.

9Distinct people
9Mentions
0Explicit recommenders
1.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Emacs extension to increase selected region by semantic units.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year9 dated mentions

Observed mentions: 2012-08-10 21:47:24 UTC to 2024-09-11 14:35:54 UTC.

0122012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC101
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

9 sources
I haven't been active in Emacs world for a couple of years, but https://github.com/magnars/expand-region.el has been there for a while. I think the new code is right in lsp-mode and called lsp-extend-selection. VSCode has "Expand Selection". Mathematica has ctrl-. (http://xahlee.info/emacs/emacs/syntax_tree_walk.html) Zed has "select enclosing symbol" but that seems to jump to function level expansion immediately, I didn't see anything more gradual there.
In Show HN: Ki Editor – Multicursor syntactical editor
Yeah, it's a pretty good idea. I've been using lisp and expand-region[1] and it just makes this frame-based editing dream come alive. I've just recorded a video where I'll refactor some code for fun. This code adds two arrays one has strings in it like ["1" "2" "3"] the other has numbers like [1 2 3]. Video: https://s3.us-east-2.amazonaws.com/photoblobs/2017-06-22_003... I do have a couple typos / mis-compiles but that's sort of par for the course. Hope you enjoy! [1] - https://github.com/magnars/expand-region.el
In Frame-Based Editing [pdf]
Links to some of the tools used clojure and clojurescript https://github.com/clojure-emacs/clj-refactor.el (refactoring) https://github.com/clojure-emacs/cider (IDE) https://github.com/bhauman/lein-figwheel (code reloading) emacs https://github.com/magit/magit (the interface to Git) https://github.com/abo-abo/avy (jumping around) https://github.com/magnars/expand-region.el (marking stuff) https://github.com/magnars/multiple-cursors.el (placing cursors at similar stuff and editing all at once)
In Parens of the Dead
Great that you are a Spacemacs user now and glad that you like my tutorials. So, could you be more specific about how vim-sexp works? If you want to visual select sexp from symbol and expanding outward, uses expand-region: https://github.com/magnars/expand-region.el. Same for string. Then you can use smartparens: https://github.com/Fuco1/smartparens to wrap around by simply pressing "(". It is all in Spacemacs now, and you can explore further with evil-lisp-state commands, bound to ", k".
In Spacemacs – Emacs advanced kit focused on Evil
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-decorat
Read the rest
or er/mark-outer-python-block) [1] https://github.com/magnars/expand-region.el or from ELPA [2] http://emacsrocks.com/e09.html
In Show HN: Tiled Text – a Different Approach to Editing Text
Some Emacs extensions that implement Sublime Text features (and IMHO are better than their ST equivalents): mark-multiple[1] and CUA (builtin) for multiple cursors, helm[2] (formerly "anything") for file selection that allows quick previewing (C-z) and much much more, mini-map[3], and expand-region[4] (not sure if this is inspired by a ST feature but it is nice nonetheless). [1] https://github.com/magnars/mark-multiple.el Video: http://emacsrocks.com/e08.html [2] https://github.com/emacs-helm/helm [3] http://www.emacswiki.org/MiniMap [4] https://github.com/magnars/expand-region.el Video: http://emacsrocks.com/e09.html
In My next text editor

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.