bugreport.vim 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. :" Use this script to create the file "bugreport.txt", which contains
  2. :" information about the environment of a possible bug in Vim.
  3. :"
  4. :" Maintainer: Bram Moolenaar <Bram@vim.org>
  5. :" Last change: 2019 Jan 27
  6. :"
  7. :" To use inside Vim:
  8. :" :so $VIMRUNTIME/bugreport.vim
  9. :" Or, from the command line:
  10. :" vim -s $VIMRUNTIME/bugreport.vim
  11. :"
  12. :" The "if 1" lines are to avoid error messages when expression evaluation is
  13. :" not compiled in.
  14. :"
  15. :if 1
  16. : let more_save = &more
  17. :endif
  18. :set nomore
  19. :if has("unix")
  20. : !echo "uname -a" >bugreport.txt
  21. : !uname -a >>bugreport.txt
  22. :endif
  23. :redir >>bugreport.txt
  24. :version
  25. :if 1
  26. : func <SID>CheckDir(n)
  27. : if isdirectory(a:n)
  28. : echo 'directory "' . a:n . '" exists'
  29. : else
  30. : echo 'directory "' . a:n . '" does NOT exist'
  31. : endif
  32. : endfun
  33. : func <SID>CheckFile(n)
  34. : if filereadable(a:n)
  35. : echo '"' . a:n . '" is readable'
  36. : else
  37. : echo '"' . a:n . '" is NOT readable'
  38. : endif
  39. : endfun
  40. : echo "--- Directories and Files ---"
  41. : echo '$VIM = "' . $VIM . '"'
  42. : call <SID>CheckDir($VIM)
  43. : echo '$VIMRUNTIME = "' . $VIMRUNTIME . '"'
  44. : call <SID>CheckDir($VIMRUNTIME)
  45. : call <SID>CheckFile(&helpfile)
  46. : call <SID>CheckFile(fnamemodify(&helpfile, ":h") . "/tags")
  47. : call <SID>CheckFile($VIMRUNTIME . "/menu.vim")
  48. : call <SID>CheckFile($VIMRUNTIME . "/filetype.vim")
  49. : call <SID>CheckFile($VIMRUNTIME . "/syntax/synload.vim")
  50. : delfun <SID>CheckDir
  51. : delfun <SID>CheckFile
  52. : echo "--- Scripts sourced ---"
  53. : scriptnames
  54. :endif
  55. :set all
  56. :if has("autocmd")
  57. : au
  58. :endif
  59. :if 1
  60. : echo "--- Normal/Visual mode mappings ---"
  61. :endif
  62. :map
  63. :if 1
  64. : echo "--- Insert/Command-line mode mappings ---"
  65. :endif
  66. :map!
  67. :if 1
  68. : echo "--- Abbreviations ---"
  69. :endif
  70. :ab
  71. :if 1
  72. : echo "--- Highlighting ---"
  73. :endif
  74. :highlight
  75. :if 1
  76. : echo "--- Variables ---"
  77. :endif
  78. :if 1
  79. : let
  80. :endif
  81. :redir END
  82. :set more&
  83. :if 1
  84. : let &more = more_save
  85. : unlet more_save
  86. :endif
  87. :e bugreport.txt