Open emacs in new window when sudo-ing

102 Views Asked by At

I'm trying to use emacs to edit some file under /usr. When I use

sudo emacs filename.txt

it automatically uses -nw mode. Is there anyway to open a new window when I use sudo emacs?

My emacs version is 24.5.1.

Thanks!

1

There are 1 best solutions below

0
jh314 On

You can use Tramp to open files as sudo. First open up Emacs in a window, then run:

C-x C-f /sudo::/usr/yourfile