troubleshooting.vim 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. " DESC: Get debug information about pymode problem
  2. fun! pymode#troubleshooting#Test() "{{{
  3. new
  4. setlocal buftype=nofile bufhidden=delete noswapfile nowrap
  5. let os = "Unknown"
  6. if has('win16') || has('win32') || has('win64')
  7. let os = "Windows"
  8. else
  9. let os = substitute(system('uname'), "\n", "", "")
  10. endif
  11. call append('0', ['Pymode diagnostic',
  12. \ '===================',
  13. \ 'VIM:' . v:version . ', OS: ' . os .', multi_byte:' . has('multi_byte') . ', pymode: ' . g:pymode_version,
  14. \ ''])
  15. let python = 1
  16. let output = []
  17. if !exists('#filetypeplugin')
  18. call append('$', ['WARNING: ', 'Python-mode required :filetype plugin indent on', ''])
  19. endif
  20. if !has('python')
  21. call append('$', ['WARNING: ', 'Python-mode required vim compiled with +python.',
  22. \ '"lint, rope, run, doc, virtualenv" features disabled.', ''])
  23. let python = 0
  24. endif
  25. call append('$', 'Pymode variables:')
  26. call append('$', '-------------------')
  27. call append('$', 'let pymode = ' . string(g:pymode))
  28. if g:pymode
  29. call append('$', 'let pymode_path = ' . string(g:pymode_path))
  30. call append('$', 'let pymode_paths = ' . string(g:pymode_paths))
  31. call append('$', 'let pymode_doc = ' . string(g:pymode_doc))
  32. if g:pymode_doc
  33. call append('$', 'let pymode_doc_key = ' . string(g:pymode_doc_key))
  34. endif
  35. call append('$', 'let pymode_run = ' . string(g:pymode_run))
  36. if g:pymode_run
  37. call append('$', 'let pymode_run_key = ' . string(g:pymode_run_key))
  38. endif
  39. call append('$', 'let pymode_lint = ' . string(g:pymode_lint))
  40. if g:pymode_lint
  41. call append('$', 'let pymode_lint_checker = ' . string(g:pymode_lint_checker))
  42. call append('$', 'let pymode_lint_ignore = ' . string(g:pymode_lint_ignore))
  43. call append('$', 'let pymode_lint_select = ' . string(g:pymode_lint_select))
  44. call append('$', 'let pymode_lint_onfly = ' . string(g:pymode_lint_onfly))
  45. call append('$', 'let pymode_lint_config = ' . string(g:pymode_lint_config))
  46. call append('$', 'let pymode_lint_write = ' . string(g:pymode_lint_write))
  47. call append('$', 'let pymode_lint_cwindow = ' . string(g:pymode_lint_cwindow))
  48. call append('$', 'let pymode_lint_message = ' . string(g:pymode_lint_message))
  49. call append('$', 'let pymode_lint_signs = ' . string(g:pymode_lint_signs))
  50. call append('$', 'let pymode_lint_jump = ' . string(g:pymode_lint_jump))
  51. call append('$', 'let pymode_lint_hold = ' . string(g:pymode_lint_hold))
  52. call append('$', 'let pymode_lint_minheight = ' . string(g:pymode_lint_minheight))
  53. call append('$', 'let pymode_lint_maxheight = ' . string(g:pymode_lint_maxheight))
  54. endif
  55. call append('$', 'let pymode_rope = ' . string(g:pymode_rope))
  56. call append('$', 'let pymode_folding = ' . string(g:pymode_folding))
  57. call append('$', 'let pymode_breakpoint = ' . string(g:pymode_breakpoint))
  58. call append('$', 'let pymode_syntax = ' . string(g:pymode_syntax))
  59. call append('$', 'let pymode_virtualenv = ' . string(g:pymode_virtualenv))
  60. if g:pymode_virtualenv
  61. call append('$', 'let pymode_virtualenv_enabled = ' . string(g:pymode_virtualenv_enabled))
  62. endif
  63. call append('$', 'pymode_utils_whitespaces:' . string(g:pymode_utils_whitespaces))
  64. call append('$', 'pymode_options:' . string(g:pymode_options))
  65. endif
  66. if python
  67. call append('$', 'VIM python paths:')
  68. call append('$', '-----------------')
  69. python << EOF
  70. vim.command('let l:output = %s' % repr(sys.path))
  71. EOF
  72. call append('$', output)
  73. call append('$', '')
  74. endif
  75. endfunction "}}}