Follow

Why is it that I'm starting to write some stuff in , then I need to grep something, I discover wgrep, then ivy-occur-grep-mode, read the Ivy documentation again, and on and on and then I shake my head: WTF was I just trying to do a few minutes ago‽

@kensanata happens to me all the time as a vim user too, falling down rabbit holes until you forgot the way back up. it doesnt help that im easily distractable

@kensanata
Getting old? The "why did I come into this room" syndrome.

Can you run arbitrary shell commands from within Emacs?

@fitheach Haha, cannot delete and redraft because my mastodon backup code is running and the glorious Mastodon network has a rate limit for deletion of 30 statuses per 30 minutes!! Aaaargh.

@kensanata
Not so clever clogs. 😉

You can run shell commands from within #Vim, but it isn't something I do very often. For me, it is one of those features that sounds fantastic, but I don't find a use for it often.

@fitheach @kensanata probably my favourite use for that is when I forget to use "sudo vim" to edit a system file - thus you can't save the changes you've made.

I have a keybind to "tee" the file to a tmpfile, and then move the file to the real place. It's handy, and I use more than I'd like to admit :)

@gwmngilfen
Ahh, cool idea. I often do that, too. I'll need to remember that trick for next time.

@kensanata

@fitheach @kensanata when I get to a computer I'll dig it out of my vimrc for you

@gwmngilfen
Cool!
Not much use for Alex, I think. Do you have it in a format suitable for his ~/.emacs file ;-)

@kensanata

@fitheach

Here you go - it's all on one line, if Mastodon breaks the wrapping. Pop it in .vimrc and then try ":W"

command W w !sudo tee % >/dev/null

@kensanata

Sadly no, I don't have an Emacs version. As an ex-colleague of mine once put it: "I gave up on Emacs when I had to complete a command with my nose". Each to their own though, for sure :)

@gwmngilfen
The eleventh finger, or is that something else?

Once I added tee to my sudoers file that worked perfectly. Thanks!

@kensanata

@kensanata this is kind of why I use issue tracking even for personal projects and sometimes even config on my laptop.

Sign in to participate in the conversation
Octodon

Octodon is a nice general purpose instance. more