startify.vim 1003 B

12345678910111213141516171819202122232425262728293031323334
  1. " Plugin: https://github.com/mhinz/vim-startify
  2. " Description: Start screen displaying recently used stuff.
  3. " Maintainer: Marco Hinz <http://github.com/mhinz>
  4. " Version: 0.5
  5. if exists('g:autoloaded_startify') || &cp
  6. finish
  7. endif
  8. let g:autoloaded_startify = 1
  9. function! startify#save_session() abort
  10. let spath = g:startify_session_dir .'/'. input('Save under this session name: ') | redraw
  11. if filereadable(spath)
  12. echo 'Session already exists. Overwrite? [y/n]' | redraw
  13. if nr2char(getchar()) == 'y'
  14. execute 'mksession! '. spath | echo 'Session saved under: '. spath
  15. else
  16. echo 'Did NOT save the session!'
  17. endif
  18. else
  19. execute 'mksession '. spath | echo 'Session saved under: '. spath
  20. endif
  21. endfunction
  22. function! startify#load_session() abort
  23. let spath = g:startify_session_dir .'/'. input('Load this session: ') | redraw
  24. if filereadable(spath)
  25. execute 'source '. spath
  26. else
  27. echo 'No such file!'
  28. endif
  29. endfunction
  30. " vim: et sw=2 sts=2