Uploaded October 2022 | Updated November 2026, 3 hours ago
Let me guess. You were going to edit a system file and typed in SUDO VIM like usual, right? In this video, I'll go over why you don't want to do that and what you should be using instead (sudoedit). Not only so you can keep your nice .vimrc file that you worked so hard on but for security reasons as well. Plus, if you want even more options, I'll show you some tricks to write a read-only file with Vim anyway...
How to install and manage Vim plugins: youtube.com/watch?v=MztQMLyyCnU
Why you should never run "sudo npm": youtube.com/watch?v=aFrR56sqC_A
Vim "write with sudo" shortcut: stackoverflow.com/a/7078429
suda.vim GitHub: github.com/lambdalisue/suda.vim
Watch my videos on Odysee: odysee.com/@ericnmurphy
My website: https://ericmurphy.xyz
My GitHub: github.com/ericmurphyxyz
0:00 Intro
0:51 sudo vim not using your vimrc
1:34 Security issues with sudo vim
2:22 Using sudoedit
4:02 Setting the editor sudoedit uses
5:14 Alternatives to sudoedit
5:36 Saving a read-only file with w !sudo tee %
6:31 Using the suda.vim plugin to write to read-only files
6:41 Conclusion
Let me guess. You were going to edit a system file and typed in SUDO VIM like usual, right? In this video, I'll go over why you don't want to do that and what you should be using instead (sudoedit). Not only so you can keep your nice .vimrc file that you worked so hard on but for security reasons as well. Plus, if you want even more options, I'll show you some tricks to write a read-only file with Vim anyway...
How to install and manage Vim plugins: youtube.com/watch?v=MztQMLyyCnU
Why you should never run "sudo npm": youtube.com/watch?v=aFrR56sqC_A
Vim "write with sudo" shortcut: stackoverflow.com/a/7078429
suda.vim GitHub: github.com/lambdalisue/suda.vim
Watch my videos on Odysee: odysee.com/@ericnmurphy
My website: https://ericmurphy.xyz
My GitHub: github.com/ericmurphyxyz
0:00 Intro
0:51 sudo vim not using your vimrc
1:34 Security issues with sudo vim
2:22 Using sudoedit
4:02 Setting the editor sudoedit uses
5:14 Alternatives to sudoedit
5:36 Saving a read-only file with w !sudo tee %
6:31 Using the suda.vim plugin to write to read-only files
6:41 Conclusion










