Tech

6 Sep 2024

Saving when you forget to `sudo vim`

Picture this—you are plugged in, furiously editing a config file in Vim over an SSH session to fix some issues in staging. Minutes pass by and you have keyed in some changes that might do the trick. You scroll through one last time before typing :w and Enter. Whoops! You annoyingly realize you don’t have the permissions to modify the file directly. You were supposed to run sudo vim to edit the goddamn thing!