showkey
showkey

Reputation: 348

How to map two commands under one shortcut in Vim?

I have written in my vim configuration file.

map <f2> :w<cr>:!D:\Python34\python %<cr>

When I press F2, the currently edited python file will be interpreted.
Now I want to set 65001 in command, then to execute the python file.

How to express two commands in a row in my map?

map <f2> :w<cr>:!chcp 65001 and D:\Python34\python %<cr> 

Upvotes: 1

Views: 174

Answers (1)

ways
ways

Reputation: 306

It seems like you just want execute two cmd commands in a row. Use & between cmd commands. So it becomes,

map <f2> :w<cr>:!chcp 65001 & D:\Python34\python %<cr> 

Upvotes: 2

Related Questions