Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [sudo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

Debugging a program that requires escalated privileges

I have written a program in C that needs to access /dev/input/eventX programmatically. Running it as sudo ./a.out works well, but I am not sure how to debug it (using nvim-dap & cpptools). Here is ...
ElijaRock's user avatar
0 votes
1 answer

Color line numbers RED with SUDOEDIT

I want to have a visual feedback when editing files with root privileges. I had in my .vimrc this config " Color line numbers RED with root if $USER == 'root' highlight LineNr ctermfg=red ...
Susensio's user avatar
  • 103
1 vote
0 answers

Can I edit compressed files using sudo?

Vim has the ability to transparently decompress files while editing them. The way I understand it, it copies the file to a temporary directory, decompresses it there, and opens the decompressed ...
Kolja's user avatar
  • 111
0 votes
0 answers

nvi: how to define a new command to write using sudo

In Vim, I can define the following command for writing a file using sudo: command! W :execute ':silent w !sudo tee % > /dev/null' | :edit! How do I define a similar command in nvi for saving using ...
Flux's user avatar
  • 1,041
2 votes
4 answers

Saving a non user file with NeoVim, eg root owned /etc/pulse/

I am using NeoVim v0.4.3. This is the latest version available in repository. I have an Arch build with the most up to date packages and kernel 5.6.4-arch1-1. Occasionally I edit a file with nvim ...
Kes's user avatar
  • 663
6 votes
2 answers

How to open a file as sudo from within vim?

After opening vim as normal user. Is it possible to open a new file as sudo user? like for example in :e file.
yukashima huksay's user avatar
7 votes
1 answer

How can I automate filetype detection when using sudoedit?

sudoedit/sudo -e is often used for safely editing files as root. The way it works: sudoedit copies the named files to temporary files Then it opens the temporary files using the commands specified by ...
muru's user avatar
  • 25k
2 votes
1 answer

How do I preserve my colorscheme when I sudo to root?

I have many users who sudo to root to edit certain files. How can I allow each of them to use their own ~/.vimrc file once they have sudo'd to root? In other words. they each want to use their own ...
Doug Wolfgram's user avatar