Created
July 4, 2014 11:28
-
-
Save scrooloose/50ec0b131b2861e58af3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"put this in your vimrc | |
"note: I'll probably add :NERDTreeSecondary after work tonight | |
autocmd vimenter * call s:CheckToSplitTwoTrees() | |
function! s:CheckToSplitTwoTrees() | |
if argc() != 1 || !isdirectory(argv(0)) | |
return | |
endif | |
vsplit | |
"there should really be a better way to do this... e.g. :NERDTreeSecondary | |
call nerdtree#checkForBrowse(argv(0)) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edit: Something doesn't work correctly. I'm used to navigating to a file in the tree view in the left pane and hitting
o
to make the file open in the right pane. With this vimscript, when I hito
in the left pane, the file opens in the left pane.Nice! I'm sick of typing:
$ mvim .
then
:NERDTree
How about having the cursor start in the right hand window? My setup is tree view on left, and file on right; so if the cursor starts in the right hand window, I can navigate to a file and hit "o"--and not have to do any window switching.
Ha! Here it is: after the line
vsplit
addwincmd l
: