Vim: Saving on FocusLost and executing auto command

余生颓废 提交于 2019-12-06 05:00:04

You need to change your FocusLost autocommand to:

autocmd FocusLost * nested silent! wall

See :h autocmd-nested for details.

I can't test this in a graphic Vim, but you can try some options:

  • Join some events in the same autocommand autocmd BufWritePre,FocusLost *.py ...
  • Execute an autocommand from an event, something like:
    autocmd BufWritePre *.py :execute "%s/\s\+$//e" | doautocmd FocusLost %
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!