Automatisches laden und speichern von Sessions im Projekt

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@145 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
stefan 2007-08-02 12:23:25 +00:00
parent 430d581779
commit a649161e03
2 changed files with 38 additions and 19 deletions

View File

@ -18,6 +18,7 @@ function s:ReportRev(Rev)
echo 'Neu seit Rev: 129'
echo 'Projekt laden über project.vim'
echo 'Einstellungen bleiben gespeichert'
echo 'Session wird im Projekt gespeichert, wenn g:sessionfile von project.vim gesetzt wird'
elseif a:Rev >= '129'
echo 'Neu seit Rev: 129'
echo 'Tags für BMS-X'

View File

@ -122,30 +122,48 @@ function s:SetProject(projectfile)
let g:basedir = fnamemodify(projectfilePath, ':p:h')
let projectfileName = fnamemodify(projectfilePath, ':t')
" test if projectfile is a batch-script
let ext = fnamemodify(projectfileName, ':e')
if ext == 'vim'
execute 'source ' . projectfilePath
return
elseif ext == 'bat'
let g:makeCommand = projectfilePath
" Projectfile is a vimscript. Execute and end
try
execute 'source ' . projectfilePath
catch
echom v:exception
endtry
else
let g:makeCommand = 'make -f ' . projectfilePath
" Projectfile is a makefile or a batchfile
if ext == 'bat'
let g:makeCommand = projectfilePath
else
let g:makeCommand = 'make -f ' . projectfilePath
endif
let &makeprg = g:makeCommand . ' $*'
" set directories
execute 'cd ' . g:basedir
" cd path
let &cdpath = g:basedir
" browse-dir
set browsedir=buffer
" search path
set path&
call s:GetProjectVariables()
call s:EvalProjectVariables()
endif
let &makeprg = g:makeCommand . ' $*'
" set directories
execute 'cd ' . g:basedir
" cd path
let &cdpath = g:basedir
" browse-dir
set browsedir=buffer
" search path
set path&
call s:GetProjectVariables()
call s:EvalProjectVariables()
if exists('g:sessionfile')
" Vim-Session load
try
execute 'source' g:sessionfile
catch /^Vim\%((\a\+)\)\=:E484/ " file not found
catch " other error
echom 'Fehler in' g:sessionfile ':' v:exception
endtry
" Vim-Session autowrite
autocmd VimLeavePre * execute 'mksession!' g:sessionfile
endif
endfunction