When you realized you forgot sudo

https://lemmy.world/post/13497675

When you realized you forgot sudo - Lemmy.World

Lazy vim way I do it:

ggVG"wY:q! followed by sudo !! then VG"wp:x

Grab entire file and stuff it in register W

Exit file

Reopen sudo

Select all and replace with register W them write

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