this post was submitted on 24 Mar 2024
355 points (95.6% liked)
linuxmemes
20880 readers
9 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
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.
??? I used this in neovim twice today
:w !sudo tee %
then reload when it asks.i use micro
It's a simple trick in Vim:
https://stackoverflow.com/a/7078429
For the lazy:
:w !sudo tee > /dev/null %
Sure, you can do this in emacs: https://fuco1.github.io/2017-04-20-Save-write-protected-files-with-sudo-automatically.html
Yeah, in emacs you use
tramp
to open the file with/sudo::
micro ftw, no need to even memorize a command, it'll just ask if you want to use sudo
(n)vim + suda.vim.
kate
does this in KDE, but it's not cli.