4 ms·
One time I started editing an nginx.conf file in nano while setting up a remote server on Linode. I forgot to sudo when I opened the file and couldn't save my c
by bzalasky 14y ago
One time I started editing an nginx.conf file in nano while setting up a remote server on Linode. I forgot to sudo when I opened the file and couldn't save my changes. I might be an idiot here but (could I have resolved this in nano?)... but I'm fairly certain this would have been a non-issue in Vim.
- mateuszf 14y agoOne simple solution that people often forget - at least I know I did in this situation is to save the file in home directory and then move it using su(do).
- npongratz 14y ago" Use w!! to sudo save after file is already opened cmap w!! w !sudo tee % >/dev/null See Nathan Long's awesome answer for an explanation: http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work http://stackoverflow.com/questions/2600783/how-does-the-vim-...