diff --git a/vimfiles.stefan/compiler/bmsk.vim b/vimfiles.stefan/compiler/bmsk.vim index c7494ba..7091c76 100644 --- a/vimfiles.stefan/compiler/bmsk.vim +++ b/vimfiles.stefan/compiler/bmsk.vim @@ -112,40 +112,3 @@ setlocal errorformat+=%-Oignoring\ option%.%# " ignore 'file: 123: #error ...' setlocal errorformat+=%-O%*\\S\ %*\\d:\ #%.%# -" make options -let g:makeopts = '' -if (g:Motor != '') - let g:makeopts = g:makeopts . ' Motor=' . g:Motor -endif -if (g:Muster != '') - let g:makeopts = g:makeopts . ' Muster=' . Muster -endif -if (g:Egas != '') - let g:makeopts = g:makeopts . ' Egas=' . g:Egas -endif -if (Xlint != '') - let g:makeopts = g:makeopts . ' DIAB_LINT_OPTION=' . Xlint -endif -if (g:SW_Stand != '') - let g:makeopts = g:makeopts . ' Stand=' . g:SW_Stand -endif - -" reformat i-file -command! ReformatIFile call Reformat_IFile() -function! Reformat_IFile() abort - let cName = expand('%:t:r') . '.c' - let CR = '\' - DelAllMultipleEmptyLines - " do not wrap over end of file - setlocal nowrapscan - " go to top of file - execute 'normal gg' - " do unil error - while 1 - " delete until line of c-file - execute 'normal d/\c^# \d\+ ".*\(' . cName . '\)' . CR - " go to line of include-file - execute 'normal /\c^# \d\+ ".*\(' . cName . '\)\@') function s:SetBmskProject(basedir) - if ((a:basedir == '') && has('browse')) - " Browse for makefile - if exists('g:bmskWA') - let l:bmskWA = g:bmskWA - else - let l:bmskWA = '' - endif - - if exists('b:browsefilter') - let l:browsefilter = b:browsefilter - endif - let b:browsefilter = - \ 'Makefiles (make_fsw.bat)\tmake_fsw.bat\n' . - \ 'Makefiles (makefile*)\tmakefile*\n' . - \ 'All Files (*.*)\t*.*' - let makefile = browse(0, 'Select makefile', l:bmskWA, '') - if exists('l:browsefilter') - let b:browsefilter = l:browsefilter - endif - let basedir = fnamemodify(makefile, ':p:h') - let makefile = fnamemodify(makefile, ':t') - if ((makefile == 'make_fsw.bat') || (makefile == 'makefile.mak') || (makefile == 'makefile')) - let g:makeCommand = makefile - let &makeprg = g:makeCommand . ' $*' - call s:SetBmskDirs(basedir) - else - echo 'No makefile:' makefile - endif + if (a:basedir == '') + let makefile = '' else " set Workarea and basedir if (isdirectory(a:basedir)) @@ -58,19 +32,19 @@ function s:SetBmskProject(basedir) let makefile = fnamemodify(a:basedir . '/make_fsw.bat', ':p') if !filereadable(makefile) let makefile = glob(a:basedir . '/*/make_fsw.bat') - let basedir = fnamemodify(makefile, ':p:h') endif - if (filereadable(makefile)) - let g:makeCommand = makefile - let &makeprg = g:makeCommand . ' $*' - call s:SetBmskDirs(basedir) - else - echo 'No makefile' makefile + if !filereadable(makefile) + echoerr 'No makefile' makefile endif else - echo 'No directory:' a:basedir + echoerr 'No directory:' a:basedir endif endif + call SetProject(makefile) + let GetMakeOptsFunction = function('GetBmskMakeOpts') + let g:GetAllMakeGoals = function('GetAllBmskTargets') + let basedir = getcwd() + call s:SetBmskDirs(basedir) endfunction function GetAllBmskProjects(ArgLead, CmdLine, CursorPos) @@ -432,7 +406,6 @@ function s:SetBmskDirs(bmskdir) unlet! g:Goals unlet! g:Programname unlet! g:OutDirVariante - unlet! g:bmsk_stand " Variablen erzeugen, damit GetMakeVar funktioniert if !exists('g:Muster') @@ -482,8 +455,6 @@ function s:SetBmskDirs(bmskdir) let g:bmskProject = fnamemodify(g:bmskdir, ':h:h:t') let g:bmsk_sw = fnamemodify(g:bmskdir . '/sw', ':p') let g:bmsk_bios = fnamemodify(g:bmskdir . '/sw/bios', ':p') - let g:bmsk_d = GetDfilesDir() - let g:bmsk_stand = GetStandDir() let g:OutDir = GetOutDir() let g:OutDirVariante = GetOutDirVariante() let g:bmsk_ext = '*.c *.h *.kgs *.d *.dat *.mak *.inv' @@ -510,20 +481,11 @@ function s:SetBmskDirs(bmskdir) let &path = substitute(&path, '\\', '/', 'g') " files for tags (may not start with './', since . is the path of the " current file - let &tags = substitute(GetCTagsFile(), '^\..', '', '') . ',' . substitute(GetPTagsFile() , '^\..', '', '') " Grep Dir and Extentions let g:GrepDir = g:bmsk_sw let g:GrepFiles = '*.c *.h *.kgs' - " cscope - let &cscopeprg = GetCscopePrg() - cscope kill -1 - let reffile = GetCscopeFile() - if (filereadable(reffile)) - execute 'cscope add' reffile - endif - call s:BmskRedrawMenu() call GetGoals() @@ -553,7 +515,6 @@ function GetAllMakeVars() let varnames['OutDir'] = 'OUTDIR' let varnames['ProductDir'] = 'OUTDIR_PRODUCTS' let varnames['DfilesDir'] = 'OUTDIR_D_FILES' - let varnames['bmsk_stand'] = 'OUTDIR_STAND' let varnames['OutDirVariante'] = 'OUTDIR_VARIANTE' let varnames['CscopePrg'] = 'CSCOPE' let varnames['CscopeFile'] = 'CSCOPEFILE' @@ -616,33 +577,6 @@ function GetProductDir() return g:ProductDir endfunction -" --------------------- -function GetDfilesDir() -" --------------------- - if !exists('g:DfilesDir') - let g:DfilesDir = GetMakeVar('D_FILES_DIR') - if (g:DfilesDir == '') - let g:DfilesDir = GetMakeVar('OUTDIR_D_FILES') - endif - if (g:DfilesDir != '') - let g:DfilesDir = fnamemodify(g:DfilesDir, ':p') - endif - endif - return g:DfilesDir -endfunction - -" -------------------- -function GetStandDir() -" -------------------- - if !exists('g:bmsk_stand') - let g:bmsk_stand = GetMakeVar('OUTDIR_STAND') - endif - if (g:bmsk_stand != '') - let g:bmsk_stand = fnamemodify(g:bmsk_stand, ':p') - endif - return g:bmsk_stand -endfunction - " -------------------------- function GetOutDirVariante() " -------------------------- @@ -655,61 +589,13 @@ function GetOutDirVariante() return g:OutDirVariante endfunction -" ---------------------- -function GetCscopePrg() -" ---------------------- - if !exists('g:CscopePrg') - let g:CscopePrg = GetMakeVar('CSCOPE') - endif - if (g:CscopePrg != '') - let g:CscopePrg = fnamemodify(g:CscopePrg, ':p') - endif - return g:CscopePrg -endfunction - -" ---------------------- -function GetCscopeFile() -" ---------------------- - if !exists('g:CscopeFile') - let g:CscopeFile = GetMakeVar('CSCOPEFILE') - endif - if (g:CscopeFile != '') - let g:CscopeFile = fnamemodify(g:CscopeFile, ':p') - endif - return g:CscopeFile -endfunction - -" --------------------- -function GetCTagsFile() -" --------------------- - if !exists('g:CTagsFile') - let g:CTagsFile = GetMakeVar('CTAGFILE') - endif - if (g:CTagsFile != '') - let g:CTagsFile = fnamemodify(g:CTagsFile, ':p') - endif - return g:CTagsFile -endfunction - -" --------------------- -function GetPTagsFile() -" --------------------- - if !exists('g:PTagsFile') - let g:PTagsFile = GetMakeVar('PTAGFILE') - endif - if (g:PTagsFile != '') - let g:PTagsFile = fnamemodify(g:PTagsFile, ':p') - endif - return g:PTagsFile -endfunction - " ----------------- function GetGoals() " ----------------- if !exists('g:Goals') let g:Goals = GetMakeVar('GOALS') endif - return g:Goals + return split(g:Goals) endfunction " ----------------------- @@ -739,14 +625,6 @@ command CleanSRCfile %s/^#\t\(\(r\d\{1,2\}\t\)\|\(not allocated\)\)\t\(\(\$\$\d\ " tags " ---- -command CscopeConnect call s:CscopeConnect() -function s:CscopeConnect() - let reffile = GetCscopeFile() - if (filereadable(reffile)) - execute 'cscope add' reffile - endif -endfunction - " significant characters in tags set taglength=0 set notagrelative @@ -759,23 +637,48 @@ command -nargs=? GrepBmsk call GrepFull(GetBmskSwDir(), '*.c *.h *.kgs', ' " ---------------- " Make and compile " ---------------- -"command -complete=custom,GetAllBmskTargets -nargs=* Make call s:Make('') -command -complete=custom,GetAllBmskTargets -nargs=* Bmsk call s:Make('') -command -complete=custom,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('') -command -nargs=* Clean compiler bmsk | Clean -command -nargs=* CleanAll compiler bmsk | CleanAll -command -nargs=* LintOld Bmsk lint file=%:p -command -nargs=* Lint Bmsk %:t:r.lint -command -complete=customlist,GetAllBmskSWStand -nargs=1 BmskAll call s:BmskAll('') +command -complete=customlist,GetAllBmskTargets -nargs=* Bmsk Make +command -complete=customlist,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('') +command -nargs=* Lint Make %:t:r.lint -" Programmstand compilieren -function s:Make(args) - echo a:args - cscope kill -1 - compiler bmsk - execute 'make!' a:args g:makeopts - CscopeConnect - clist +" make options +function GetBmskMakeOpts() + let makeopts = '' + if (g:Motor != '') + let makeopts = makeopts . ' Motor=' . g:Motor + endif + if (g:Muster != '') + let makeopts = makeopts . ' Muster=' . g:Muster + endif + if (g:Egas != '') + let makeopts = makeopts . ' Egas=' . g:Egas + endif + if (g:Xlint != '') + let makeopts = makeopts . ' DIAB_LINT_OPTION=' . g:Xlint + endif + if (g:SW_Stand != '') + let makeopts = makeopts . ' Stand=' . g:SW_Stand + endif + return makeopts +endfunction + +" reformat i-file +command ReformatIFile call Reformat_IFile() +function Reformat_IFile() abort + let cName = expand('%:t:r') . '.c' + let CR = '\' + DelAllMultipleEmptyLines + " do not wrap over end of file + setlocal nowrapscan + " go to top of file + execute 'normal gg' + " do unil error + while 1 + " delete until line of c-file + execute 'normal d/\c^# \d\+ ".*\(' . cName . '\)' . CR + " go to line of include-file + execute 'normal /\c^# \d\+ ".*\(' . cName . '\)\@') +" Targets function GetAllMakeGoals(...) + return g:GetAllMakeGoals() +endfunction +function s:GetDefaultMakeGoals(...) " evaluate make-goals if s:Variables['GOALS'] != '' try @@ -281,15 +295,41 @@ function GetAllMakeGoals(...) echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use' endif endfunction +let g:GetAllMakeGoals = function('s:GetDefaultMakeGoals') +" Options +function GetDefaultMakeOpts() + return '' +endfunction +let g:GetMakeOptsFunction = function("GetDefaultMakeOpts") function s:Make(args) + echo a:args cscope kill -1 - execute ':make ' . a:args - try - execute 'cscope add ' . s:Variables['VIM_CSCOPEFILE'] - endtry + let makeopts = g:GetMakeOptsFunction() + execute ':make ' . a:args . makeopts + call s:CscopeConnect() + clist endfunction +" ----------------- +" CSCOPE-Connection +" ----------------- +command CscopeConnect call s:CscopeConnect() +function s:CscopeConnect() + try + let cscopefile = s:Variables['VIM_CSCOPEFILE'] + if filereadable(cscopefile) + execute 'cscope add ' . cscopefile + elseif cscopefile == '' + echomsg 'cscope: Could not connect: Make-variable "VIM_CSCOPEFILE" is empty' + else + echomsg 'cscope: Could not connect: File ' . cscopefile . ' does not exist' + endif + catch /E716/ " Schlüssel nicht vorhanden + echomsg 'cscope: Could not connect: Make-variable "VIM_CSCOPEFILE" is empty' + endtry +endfunction + " ------------------ " Draw Vimsuite-Menu " ------------------ @@ -848,6 +888,25 @@ let g:DirDiffExcludes = '*.log,*.pyc,.svn,_ccmwaid.inf,.static_wa,out,tags,cscop " options for Vimball let g:vimball_home = expand(g:vimsuite . '/vimfiles') +" GetLatestVimScripts +command GetLatestVimScriptsThroughProxy call s:GetLatestVimScriptsThroughProxy() +function s:GetLatestVimScriptsThroughProxy() + " Get Proxy data + let proxy = input('Proxy: ', 'proxy.muc:8080') + let user = input('User: ', 'qx13468') + let password = inputsecret('Password: ') + let $http_proxy = 'http://' . user . ':' . password . '@' . proxy + " Set HOME for autoinstall + let home = $HOME + let $HOME=g:vimsuite + " Get the scripts + GetLatestVimScripts + " reset HOME + let $HOME = home +endfunction +let g:GetLatestVimScripts_wget= "c:/tools/wget/wget.exe" +let g:GetLatestVimScripts_mv= "move" + " merge command -nargs=+ Merge call Merge() function Merge(...) diff --git a/vimfiles.stefan/vimrc b/vimfiles.stefan/vimrc index 2e41449..595949e 100644 --- a/vimfiles.stefan/vimrc +++ b/vimfiles.stefan/vimrc @@ -205,16 +205,6 @@ set spelllang=de set spellfile=$VIM/myspell.add let &spellfile=&spellfile . ',' . g:vimfiles . '/spell/bmsk.add' -" ------------- -" other Plugins -" ------------- - -" GetLatestVimScripts -let $http_proxy='http://qx13468:tinaist1@proxy.muc:8080' -let g:GetLatestVimScripts_wget= "c:/tools/wget/wget.exe" -let g:GetLatestVimScripts_mv= "move" -"let $HOME=g:vimsuite - if exists('g:debug') if (g:debug > 0) echo 'loaded vimrc' diff --git a/vimfiles/GetLatest/GetLatestVimScripts.dat b/vimfiles/GetLatest/GetLatestVimScripts.dat index 789b89a..18eb43c 100644 --- a/vimfiles/GetLatest/GetLatestVimScripts.dat +++ b/vimfiles/GetLatest/GetLatestVimScripts.dat @@ -16,5 +16,5 @@ ScriptID SourceID Filename 948 2878 Scons Compiler plugin 1709 6421 Scons Syntax file 1772 6973 DAMOS.zip DAMOS tools (von Stefan) -987 6809 DoxygenToolkit.vim +987 6978 DoxygenToolkit.vim 1397 6887 xml.vim diff --git a/vimfiles/plugin/DoxygenToolkit.vim b/vimfiles/plugin/DoxygenToolkit.vim index 4cfdee7..a6a2ae1 100644 --- a/vimfiles/plugin/DoxygenToolkit.vim +++ b/vimfiles/plugin/DoxygenToolkit.vim @@ -1,9 +1,12 @@ " DoxygenToolkit.vim " Brief: Usefull tools for Doxygen (comment, author, license). -" Version: 0.1.16 -" Date: 02/27/07 +" Version: 0.1.17 +" Date: 04/15²07 " Author: Mathias Lorente " +" Note: Number of lines scanned is now configurable. Default value is still 10 +" lines. (Thanks to Spencer Collyer for this improvement). +" " Note: Bug correction : function that returns null pointer are correctly " documented (Thanks to Ronald WAHL for his report and patch). " @@ -257,6 +260,11 @@ else let g:DoxygenToolkit_ignoreForReturn = g:DoxygenToolkit_ignoreForReturn . " inline static virtual void" endif +" Maximum number of lines to check for function parameters +if !exists("g:DoxygenToolkit_maxFunctionProtoLines") + let g:DoxygenToolkit_maxFunctionProtoLines = 10 +endif + " Add name of function after pre brief tag if you want if !exists("g:DoxygenToolkit_briefTag_funcName") let g:DoxygenToolkit_briefTag_funcName = "no" @@ -311,14 +319,14 @@ function! DoxygenCommentFunc() endif " Get the entire function let l:count = 0 - while ( l:lineBuffer !~ l:argEnd && l:count < 10 ) + while ( l:lineBuffer !~ l:argEnd && l:count < g:DoxygenToolkit_maxFunctionProtoLines ) exec "normal j" let l:line = getline(line(".")) let l:lineBuffer = l:lineBuffer . ' ' . l:line let l:count = l:count + 1 endwhile " Function definition seem to be too long... - if ( l:count == 10 ) + if ( l:count == g:DoxygenToolkit_maxFunctionProtoLines ) " Restore standard comment expension let &comments = l:oldComments " Restore indentation