File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1128,7 +1128,7 @@ setting is used.
11281128
11291129------------------------------------------------------------------------------
11301130 *NERDTreeWinPos*
1131- Values: "left" or "right "
1131+ Values: "left", "right", "top" or "bottom "
11321132Default: "left".
11331133
11341134This setting is used to determine where NERDTree window is placed on the
@@ -1138,6 +1138,13 @@ This setting makes it possible to use two different explorer plugins
11381138simultaneously. For example, you could have the taglist plugin on the left of
11391139the window and the NERDTree on the right.
11401140
1141+ When setting this variable to "top" or "bottom" make sure to also change the
1142+ | NERDTreeWinSize | to a more reasonable size.
1143+
1144+ For example:
1145+ >
1146+ let g:NERDTreeWinSize = 15
1147+ <
11411148------------------------------------------------------------------------------
11421149 *NERDTreeWinSize*
11431150Values: a positive integer.
Original file line number Diff line number Diff line change @@ -182,16 +182,17 @@ endfunction
182182" Initialize the NERDTree window. Open the window, size it properly, set all
183183" local options, etc.
184184function ! s: Creator ._createTreeWin ()
185- let l: splitLocation = g: NERDTreeWinPos == # ' left' ? ' topleft ' : ' botright '
185+ let l: splitLocation = g: NERDTreeWinPos == # ' left' || g: NERDTreeWinPos == # ' top' ? ' topleft ' : ' botright '
186+ let l: splitDirection = g: NERDTreeWinPos == # ' left' || g: NERDTreeWinPos == # ' right' ? ' vertical' : ' '
186187 let l: splitSize = g: NERDTreeWinSize
187188
188189 if ! g: NERDTree .ExistsForTab ()
189190 let t :NERDTreeBufName = self ._nextBufferName ()
190- silent ! execute l: splitLocation . ' vertical ' . l: splitSize . ' new'
191+ silent ! execute l: splitLocation . l: splitDirection . ' ' . l: splitSize . ' new'
191192 silent ! execute ' edit ' . t :NERDTreeBufName
192- silent ! execute ' vertical resize ' . l: splitSize
193+ silent ! execute l: splitDirection . ' resize ' . l: splitSize
193194 else
194- silent ! execute l: splitLocation . ' vertical ' . l: splitSize . ' split'
195+ silent ! execute l: splitLocation . l: splitDirection . ' ' . l: splitSize . ' split'
195196 silent ! execute ' buffer ' . t :NERDTreeBufName
196197 endif
197198
You can’t perform that action at this time.
0 commit comments