Fork me on GitHub
#emacs
<
2024-01-25
>
ag02:01:28

Does anyone know an Emacs package that works with Arch's pacman or yay (or other AUR helpers)? I've been searching & installing packages in the terminal, and just realized how nice would it be to be able to do that in Emacs.

ag06:01:46

woah... very nice. a bunch of thanks for sharing!

vemv19:01:27

Is there a helper around that will paste multi-line clipboard contents, with each line prefixed by ;; ? Nothing that gpt wouldn't excel at, but I'm curious :)

Evan Bernard19:01:51

closest thing I know of is, after yanking your clipboard, select the contents and M-x comment-region

vemv19:01:33

ngl - I didn't know that command 😄 Seems easy enough to just M-x it each time

vemv19:01:36

thanks!

1
Evan Bernard19:01:23

probably worth mentioning, then, M-x uncomment-region 😄

mpenet19:01:03

Or just comment-or-uncomment-region , which is a toggle depending on the region comment state

vemv19:01:38

Was wondering about that 👌

Evan Bernard20:01:41

huh! didn’t know about that one! TIL

practicalli-johnny22:01:06

gc if using Evil, to toggle comment on a selected region

til 1
tomd23:01:15

n.b. gc is not part of evil, but is provided by evil-commentary or evil-nerd-commenter

☝️ 1
Ed11:01:03

> Seems easy enough to just M-x it each time C-y C-x C-x M-; by default 😛

til 1
aisamu11:01:18

C-y C-x C-x M-;Unsure if serious or jokingly proving the parent's point 😂

Ed11:01:35

I wouldn't joke about hot-button-religious issues like emacs keyboard shortcuts ... </joking>

Stig Brautaset11:01:32

I'm really thankful for that, because I learnt what C-x C-x does. (And I thought I was a pretty seasoned Emacs user.)

👍 1
1
Stig Brautaset11:01:54

It will save me many, many keystrokes in the future.

Ed11:01:05

There's also rectangle editing if you want to do something other than comment out some lines in your current programming mode.

C-y      ;; yank
 C-a      ;; move-beginning-of-line
 C-x C-x  ;; exchange-point-and-mark
 C-x r t  ;; string-rectangle
 ;        ;; self-insert-command
 ;        ;; self-insert-command
 SPC      ;; self-insert-command
  ;; exit-minibuffer

Stig Brautaset11:01:18

Something I do a lot is paste + complicated and custom sequence of keystrokes to select what I just pasted + M-q to reflow the text. Now I can just M-y C-x C-x M-q

Stig Brautaset11:01:19

Yeh, I know of rectangle editing but I use it so rarely that I have to look it up every time

Ed11:01:06

there's also C-u C-SPC which will pop from the local mark ring

Ed11:01:58

so if you do something like C-s to search for something, do some editing and want to get back to where you started, you can use C-u C-SPC (maybe more than once if you've done some things that set the mark)

gratitude-thank-you 1
Ed11:01:35

and there's a global mark ring you can pop (`C-x C-SPC`) which is similar, but across all buffers - so you can go back to where you were editing a few mins ago if you've started chasing a yak to shave 😜

thanks3 1
frozenlock22:01:14

Isn't M-; the default binding for comment-region? There's no need to call M-x comment-region

Evan Bernard22:01:50

huh! so it is! at least, it’s M-x comment-dwim which I imagine turns into comment-region in most contexts we’d want to apply it. cool! I must have only ever run C-h c comment-region RET in fundamental mode or something 🙂 thanks!!

👍 1