I would like to write a function that does the equivalent of the shell command:
vim $MY_FILE && $MY_COMMAND
In other words, I would like to open a file in a buffer, and then when I save/close that buffer, I want it to run a certain shell command. How would I do this?
Furthermore, the shell command must be run in
su mode, so I need to either run it in an interactive shell so that the
sudo mode prompts for the password, or maybe have a popup that asks for the superuser password somehow.