Wizard
Wizard

Reputation: 22093

"mo" to open a file with default application,

When I happened to issue "mo" in NERDTree, it open a file in default application

which is awesome, but, I cannot not refer to a documentation for such an operation.

Where could I find where the "mo" is defined?

It is not in "help".

Here is my vimrc

> execute pathogen#infect()
nnoremap <silent> <F5> :NERDTree<CR>
"syntax enable
set background=dark
filetype plugin indent on
syntax on

"NERDTree Config
autocmd vimenter * NERDTree

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif

map <leader>r :NERDTreeFind<cr>

"Edit process
set number

"set ignorecase
"set smartcase

set spell spelllang=en_us

"Switch between the tabs
map  <C-l> :tabn<CR>
map  <C-h> :tabp<CR>
map  <C-n> :tabnew<CR>

Upvotes: 0

Views: 348

Answers (1)

B.G.
B.G.

Reputation: 6026

It seems that m is mapped to the menu:

call s:initVariable("g:NERDTreeMapMenu", "m")

It doesn't seem to be a default menu-item, since the NERDTree documentation states the following:

  • A programmable menu system is provided (simulates right clicking on a node)
    • one default menu plugin is provided to perform basic filesystem operations (create/delete/move/copy files/directories)
  • There's an API for adding your own keymappings

The last item is your key here, there is an API which allows you and other plugins to expand the menu:

call NERDTreeAddMenuItem({
      \ 'text': 'e(x)ecute',
      \ 'shortcut': 'x',
      \ 'callback': 'NERDTreeExecute' })

This is an example from this plugin: https://github.com/ivalkeen/nerdtree-execute/blob/master/nerdtree_plugin/execute_menuitem.vim

So I bet you have another Plugin installed which maps o as shortcut in the NERDTreeMenu.

Upvotes: 1

Related Questions