1
0

util.vim 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. let s:save_cpo = &cpo
  2. set cpo&vim
  3. if exists('g:Mundo_PluginLoaded')
  4. finish
  5. endif
  6. function! mundo#util#set_default(var, val, ...) "{{{
  7. if !exists(a:var)
  8. let {a:var} = a:val
  9. endif
  10. let old_var = get(a:000, 0, '')
  11. if exists(old_var)
  12. echohl WarningMsg
  13. echomsg "{".old_var."}is deprecated! Please change your setting to {"
  14. \.split(old_var,':')[0]
  15. \.':'
  16. \.substitute(split(old_var,':')[1],'gundo_','mundo_','g')
  17. \.'}'
  18. echohl None
  19. endif
  20. endfunction"}}}
  21. call mundo#util#set_default(
  22. \ 'g:mundo_python_path_setup', 0,
  23. \ 'g:gundo_python_path_setup')
  24. call mundo#util#set_default(
  25. \ 'g:mundo_first_visible_line', 0,
  26. \ 'g:gundo_first_visible_line')
  27. call mundo#util#set_default(
  28. \ 'g:mundo_last_visible_line', 0,
  29. \ 'g:gundo_last_visible_line')
  30. call mundo#util#set_default(
  31. \ 'g:mundo_width', 45,
  32. \ 'g:gundo_width')
  33. call mundo#util#set_default(
  34. \ 'g:mundo_preview_height', 15,
  35. \ 'g:gundo_preview_height')
  36. call mundo#util#set_default(
  37. \ 'g:mundo_preview_bottom', 0,
  38. \ 'g:gundo_preview_bottom')
  39. call mundo#util#set_default(
  40. \ 'g:mundo_right', 0,
  41. \ 'g:gundo_right')
  42. call mundo#util#set_default(
  43. \ 'g:mundo_help', 0,
  44. \ 'g:gundo_help')
  45. call mundo#util#set_default(
  46. \ 'g:mundo_map_move_older', 'j',
  47. \ 'g:gundo_map_move_older')
  48. call mundo#util#set_default(
  49. \ 'g:mundo_map_move_newer', 'k',
  50. \ 'g:gundo_map_move_newer')
  51. call mundo#util#set_default(
  52. \ 'g:mundo_close_on_revert', 0,
  53. \ 'g:gundo_close_on_revert')
  54. call mundo#util#set_default(
  55. \ 'g:mundo_prefer_python3', 0,
  56. \ 'g:gundo_prefer_python3')
  57. call mundo#util#set_default(
  58. \ 'g:mundo_auto_preview', 1,
  59. \ 'g:gundo_auto_preview')
  60. call mundo#util#set_default(
  61. \ 'g:mundo_verbose_graph', 1,
  62. \ 'g:gundo_verbose_graph')
  63. call mundo#util#set_default(
  64. \ 'g:mundo_playback_delay', 60,
  65. \ 'g:gundo_playback_delay')
  66. call mundo#util#set_default(
  67. \ 'g:mundo_mirror_graph', 0,
  68. \ 'g:gundo_mirror_graph')
  69. call mundo#util#set_default(
  70. \ 'g:mundo_inline_undo', 0,
  71. \ 'g:gundo_inline_undo')
  72. call mundo#util#set_default(
  73. \ 'g:mundo_return_on_revert', 1,
  74. \ 'g:gundo_return_on_revert')
  75. function! mundo#util#init() abort
  76. endfunction
  77. func! mundo#util#MundoToggle()
  78. echohl WarningMsg
  79. echomsg "GundoToggle commands are deprecated. Please change to their corresponding MundoToggle command"
  80. echohl None
  81. endf
  82. func! mundo#util#MundoShow()
  83. echohl WarningMsg
  84. echomsg "GundoShow commands are deprecated. Please change to their corresponding MundoShow command"
  85. echohl None
  86. endf
  87. func! mundo#util#MundoHide()
  88. echohl WarningMsg
  89. echomsg "GundoHide commands are deprecated. Please change to their corresponding MundoHide command"
  90. echohl None
  91. endf
  92. func! mundo#util#MundoRenderGraph()
  93. echohl WarningMsg
  94. echomsg "GundoRenderGraph commands are deprecated. Please change to their corresponding MundoRenderGraph command"
  95. echohl None
  96. endf
  97. let g:Mundo_PluginLoaded = 1
  98. let &cpo = s:save_cpo
  99. unlet s:save_cpo