Angleichen VimSuite und Bmsk

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@135 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
qx13468 2007-04-16 12:46:25 +00:00
parent 0c7dbfc4be
commit 7c85ee1088
6 changed files with 169 additions and 247 deletions

View File

@ -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 = '\<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 . '\)\@<!"' . CR
endwhile
endfunction

View File

@ -23,34 +23,8 @@ command -complete=custom,GetAllBmskProjects -nargs=? SetBmskProject
\ call s:SetBmskProject('<args>')
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', '<args>
" ----------------
" Make and compile
" ----------------
"command -complete=custom,GetAllBmskTargets -nargs=* Make call s:Make('<args>')
command -complete=custom,GetAllBmskTargets -nargs=* Bmsk call s:Make('<args>')
command -complete=custom,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('<args>')
command -nargs=* Clean compiler bmsk | Clean <args>
command -nargs=* CleanAll compiler bmsk | CleanAll <args>
command -nargs=* LintOld Bmsk <args> lint file=%:p
command -nargs=* Lint Bmsk <args> %:t:r.lint
command -complete=customlist,GetAllBmskSWStand -nargs=1 BmskAll call s:BmskAll('<args>')
command -complete=customlist,GetAllBmskTargets -nargs=* Bmsk Make <args>
command -complete=customlist,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('<args>')
command -nargs=* Lint Make <args> %: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 = '\<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 . '\)\@<!"' . CR
endwhile
endfunction
" Dokumentation erzeugen (Verwenden des LaTeX errorparsers)
@ -825,44 +728,43 @@ function GetAllBmskSWStand(ArgLead, CmdLine, CursorPos)
endfunction
" Alle Make-Targets als Text Liste
function GetAllBmskTargets(ArgLead, CmdLine, CursorPos)
function GetAllBmskTargets(...)
let goals = GetGoals()
if goals == ''
let targets = 'Programmstand'
let targets = targets . "\n" . 'clean'
let targets = targets . "\n" . 'cleanall'
let targets = targets . "\n" . 'cleanProducts'
let targets = targets . "\n" . 'allTest'
let targets = targets . "\n" . 'allEntwickler'
let targets = targets . "\n" . 'allSerie'
let targets = targets . "\n" . 'patch_a2l'
let targets = targets . "\n" . 'check_memory'
let targets = targets . "\n" . 'create_csv'
let targets = targets . "\n" . 'create_arcus_csv'
let targets = targets . "\n" . 'import_arcus_csv'
let targets = targets . "\n" . 'boschsig'
let targets = targets . "\n" . 'archivate'
let targets = targets . "\n" . 'lint file=' . expand('%:p')
let targets = targets . "\n" . 'tags'
let targets = targets . "\n" . 'ctags'
let targets = targets . "\n" . 'ptags'
let targets = targets . "\n" . 'cscope'
let targets = targets . "\n" . 'ccm_products_checkout CCM=' . g:ccm
let targets = targets . "\n" . 'help'
if goals == []
let goals += ['Programmstand']
let goals += ['clean']
let goals += ['cleanall']
let goals += ['cleanProducts']
let goals += ['allTest']
let goals += ['allEntwickler']
let goals += ['allSerie']
let goals += ['patch_a2l']
let goals += ['check_memory']
let goals += ['create_csv']
let goals += ['create_arcus_csv']
let goals += ['import_arcus_csv']
let goals += ['boschsig']
let goals += ['archivate']
let goals += ['lint file=' . expand('%:p')]
let goals += ['tags']
let goals += ['ctags']
let goals += ['ptags']
let goals += ['cscope']
let goals += ['ccm_products_checkout CCM=' . g:ccm]
let goals += ['help']
else
let targets = substitute(goals, '\s\+', '\n', 'g')
let targets = targets . "\n" . expand('%:t:r') . '.obj'
let targets = targets . "\n" . expand('%:t:r') . '.i'
let targets = targets . "\n" . expand('%:t:r') . '.src'
let targets = targets . "\n" . expand('%:t:r') . '.lint'
let targets = targets . "\n" . 'FORCE_PROGID=no'
let targets = targets . "\n" . 'MAKE_DBG=2'
let targets = targets . "\n" . 'EXTRA_C_FLAGS='
let targets = targets . "\n" . 'DIAB_OPTIMIZE='
let targets = targets . "\n" . 'MAIN_MAKEFILES='
let targets = targets . "\n" . 'ALL_EXIT='
let goals += [expand('%:t:r') . '.obj']
let goals += [expand('%:t:r') . '.i']
let goals += [expand('%:t:r') . '.src']
let goals += [expand('%:t:r') . '.lint']
let goals += ['FORCE_PROGID=no']
let goals += ['MAKE_DBG=2']
let goals += ['EXTRA_C_FLAGS=']
let goals += ['DIAB_OPTIMIZE=']
let goals += ['MAIN_MAKEFILES=']
let goals += ['ALL_EXIT=']
endif
return targets
return goals
endfunction
" -----------------------------------

View File

@ -211,6 +211,8 @@ function s:SetProjectVariables()
echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use'
endif
catch /E716/ " Schlüssel nicht vorhanden
echomsg v:exception
catch
echoerr 'Error while reading make-variables: ' . v:exception
endtry
@ -226,8 +228,15 @@ function GetMakeVars(varNameList)
"echomsg command
let output = system(command)
let lines = split(output, "\n")
let RE = '^\(\w\+\)=\(.*\)\s*'
let SU = "let varlist['\\1']='\\2'"
if len(lines) == 1
" make output: value
let RE = '\(.*\)'
let SU = "let varlist['" . vars . "']='\\1'"
else
" make output: var=value
let RE = '^\(\w\+\)=\(.*\)\s*'
let SU = "let varlist['\\1']='\\2'"
endif
"echomsg 'getvars:'
for line in lines
"echomsg line
@ -237,11 +246,11 @@ function GetMakeVars(varNameList)
endfor
"echomsg ''
catch
echoerr 'Could not read make variables'
echomsg 'Could not read make variables'
endtry
if varlist == {}
echoerr 'Could not read any variables from makefile'
echomsg 'Could not read any variables from makefile'
echo 'Command:' command
echo 'Make output is:'
for line in lines
@ -255,10 +264,10 @@ endfunction
function GetMakeVar(varName)
let var = GetMakeVars([a:varName])
try
varValue = var[a:varName]
let varValue = var[a:varName]
catch
varValue = ''
echoerr 'Could not read make-variable "' . varName . '"'
let varValue = ''
echomsg 'Could not read make-variable "' . a:varName . '"'
endtry
return varValue
endfunction
@ -266,8 +275,13 @@ endfunction
" ------------------------------------------
" special make-command for target-completion
" ------------------------------------------
" Command
command -complete=customlist,GetAllMakeGoals -nargs=* Make call s:Make('<args>')
" 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(<args>)
function Merge(...)

View File

@ -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'

View File

@ -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

View File

@ -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! <SID>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