this post was submitted on 24 Mar 2024
355 points (95.6% liked)
linuxmemes
20880 readers
4 users here now
I use Arch btw
Sister communities:
- LemmyMemes: Memes
- LemmyShitpost: Anything and everything goes.
- RISA: Star Trek memes and shitposts
Community rules
- Follow the site-wide rules and code of conduct
- Be civil
- Post Linux-related content
- No recent reposts
Please report posts and comments that break these rules!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Lazy vim way I do it:
ggVG"wY:q!
followed bysudo !!
thenVG"wp:x
Grab entire file and stuff it in register W
Exit file
Reopen sudo
Select all and replace with register W them write
Now I understand how the Adeptus Mechanicus feel when they perform a ritual power-on.
It's funny how years of use make that so intuitive but spelled out it's a garbled mess
Lazier way:
:w !sudo tee %
Yeah learning about
tee
from this thread honestly.It's been interesting realizing I had such a useful tool at my disposal but never knew