Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks text objects #777

Open
ChausseBenjamin opened this issue Jul 19, 2024 · 0 comments
Open

Blocks text objects #777

ChausseBenjamin opened this issue Jul 19, 2024 · 0 comments

Comments

@ChausseBenjamin
Copy link
Contributor

Does this feature exist in Emacs orgmode core?

No

Orgmode link

No response

Feature value

Most of the text objects are made around heading and their subtrees. But org has more than just headings. Notably, blocks. I think it would be quite useful to have the b (block) text object which one could work around and within. Perhaps this might get my idea accross a bit better:

  • dib (delete inner block) -> deletes everything within the limits of #+begin_src and #+end_src. And this could be block type agnostic (quote blocks, code blocks, etc...)
  • dab (delete around block) -> deletes the #+begin_... and #+end_... lines but not the contents

This could even allow some quite sophisticated behaviour with existing plugins such as vim-surround. Similarly to html tags, block have some sort of label (src, quote, etc). Some also have additional info (ex: #+begin_src go specifies golang as the syntax inside the block). This means you could have a similar behaviour to html tags. Take this for example from vim-surround:

Say you have hello my [quaint] friend in a document and wrote cs]t (Change Surrounding ] with an html Tag). Vim surround opens up a small command prompt where you can write div id="myID" and press Enter. The result is then the following hello my <div id="myID">quaint</id> friend.

In a similar fashion writing cs]b and write src lisp in the command prompt could change the brackets with a block structured as such: +begin_src lisp ... #+end_src.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant