2

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.

Thanks.

3

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. – user1685095 Apr 17 '17 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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