marcc
marcc

Reputation: 12399

nerdtree and mvim, how to get it to open to a split screen

I've been using MacVim and the Janus distribution for a while and have become very used to how it works. Recently, when I execute "mvim ." from a directory in a Terminal window, I get a MacVim window with only NERDTree open, there's not a vertical split. If I select a file in NERDTree, it replaces the NERDTree window with that file contents instead of leaving NERDTree open in a left pane.

Does anyone know how to get this back to the default configuration?

Upvotes: 2

Views: 629

Answers (2)

Victor Mours
Victor Mours

Reputation: 1

You can add this to your .vimrc autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists(“s:std_in”) | NERDTree | endif And Nerdtree will be open in a vertical split when you run mvim (not mvim .)

You can find some other improvements to your nerdtree config here: https://medium.com/@victormours/a-better-nerdtree-setup-3d3921abc0b9#.nlz8ycchu

Upvotes: 0

rogermushroom
rogermushroom

Reputation: 5586

I use this command to open NerdTree with Vim editor and it works

autocmd VimEnter * NERDTree

Upvotes: 0

Related Questions