亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to bind a shortcut command in vim to open two plug-ins at the same time
高洛峰
高洛峰 2017-05-16 16:42:58
0
2
769

For example, I use two very popular plug-ins, NERDTree and Tagbar, in vim. Generally, I will open these two plug-ins at the same time after opening the editor. It is very troublesome to type twice every time. I want to be able to They cannot be combined into one command, such as dev, to achieve the following effect, I enter

in vim
:dev php

It will execute the two commands NERDTree php and Tagbar by default. The php here is one of my Bookmark names.

高洛峰
高洛峰

擁有18年軟件開發(fā)和IT教學(xué)經(jīng)驗。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項目經(jīng)理、高級軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...

reply all(2)
Peter_Zhu

Write a function.

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

The code has not been tested, please modify it yourself.

In addition, for nerdtree, you can set it to be opened by default:

autocmd vimenter * NERDTree
過去多啦不再A夢

I don’t quite understand how you open the plug-in, but you can probably do it with map. For example, this is how I compile C/C++. For reference

map <F8> <esc>:w!<cr>:!g++ -o %< % -Wall<cr>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template