I wonder is there any pipeline style combination key mapping in vimrc.

For example:

The command to open the NERDTree is :NERDTree and press capital B will open the bookmark list. How can I combine them into one action when I type the key storks of nb in .vimrc?

My trying:

nnoremap nb :NERDTree<Cr>B<Cr>  //not working
nnoremap nb :NERDTree<Cr> | B<Cr>  //not working
nnoremap nb :NERDTree<Cr><Esc>B<Cr>  //not working

1 Answer 1


you cannot use nnoremap here. Use nmap instead. This is because B is a mapping that NERDtree provides and nore means to not use an existing mapping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.