Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine two actions in ideavim?

Tags:

ideavim

I try to customize my ~/_ideavim like this

nmap za :action ReformatCode<CR>
nmap zb :action RiderUnitTestRunSolutionAction<CR>
nmap zc :action ReformatCode<CR>:action RiderUnitTestRunSolutionAction<CR>

When I try press za or zb it works very well. It will format my code or run the unit tests.

But when I try to combine two actions like zc, only the last action works.

Is it possible run test after reformat?

like image 959
Marsen Lin Avatar asked Oct 21 '25 15:10

Marsen Lin


2 Answers

You can run multiple commands at once with the |

nmap zc :action ReformatCode  \| action RiderUnitTestRunSolutionAction<CR>
like image 186
Doktor OSwaldo Avatar answered Oct 25 '25 01:10

Doktor OSwaldo


For me this was the solution:

map <leader>f <Action>(ReformatCode)<Action>(OptimizeImports)

This will ReformatCode and OptimizeImports

like image 35
Hampus Avatar answered Oct 25 '25 02:10

Hampus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!