rime_deployer.vim 848 B

12345678910111213141516171819202122232425262728293031
  1. " Vim Compiler File
  2. " Language: rime_deployer
  3. " Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
  4. " URL: https://rime.im
  5. " Latest Revision: 2024-04-09
  6. if exists('b:current_compiler')
  7. finish
  8. endif
  9. let b:current_compiler = 'rime_deployer'
  10. let s:save_cpoptions = &cpoptions
  11. set cpoptions&vim
  12. " Android Termux
  13. let s:prefix = getenv('PREFIX')
  14. if s:prefix == v:null
  15. let s:prefix = '/usr'
  16. endif
  17. " Android, NixOS, GNU/Linux, BSD
  18. for s:shared_data_dir in ['/sdcard/rime-data', '/run/current-system/sw/share/rime-data', '/usr/local/share/rime-data', s:prefix . '/share/rime-data']
  19. if isdirectory(s:shared_data_dir)
  20. break
  21. endif
  22. endfor
  23. execute 'CompilerSet makeprg=rime_deployer\ --build\ %:p:h:S\' s:shared_data_dir
  24. unlet s:prefix s:shared_data_dir
  25. let &cpoptions = s:save_cpoptions
  26. unlet s:save_cpoptions