1

I want to be editing a file like this:

---------------
|             |
|             |
|    DOC      |
|             |
|             |
|             |
---------------

And then press F5 and open NERDTree and Tagbar like this:

---------------
|    |        |
|NERD|   DOC  |
|TREE|        |
|----|        |
|TAG |        |
| BAR|        |
---------------

The commands I use to open NERDTree and Tagbar are :NERDTreeTabsToggle and :TagbarToggle

If this can't be done, then how can I just open tagbar below or above NERDTree?

  • 1
    nnoremap <F5> :NERDTreeTabsToggle <bar> TagbarToggle<cr>? – muru Nov 26 '16 at 5:17
1

You can use |. See :help :bar:

'|' can be used to separate commands, so you can give multiple commands in one line. If you want to use '|' in an argument, precede it with '\'.

In your case it would be:

nnoremap <f5> :NERDTreeTabsToggle | :TagbarToggle<cr>
1

Consulting the documentation of these plugins, you can find out how to tweak the position of their buffers. I achieved what you want as follows:

let g:tagbar_left = 1
let g:tagbar_vertical = 25
let NERDTreeWinPos = 'left'
nnoremap <f5> :NERDTreeToggle <CR> :TagbarToggle <CR>

Note: :NERDTreeTabsToggle is not part of NERDTree itself, as it seems. Are you using this plugin? I don't know if it works the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.