In my .vimrc I have:

map <Leader>c :GitGutterToggle<CR>
map <Leader>n :set invnumber<CR>

Is there any way I can combine these two into one Leader entry?

For example:

map <Leader>c :GitGutterToggle && :set invnumber<CR>

I've tried the above, and variations thereof, to no avail.



1 Answer 1


One way to do that is map <leader>c :execute 'GitGutterToggle \| set invnumber'<cr> I don't have gitgutter so I've tested it with nnoremap <leader>c :exe 'echom "some" \| echom "other"'<cr>

In fact it's even simpler than that.

nnoremap <leader>c :echo 'some' \| echo 'other'<cr>
  • Glad that I could help. Apr 17, 2017 at 13:20

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.