casouri / expreg Goto Github PK
View Code? Open in Web Editor NEWYour friendly neighborhood expand-region clone
Your friendly neighborhood expand-region clone
Expreg is now available on ELPA. This is just like expand-region, but (1) we generate all regions at once, and (2) should be easier to debug, and (3) we out-source language-specific expansions to tree-sitter. Bind ‘expreg-expand’ and ‘expreg-contract’ and start using it. Note that if point is in between two possible regions, we only keep the region after point. In the example below, only region B is kept (“|” represents point): (region A)|(region B) Expreg also recognizes subwords if ‘subword-mode’ is on.
Hello @casouri and thank you for this package!
Have you thought about passing a prefix numeric argument to expreg-expand
? I think it is useful. For now I use a variant of this:
(defun prot/expreg-expand (n)
(interactive "p")
(dotimes (_ n)
(expreg-expand)))
combobulate (from @mickeynp) offers tree-sitter based features, including expanding region. Do you know of any difference with your package?
One difference I see is that combobulate requires language-specific support to specify what kinds of tree-sitter nodes make sense from a user point of view (at least this is how I understand combobulate). On the contrary, expreg seems to be completely language agnostic.
Say, I have this HTML with treesit-language-at-point-function
setup correctly to return 'html
or 'css
:
<html>
<head>
<style>
body {
background: url("/background.png");
color: #ff0000;
}
</style>
</head>
</html>
If I place my cursor on background
and call (expreg-expand)
, I notice that it gets stuck at this place, regardless how many times I call. It seems to have issues marking the outer HTML as well.
Is this not implemented yet, or a possible bug?
Thanks!
Hi!
Thank you for this package and your work on Treesitter. I suggest to autoload both expreg-contract and expreg-expand for symmetry and because they are the two entry points to the package. Any plans to put expreg on ELPA/MELPA at some point? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.