Is there any way to shorten a command in VIM?

后端 未结 2 812
甜味超标
甜味超标 2021-01-16 12:43

I use the plugin NERDTree, but every time I call it, I need to type

:NERDTree

I can\'t use the EscKey

相关标签:
2条回答
  • 2021-01-16 13:28

    Just remap it to something easier:

    " F12 toggles NERDTree
    map <F12> :NERDTreeToggle<CR>
    
    " Or cmap it to :NT
    cmap NT NERDTree
    

    But anyway, you can just press <Tab> to autocomplete it after the first few characters.

    :NER<Tab>
    

    ... autocompletes :NERDTree

    0 讨论(0)
  • 2021-01-16 13:35

    By default, command-line completion is done with the <Tab> key. This can be configured with the wildchar option.

    To complete using <Esc> instead, put the following in your vimrc:

    set wildchar=<Esc>
    

    For more information see :help 'wildchar'.

    0 讨论(0)
提交回复
热议问题