Giter Club home page Giter Club logo

expreg's Introduction

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.

expreg's People

Contributors

casouri avatar

Stargazers

Adrien Vakili avatar Joey Liu avatar patrik avatar Emeka Nkurumeh avatar Ad avatar David Sweeney avatar  avatar Siavash Askari Nasr avatar Bruno Bigras avatar Arthur A. Gleckler avatar Marlin Strub avatar Sergey Kostyaev avatar Sourabh Cheedella avatar Romain Leroux avatar JunghanKim avatar Ross Viljoen avatar Abdelhak Bougouffa avatar ef. avatar Kadir Can Çetin avatar Ravioli avatar yorisilo avatar Sasha Kovar avatar  avatar Viacheslav K. avatar Suleyman Boyar avatar  avatar Pishran.NET avatar Jan Möller avatar Sigurd Fosseng avatar Hiroyuki Ishikura avatar Rui Ying avatar Ratnesh avatar P M avatar Space avatar Zelos Prapas Alkiviadis avatar Krishna avatar Vinícius Moraes avatar Fang Deng avatar Tomasz Hołubowicz avatar Protesilaos Stavrou avatar Dima avatar Andrea Greselin avatar zovt avatar dalu avatar  avatar  avatar  avatar Thomas Wimmer avatar Michael Eliachevitch avatar Sergei Pashakhin avatar Sangho Na avatar Ashlin Eldridge avatar Alex Murray avatar  avatar Dan avatar Kevin Fleming avatar Diego Alvarez avatar Mr Unhappy avatar wangzh avatar Jason Johnson avatar justin talbott avatar

Watchers

Kevin Fleming avatar  avatar  avatar

Forkers

emacsmirror

expreg's Issues

Accept numeric prefix arg for commands?

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)))

What are the differences with combobulate

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.

Can (expreg-expand) expand reliably across languages? From CSS to parent HTML?

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?

CleanShot 2023-09-15 at 21 30 17

Thanks!

Autoload expreg-contract

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.