I want to execute some external program to format my code.:silent execute !eslint --fix -o /dev/null % | redraw!But the screen will jump to the shell output screen and shortly back to vim again. How I can avoid this short flash?
How do I execute an external command without jumping out of vim?
external command
Since the external command is executed via the shell, you need to append a & to launch the process in the background::silent execute '!eslint --fix -o /dev/null % &' | execute ':redraw!'You could also try the plugin vim-fixmyjsThen, to format on save, just add the following to your .vimrc:au BufWritePre *.js :Fixmyjsau BufWritePre *.jsx :Fixmyjs