When you realized you forgot sudo

https://lemmy.world/post/13497675

When you realized you forgot sudo - Lemmy.World

Is there an editor that can request root privileges without restarting it? That would be quite useful.
In vim, in normal mode you can do: :w !sudo tee %

Apparently that doesn’t work in NeoVim, so recently I installed the suda plugin.

Personally, I just doas nvim and then the file name that needs root access, but it’s a handy plugin in case I forget.

GitHub - lambdalisue/suda.vim: 🥪 An alternative sudo.vim for Vim and Neovim, limited support sudo in Windows

🥪 An alternative sudo.vim for Vim and Neovim, limited support sudo in Windows - lambdalisue/suda.vim

GitHub

??? I used this in neovim twice today

:w !sudo tee % then reload when it asks.