0

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 ]
  then
    mvim
  else
    mvim --remote-silent "$@"
fi
chopper
  • 6,649
  • 7
  • 36
  • 53

1 Answers1

2

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

Amadan
  • 191,408
  • 23
  • 240
  • 301
  • 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 05 '13 at 04: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 05 '13 at 04: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 05 '13 at 05:03
  • Thanks, that worked! I edited my question with the script that you suggested. – chopper Dec 05 '13 at 05:21