Let me answer your question in several parts.
Setting up an alias in Bash
.bashrc, put a line that reads as follows:
alias sim="sudo vim"
On some systems (Ubuntu, for example), this line should instead go in your
.bash_aliases file, which will automatically be loaded by your default
Note that it is not necessary to deal with the command arguments; these will be tacked onto the end of the
sudo vim command automatically.
Editing as superuser
Take everything I just said and throw it out.
It is generally a better idea to use
sudoedit will automatically make a temporary copy of the file that you can edit without superuser privileges. This means that vim will run as you (instead of as root), and only a brief moment of superuserity is needed after you're done editing the file.
sudoedit runs vim
On Debianish systems, use
sudo update-alternatives --config editor to choose your preferred editor. Otherwise, make sure
$EDITOR is set to vim in your