How to Bind a Quick Command to Open Two Plugins at the Same Time in vim

  question, vim

For example, I used two very popular plug-ins NERDTree and Tagbar in vim. Generally, after I open the editor, I will open the two plug-ins at the same time. It is very troublesome to type twice each time. I wonder if I can combine them into one command, for exampledev, to achieve the following effect, I input in vim

:dev php

It is executed by defaultNERDTree phpAndTagbarOf these two commands, php here is one of mineBookmarkName.

Write a function.

    func! Devphp()
        if &filetype == 'php'
            exec "NERDTree"
            exec "Tagbar" 
    :command -range=% DEVPHP :call Devphp()

The code has not been tested, please modify it a little.

In addition, you can set the default open for nerdtree:

autocmd vimenter * NERDTree