set viewoptions=cursor,folds,options,slash,unix

let ideHome = $PWD
augroup ide
  au BufWinEnter *.java,*.xml,*.scss,*.yaws,*.html,*.js execute "source ".ideHome."/.ide/vim-views/".strpart(bufname("%"), strridx(bufname("%"), "/") + 1).".view"
  au BufWinLeave *.java,*.xml,*.scss,*.yaws,*.html,*.js execute "mkview! ".ideHome."/.ide/vim-views/".strpart(bufname("%"), strridx(bufname("%"), "/") + 1).".view"
  au BufWinLeave *.java,*.xml,*.scss,*.yaws,*.html,*.js execute "silent !echo 'syntax on' >> ".ideHome."/.ide/vim-views/".strpart(bufname("%"), strridx(bufname("%"), "/") + 1).".view"
augroup END
