Advertisement
Guest User

helino

a guest
Apr 15th, 2009
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. " Vim global plugin for saving and loading a view to a file with the name
  2. " ."filename".view
  3. " Last change: 2009 Apr 15
  4. " Maintainer: Erik Helin <erik.helin@gmail.com>
  5. " License: This file is placed in the public domain
  6.  
  7. if exists("loaded_mkviewfile")
  8. finish
  9. endif
  10.  
  11. function s:SaveFile()
  12. let com = "mkview! .".buffer_name("%").".view"
  13. exe com
  14. endfunction
  15.  
  16. function s:LoadFile()
  17. if file_readable(".".buffer_name("%").".view")
  18. let com = "source .".buffer_name("%").".view"
  19. exe com
  20. syntax enable
  21. endif
  22. endfunction
  23.  
  24. if !exists(":Mkviewfile")
  25. command Mkviewfile call s:SaveFile()
  26. endif
  27.  
  28. if !exists(":Loviewfile")
  29. command Loviewfile call s:LoadFile()
  30. endif
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement