For example, constantly driving in TlistToggle, NERDTree is tiring, and I do not want to open them with the launch of vim either.

How to set a key combination or a synonym (like: tlist)?

    2 answers 2

    Any command can be “shortened” / simplified using command .

    For example, if the TlistToggle command (which is, of course, simple enough by itself: it’s not difficult to drive it using the auto-add-on) you need to call the command :Tlist (user commands must start with a capital letter), then enter:

     :command Tlist TlistToggle 

    the word command in this case can be abbreviated to com .

    so that this description is always loaded when the vim program is started , you can add it (of course, without the leading colon character), for example, to the main configuration file (in unix-like systems, this is ~/.vimrc ).


    for details, see the help:: :help command or online1 online2 .


    to “bypass” the requirement of the first capital letter , cabbrev can be used instead of command :

     :cabbrev tlist TlistToggle 

    cabbrev can be abbreviated to cabbrev

    In ~/.vimrc add: map <F7> :NERDTree<CR> and restart vim.

    After that, by pressing the <F7> key, NERDTree will open.