Auto-abrir NERDTree en vim


¿Alguien sabe cómo forzar?vimrc para abrir automáticamente NERDTree cada vez que se invoca vim? El sistema operativo es * nix.

Author: Secko, 2009-11-19

3 answers

 au VimEnter *  NERDTree

En su vimrc debe hacerlo

: he autocmd.txt para el fondo

 54
Author: michael,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-11-19 00:22:01

También puede abrir el Árbol de Nerd solo cuando no había ningún archivo en la línea de comandos:

function! StartUp()
    if 0 == argc()
        NERDTree
    end
endfunction

autocmd VimEnter * call StartUp()

Tomado de una entrada de blog de por Ovid.

 36
Author: zoul,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-27 06:06:51

Un liner para abrir NERDTree cuando no se proporciona ningún argumento de archivo sería

autocmd vimenter * if !argc() | NERDTree | endif
OR
au vimenter * if !argc() | NERDTree | endif

El código anterior solo comprueba si no se proporciona ningún argumento a continuación, abra NERDTree.

 4
Author: Rahul,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-30 08:42:51