Created
April 28, 2019 01:33
-
-
Save jeremysj/9303f8e3576b8c87506cf86f8bf4a10c to your computer and use it in GitHub Desktop.
Revisions
-
jeremysj created this gist
Apr 28, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # Make sudo vim sane Using vim with something like `sudo vim /path/to/file` has historically made my head hurt. All my magic from vim-bootstrap hasn't worked. I knew why, I just didn't care enough to fix it. Until I did. Fix that with this simple flag: `sudo -E vim /path/to/some/file` Voilà! From `man sudo`: ``` ... -E, --preserve-env Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment. ... ```