Take the 2-minute tour ×

I'm using MacVim and would like to be able to open mvim, set it to the current directory and open a new buffer in one command. Currently I do "mvim ." (where mvim is aliased to "mvim --remote-silent"). However this also automatically opens a netrw window (I assume because I tried to open a directory in mvim).

Is there any way of disabling this and only opening a blank buffer (while setting the working directory to the current one)?

EDIT: Here's the script that does what @Amadan suggested:

if [ $# -eq 0 ]
    mvim --remote-silent "$@"
share|improve this question

1 Answer 1

up vote 2 down vote accepted

mvim by itself does what you want. (The original one, not the --remote-silented one)

share|improve this answer
There's no way of combining both? The reason I'd like to keep --remote-silent is to open new files in the same mvim session. Is there another way of achieving this? –  chopper Dec 5 '13 at 4:56
--remote-silent has a mandatory file argument. I don't know how you can open an anonymous buffer by specifying a file name. You could make a script instead of alias and run mvim or mvim --remote-silent "$@" depending on what you give it, I suppose. –  Amadan Dec 5 '13 at 4:57
Myself, I actually have an alias rvim="mvim --remote-silent" that allows me to choose which I want to use. (Before anyone complains, I never use restricted vim anyway.) –  Amadan Dec 5 '13 at 5:03
Thanks, that worked! I edited my question with the script that you suggested. –  chopper Dec 5 '13 at 5:21

Your Answer


