reddit / emacs

[Elisp] Help with org-emphasis useful functions with Evil

seeminglyugly · 2022-09-04 18:43
I like to use org-emphasis styling for my notes. I was wondering if someone can help me out with two functions which I think would be useful in general (I don't know much programming at all): * Yank to clipboard text without the org-emphasis markers used to stylize the text. `org-copy-visible` copies text to the kill-ring, but I want this behavior in `evil-yank`. * A way to apply org-emphasis markers around active region (i.e. selected text). I came across [this](https://github.com/alphapapa/unpackaged.el#surround-region-with-emphasis-or-syntax-characters) but it doesn't seem to work. I'm guessing it's because I'm using Evil and keys like ~ is bound to other functions in visual mode. Any help is much appreciated.
fast-90 · 2022-09-04 19:51
For your second bullet point, I am using [evil-surround](https://github.com/emacs-evil/evil-surround). Basically select the text, then when still in Visual mode, press `S` and then your emphasis marker (e.g. `*`).
seeminglyugly · 2022-09-04 19:58
Oh yea, I was using that but it doesn't work for multiple lines or blocks of text where each lines needs to be org-emphasized.