Änderungen bei Toptica

This commit is contained in:
Stefan Liebl 2016-09-28 13:43:44 +02:00
parent 2f83224df5
commit 6a5cae836e
16 changed files with 313 additions and 1317 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
.git
*.pyc *.pyc
.netrwhist .netrwhist
.VimballRecord .VimballRecord
myspell.add
myspell.add.spl

View File

@ -1,4 +1,3 @@
set nocompatible
" Verzeichnis, die dem die vimfiles-Verzeichnisse liegen: " Verzeichnis, die dem die vimfiles-Verzeichnisse liegen:
let g:vimsuite = expand($VIM . '/vimsuite') let g:vimsuite = expand($VIM . '/vimsuite')
"let g:vimsuite = expand($VIM . '/vimfiles.current') "let g:vimsuite = expand($VIM . '/vimfiles.current')
@ -7,8 +6,10 @@ let g:vimsuite = expand($VIM . '/vimsuite')
let g:vimfiles = expand(g:vimsuite . '/vimfiles.stefan') let g:vimfiles = expand(g:vimsuite . '/vimfiles.stefan')
" Einstellungen laden " Einstellungen laden
let g:WAs = ['~/daten/Programmieren/**']
execute 'source ' . expand(g:vimfiles . '/vimrc') execute 'source ' . expand(g:vimfiles . '/vimrc')
" Falls weitere Einstellungen geladen werden sollen, so kann dies hier " Falls weitere Einstellungen geladen werden sollen, so kann dies hier
" geschehen " geschehen
" source ... " source ...
"colorscheme Stefan

View File

@ -21,9 +21,7 @@ setlocal expandtab
" setlocal autoindent " setlocal autoindent
" setlocal smartindent " setlocal smartindent
setlocal cindent setlocal cindent
setlocal cinoptions=*200,)100,(s,w1,W4
let &l:shiftwidth = s:tabwidth let &l:shiftwidth = s:tabwidth
"setlocal formatoptions=croqwl
if (g:os == 'linux') if (g:os == 'linux')
setlocal tags+=/usr/include/tags setlocal tags+=/usr/include/tags
@ -31,7 +29,7 @@ if (g:os == 'linux')
setlocal tags+=/usr/src/include/linux/tags setlocal tags+=/usr/src/include/linux/tags
" filesearching " filesearching
setlocal path=.,/usr/include/** " setlocal path=.,/usr/include/**
endif endif
setlocal suffixesadd=.h setlocal suffixesadd=.h
@ -102,3 +100,8 @@ function! ReformatCSpaces()
" call AddSpaceAroundOperator('>=') " call AddSpaceAroundOperator('>=')
call AddSpaceAfter('if') call AddSpaceAfter('if')
endfunction endfunction
" use tt for rtags
map <buffer> tt <Bslash>rj
map <buffer> <C-T> <C-O>

View File

@ -7,6 +7,7 @@ setlocal shiftwidth=4
setlocal formatoptions=croq setlocal formatoptions=croq
setlocal tags+=/usr/lib/python/tags setlocal tags+=/usr/lib/python/tags
nnoremap <TAB> :YcmCompleter GoTo<CR>
" commenting " commenting
let b:commentstring = '#' let b:commentstring = '#'

View File

@ -2,13 +2,14 @@
" special keywords " special keywords
syntax keyword cType uint8 sint8 uint16 sint16 uint32 sint32 uint64 sint64 syntax keyword cType uint8 sint8 uint16 sint16 uint32 sint32 uint64 sint64
syntax keyword cType tuint8 tsint8 tuint16 tsint16 tuint32 tsint32 tuint64 tsint64 syntax keyword cType tuint8 tsint8 tuint16 tsint16 tuint32 tsint32 tuint64 tsint64
syntax keyword cType bool_t real_t int_t
syntax keyword cType float32 syntax keyword cType float32
syntax keyword cType DfpType SfpType SfpErrorType LWrd LInt syntax keyword cType DfpType SfpType SfpErrorType LWrd LInt
syntax keyword cType TickType syntax keyword cType TickType
syntax keyword Special ATOMIC BEGIN_ATOMIC END_ATOMIC syntax keyword Special ATOMIC BEGIN_ATOMIC END_ATOMIC
" debug " debug
syntax match cTodo "\(debug\)" "syntax match cTodo "\(debug\)"
" Lint-Komments and #ifdef's " Lint-Komments and #ifdef's
" Flexelint-Comment " Flexelint-Comment

View File

@ -1,42 +0,0 @@
" defaults for gcc
unlet current_compiler
execute('source ' . $VIMRUNTIME . '/compiler/gcc.vim')
" add german text
"set errorformat+=%D%*\\a[%*\\d]:\ Wechsel\ in\ das\ Verzeichnis\ »%f«
"set errorformat+=%X%*\\a[%*\\d]:\ Verlassen\ des\ Verzeichnisses\ »%f«
" defaults for python
"let s:shellpipe_save = &shellpipe
"let s:makeprg_save = &makeprg
"unlet current_compiler
"execute('source ' . g:vimsuite . '/vimfiles.stefan/compiler/python.vim')
"let &shellpipe = s:shellpipe_save
"let &makeprg = s:makeprg_save
"unlet s:shellpipe_save
"unlet s:makeprg_save
" -------
" PC-Lint
" -------
"set errorformat+=\"%f\"\\,\ line\ %l:\ %t%.%#\ \(pclint:%n\):%m
"set errorformat+=%t%.%#\ \(pclint:%n\):%m
" -------
" SP-Lint
" -------
set errorformat+=%A%f\(%l\):\ %m
set errorformat+=%A%f\(%l\):
set errorformat+=%A%f\(%l\\,%c\):\ %m
set errorformat+=%A%f\(%l\\,%c\):
set errorformat+=%C\ \ \ \ %m
" -----
" Tools
" -----
set errorformat+=%+G%.%#.exe:\ %m
set errorformat+=%+G%.%#.exe[%*\\d]:\ ***\ %m
" Error format from other programs: ...: ...
"set errorformat+=%+G%f:\ %m
let current_compiler = 'gcc-special'

View File

@ -1,232 +0,0 @@
" ===========================================================================
" File: bzr.vim
" Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: handles version controlling with subversion
" ===========================================================================
if !exists('g:bzr')
let g:bzr = 'bzr '
endif
let g:BZRlogfile = fnamemodify(tempname(),':h') . '/BZRmessage.log'
" --------
" commands
" --------
command -nargs=? BZRdiff silent call s:BZRdiff('<args>')
command -nargs=? BZRcommit call s:BZRcommit('<args>')
command -nargs=0 BZRstatus call s:BZRstatus()
command -nargs=0 BZRupdate call s:BZRupdate()
command -nargs=0 BZRlog call s:BZRlog()
command -nargs=? BZRadd call s:BZRadd('<args>')
command -nargs=0 BZRstudio call s:BZRstudio()
" ----
" Menu
" ----
let s:BZRMenuLocation = '100'
let s:BZRmenuname = '&VCS.&BZR.'
"-------------------------
function s:BZRRedrawMenu()
"-------------------------
exec 'anoremenu '.s:BZRMenuLocation.'.5 '.s:BZRmenuname.
\'&BZRstudio<tab>:BZRstudio'.
\' :BZRstudio<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.10 '.s:BZRmenuname.
\'&status<tab>:BZRstatus'.
\' :BZRstatus<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.15 '.s:BZRmenuname.
\'&update<tab>:BZRupdate'.
\' :BZRupdate<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.20 '.s:BZRmenuname.
\'&diff<tab>:BZRdiff'.
\' :BZRdiff<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.30 '.s:BZRmenuname.
\'&commit<tab>:BZRcommit'.
\' :BZRcommit<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.40 '.s:BZRmenuname.
\'&log<tab>:BZRlog'.
\' :BZRlog<CR>'
exec 'anoremenu '.s:BZRMenuLocation.'.50 '.s:BZRmenuname.
\'&add<tab>:BZRadd'.
\' :BZRadd<CR>'
endfunction
if !exists('nobzrmenu')
call s:BZRRedrawMenu()
endif
"----------------------------
function s:BZRcommit(logfile)
"----------------------------
if filereadable(a:logfile)
let options = '--file ' . a:logfile
elseif a:logfile == ''
let options = ''
else
echoerr 'Messagefile for BZRcommit not found: ' . a:logfile
return
endif
" save all files
wa
let expression = g:bzr . ' commit ' . options
echo expression
let output = system(expression)
echo output
let expression = g:bzr . ' update'
let output = system(expression)
echo output
if filereadable(a:logfile)
call delete(a:logfile)
endif
endfunction
"---------------------
function s:BZRupdate()
"---------------------
let expression = g:bzr . ' update'
let output = system(expression)
echo output
endfunction
"---------------------
function s:BZRstatus()
"---------------------
let expression = g:bzr . ' status'
let output = system(expression)
echo output
endfunction
"---------------------
function s:BZRlog()
"---------------------
let expression = g:bzr . ' log'
let output = system(expression)
echo output
endfunction
"------------------------
function s:BZRdiff(input)
"------------------------
" default
let revision = ''
if a:input == ''
" ohne Argument einfach aktuelles File mit Headrevision vergleichen
let filename = expand('%:p')
else
if filereadable(a:input)
" mit Filenamen einfach File mit Headrevision vergleichen
let filename = a:input
elseif str2nr(a:input) == a:input
" Argument ist die Revision, mit der verglichen werden soll
let revision = '-r '.a:input.' '
let filename = expand('%:p')
else
echo 'Falsches Argument: '.a:input
exit
endif
endif
if filereadable(filename)
" open file in new tab
execute 'tabnew ' . filename
" store filetype
let filetype = &filetype
" open headrevision
let headrevision = tempname()
let command = '!' . g:bzr . 'cat ' . revision . filename . ' > ' . headrevision
silent execute command
if winnr()==1
execute 'vsplit ' . headrevision
else
wincmd h
execute 'view ' . headrevision
endif
" set filetype
let &filetype=filetype
diffthis
wincmd l
diffthis
elseif isdirectory(filename)
echo filename . ' is a directory'
else
echoerr 'file ' . filename . ' not found'
endif
endfunction
"--------------------------
function s:BZRadd(filename)
"--------------------------
if a:filename == ''
let filename = expand('%:p')
else
let filename = a:filename
endif
let expression = g:bzr . ' add ' . filename
echo expression
let output = system(expression)
echo output
endfunction
"
"---------------------
function s:BZRstudio()
"---------------------
" Log-Message unten öffnen
setlocal splitbelow
silent execute '20split' g:BZRlogfile
w
" Status-Meldung in Temp-File umleiten
let tempfile = tempname()
" File anzeigen
silent execute 'vsplit' tempfile
call BZRwriteWindow(tempfile)
" Show differences
nmap <buffer> <CR> :execute 'BZRdiff' BZRstudioGetFilename(getline("."))<CR>
nmap <buffer> <C-l> :silent execute '!' . g:BZR . 'status > ' . g:BZRlogfile<CR>
nmap <buffer> <C-c> :execute 'BZRcommit' g:BZRlogfile<CR>
nmap <buffer> <C-a> :execute 'BZRadd' g:BZRlogfile<CR>
nmap <buffer> <C-s> :call BZRwriteWindow(expand('%:p'))<CR>
endfunction
"----------------------------
function BZRwriteWindow(file)
"----------------------------
normal ggdG
normal oBZR studio
normal ostatus message is displayed in this window
normal oenter log message in right hand window
normal o
normal o<CR> show differences of file under cursor
normal o<C-l> copy status-info to log-window
normal o<C-c> commit changes with logmessage in right window
normal o<C-a> add file under cursor to repository
normal o<C-s> update status window
normal o
normal o-------------------
normal o
w
let command = '!' . g:bzr . 'status >> ' . a:file
"echo command
silent execute command
e
endfunction
"---------------------------------
function BZRstudioGetFilename(line)
"---------------------------------
let filename = substitute(a:line, '.\s\+\(.\+\)', '\1', '')
return filename
endfunction
EchoDebug 'loaded bzr.vim'

View File

@ -1,531 +0,0 @@
" ===========================================================================
" File: ccm.vim
" Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: handles version controlling with Continuus
" ===========================================================================
if exists('g:noccm')
finish
endif
" --------------------------
" config datei für Continuus
" --------------------------
if !exists('g:ccm')
let g:ccm = 'ccm '
endif
" --------
" commands
" --------
command -nargs=0 CCMconnect call s:CCMconnect()
command -nargs=? CCMcheckout call s:CCMcheckout(expand('%:p'), '<args>')
command -nargs=? CCMcheckpoint call s:CCMcheckpoint(expand('%:p'), '<args>')
command -nargs=0 CCMchangeable call s:CCMchangeable('qx13468')
command -nargs=0 CCMdiff call s:CCMdiff(expand('%:p'))
command -nargs=0 CCMobject call s:CCM_get_object(expand('%:p'))
command -nargs=0 CCMhistory call s:CCMhistory(expand('%:p'))
" ----
" Menu
" ----
let s:CCMMenuLocation = 100
let s:CCMmenuname = '&VCS.&CCM.'
"-------------------------
function s:CCMRedrawMenu()
"-------------------------
exec 'anoremenu '.s:CCMMenuLocation.'.40 '.s:CCMmenuname.
\'check\ &out<tab>:CCMcheckout'.
\' :CCMcheckout<CR>'
exec 'anoremenu '.s:CCMMenuLocation.'.40 '.s:CCMmenuname.
\'check&point<tab>:CCMcheckpoint'.
\' :CCMcheckpoint ""<CR>'
exec 'anoremenu '.s:CCMMenuLocation.'.40 '.s:CCMmenuname.
\'&diff<tab>:CCMdiff'.
\' :CCMdiff<CR>'
exec 'anoremenu '.s:CCMMenuLocation.'.40 '.s:CCMmenuname.
\'show\ &history<tab>:CCMhistory'.
\' :CCMhistory<CR>'
endfunction
if !exists('noccmmenu')
call s:CCMRedrawMenu()
endif
" -------------------
" Regular Expressions
" -------------------
let s:any = '.*'
let s:word = '\(\w\+\)'
let s:noPathSeparator = '\([^/\\]\+\)'
"-----------------------------
function s:CCM_run_silent(cmd)
"-----------------------------
let expression = g:ccm .' '. a:cmd
echo expression
let output = system(expression)
return split(output, "\n")
endfunction
"----------------------
function s:CCM_run(cmd)
"----------------------
call s:CCMconnect()
let output = s:CCM_run_silent(a:cmd)
for line in output
echo line
endfor
echo '---'
return output
endfunction
let s:connected = 0
"-------------------------
function s:CCMconnected()
"-------------------------
let output = s:CCM_run_silent('status')
if (match(output, "Current project:") >= 0)
let s:connected = 1
endif
return s:connected
endfunction
"-----------------------
function s:CCMconnect()
"-----------------------
if !s:connected
if !s:CCMconnected()
let output = s:CCM_run_silent('start')
let s:connected = 1
endif
endif
endfunction
"---------------------------
function s:Set_compare_cmd()
"---------------------------
let vimdiff = g:gvim
let commands = ' -c ' . '\"winsize 201 60\" -c \"set winwidth=100\"'
let options = ' -d' . ' %file1 %file2' . ' --servername DIFF'
let compare_cmd = Double_quote(vimdiff . commands . options)
let output = s:CCM_run('set cli_compare_cmd ' . compare_cmd)
"let output = s:CCM_run('set compare_cmd')
endfunction
"---------------------------
function s:CCM_query(string)
"---------------------------
let query_string = 'query ' . a:string
let query_format = ' /nf /no_sort /u /f ' . '"%objectname"'
let output = s:CCM_run(query_string . query_format)
return output
endfunction
"-------------------------------
function s:CCM_get_owner(object)
"-------------------------------
let query_string = 'properties ' . a:object['objectname']
let query_format = ' /f ' . '"%owner"'
let output = s:CCM_run(query_string . query_format)
return output
endfunction
"--------------------------------
function s:CCM_long_query(string)
"--------------------------------
let query_string = 'query ' . a:string
let query_format = ' /u /f ' . '"%objectname %status %owner %task"'
let output = s:CCM_run(query_string . query_format)
return output
endfunction
"------------------------------------
function s:CCM_get_project(filename)
"------------------------------------
" in Verzeichnis des Files wechseln
let dirname = fnamemodify(a:filename, ':p:h')
let cwd_old = getcwd()
execute 'cd ' . dirname
" project ermitteln
let query_string = 'work_area -show '
let output = s:CCM_run(query_string)
for line in output
let projectname = substitute(line, '\(\S\+\).*', '\1', '')
endfor
if projectname == ''
echo 'No project found for ' . a:filename
echo '=============================='
echo ' '
endif
" Verzeichnis zurücksetzen
execute 'cd ' . cwd_old
let project = s:CCM_split_object(projectname)
return project
endfunction
"-----------------------------------
function s:CCM_get_object(filename)
"-----------------------------------
let basename = fnamemodify(a:filename, ':t')
let dirname = fnamemodify(a:filename, ':p:h')
let object = {}
let project = s:CCM_get_project(a:filename)
if project != {}
let query_string = '"'
\ . 'name=' . Single_quote(basename)
\ . ' and is_member_of(' . Single_quote(project['displayname']) . ')"'
let objectnames = s:CCM_query(query_string)
let object = s:CCM_choose_object(a:filename, objectnames, project)
if object == {}
echo 'no object found for ' . a:filename
else
echo object['objectname']
endif
else
echo 'No Project'
endif
return object
endfunction
"------------------------------------------------------------
function s:CCM_choose_object(filename, objectnames, project)
"------------------------------------------------------------
let result = {}
for line in a:objectnames
let object = s:CCM_split_object(line)
let objectpath = s:CCM_get_path(object, a:project)
let object['path'] = objectpath
if object['path'] == a:filename
let result = object
endif
endfor
return result
endfunction
"---------------------------------------
function s:CCM_split_object(objectname)
"---------------------------------------
let object = {}
let reName = '\([^-]\+\)'
let reVersion = '\([^:]\+\)'
let reType = '\([^:]\+\)'
let reInstance = '\(\d\+\)'
let regexp = reName.'-'.reVersion
let regexp = regexp.'\%('.':'.reType.':'.reInstance
let regexp = regexp.'\)\?'
let object['name'] = substitute(a:objectname, regexp, '\1', '')
let object['version'] = substitute(a:objectname, regexp, '\2', '')
let object['type'] = substitute(a:objectname, regexp, '\3', '')
let object['instance'] = substitute(a:objectname, regexp, '\4', '')
let object['displayname'] = object['name'].'-'.object['version']
let object['objectname'] = object['displayname'].':'.object['type'].':'.object['instance']
return object
endfunction
"----------------------------------------
function s:CCM_get_path(object, project)
"----------------------------------------
let query_string = 'finduse'
\ .' /n "'.a:object['name'].'"'
\ .' /v "'.a:object['version'].'"'
\ .' /t "'.a:object['type'].'"'
\ .' /i "'.a:object['instance'].'"'
\ .' /working_proj'
let lines = s:CCM_run(query_string)
for line in lines
let regexp = '.*\s\(\S*' . a:object['name'] . '\)-'.a:object['version'].'@' . a:project['displayname']
let relpath = substitute(line, regexp, '\1', '')
let foundpath = findfile(relpath)
if foundpath == ''
let relpath = substitute(relpath, '[^/\\]\+[/\\]\(.*\)', '\1', '')
let foundpath = findfile(relpath)
endif
if foundpath != ''
let path = fnamemodify(foundpath, ':p')
return path
endif
endfor
return ''
endfunction
"-----------------------------------
function s:CCM_get_successor(object)
"-----------------------------------
let query_string = 'is_successor_of(' . Single_quote(a:object['objectname']) . ')'
let predecessor = s:CCM_query(query_string)
if predecessor == ''
echo 'no successor found for ' . a:object['objectname']
else
" delete <CR>
let predecessor = matchstr(predecessor, '\p\+')
endif
return predecessor
endfunction
"-------------------------------------
function s:CCM_get_predecessor(object)
"-------------------------------------
let query_string = 'is_predecessor_of(' . Single_quote(a:object['objectname']) . ')'
let query_answer = s:CCM_query(query_string)
let predecessor = {}
if query_answer[0] == ''
echo 'no predecessor found for ' . a:object['objectname']
else
let predecessorname = matchstr(query_answer, '\p\+')
let predecessor = s:CCM_split_object(predecessorname)
endif
return predecessor
endfunction
"-----------------------------------
function s:CCM_get_hist_root(object)
"-----------------------------------
let query_string = '"'
\ . 'name=' . Single_quote(a:object['name'])
\ . ' and instance=' . Single_quote(a:object['instance'])
\ . ' and is_hist_root()"'
let hist_root = s:CCM_query(query_string)
if hist_root == ''
echo 'no hist_root found for ' . a:object['objectname']
else
let hist_root = matchstr(hist_root, '\p\+')
endif
return hist_root
endfunction
"--------------------------------
function s:CCM_get_default_task()
"--------------------------------
let output = s:CCM_run('task /default')
if match(output[0], '\d\+') >= 0
let task = matchstr(output[0], '\d\+')
else
let task = 'none'
endif
return task
endfunction
"--------------------------------------------------
function s:CCM_check_out(object, project, comment)
"--------------------------------------------------
let default_task = s:CCM_get_default_task()
if default_task == 'none'
echo 'no default task!'
else
let comment = '/comment "' . a:comment . '"'
let task = '/task ' . default_task
let project = '/project ' . a:project['displayname']
let object = a:object['objectname']
let expression = 'checkout ' . comment .' '. task . ' '. object
" cd to directory
let objectpath = s:CCM_get_path(a:object, a:project)
let old_cwd = getcwd()
execute 'cd ' . fnamemodify(objectpath, ':p:h')
let output = s:CCM_run(expression)
" go back
execute 'cd ' . old_cwd
endif
endfunction
"----------------------------------------------
function s:CCM_check_in(object, state, comment)
"----------------------------------------------
let comment = '/comment "' . a:comment . '" '
let state = '/state ' . a:state . ' '
let expression = 'checkin ' . comment . state . a:object['objectname']
echo 'comment:' . comment
echo 'state:' . state
echo 'expression:' . expression
echo 'execute'
let output = s:CCM_run(expression)
endfunction
"----------------------------------------
function s:CCMcheckout(filename, comment)
"----------------------------------------
let object = s:CCM_get_object(a:filename)
let project = s:CCM_get_project(a:filename)
if object != {}
let output = s:CCM_check_out(object, project, a:comment)
endif
endfunction
"------------------------------------------
function s:CCMcheckpoint(filename, comment)
"------------------------------------------
let object = s:CCM_get_object(a:filename)
if object != {}
if (a:comment == '')
if has('gui')
let l:comment = inputdialog('comment:')
else
echo 'enter a comment'
return
endif
else
let l:comment = a:comment
endif
let state = 'checkpoint'
let output = s:CCM_check_in(object, state, l:comment)
endif
endfunction
"------------------------------
function s:CCMchangeable(owner)
"------------------------------
let object = ''
if project == '?'
let owner = 'owner=' . Single_quote(a:owner)
let project = ' and project=' . Single_quote('bmsk')
let released = ' and status!=' . Single_quote('released')
let integrate = ' and status!=' . Single_quote('integrate')
let rejected = ' and status!=' . Single_quote('rejected')
let status = released . integrate . rejected
let query_string = '"' . owner . project . status . '"'
let object = s:CCM_long_query(query_string)
endif
if object == ''
echo 'no working objects found for ' . a:owner
endif
return object
endfunction
"---------------------------
function s:CCMdiff(filename)
"---------------------------
let object = s:CCM_get_object(a:filename)
if object != {}
let predecessor = s:CCM_get_predecessor(object)
if predecessor != {}
let output = s:CCM_run_silent('diff /g ' . predecessor['objectname'] . ' ' . a:filename)
endif
endif
endfunction
"---------------------------------
function s:CCM_view_object(object)
"---------------------------------
let file_content = s:CCM_run_silent('type ' . a:object['objectname'])
return file_content
endfunction
"------------------------------
function s:CCMhistory(filename)
"------------------------------
let object = s:CCM_get_object(a:filename)
if object != {}
let expression = 'history /g ' . object['objectname']
let output = s:CCM_run(expression)
endif
endfunction
"-----------------------
function s:Wait(seconds)
"-----------------------
let starttime = localtime()
while ((localtime() - starttime) < a:seconds)
endwhile
endfunction
"------------------------------
" Funktionen für Change Synergy
"------------------------------
"command ChangeSynergyBeautify call s:ChangeSynergyBeautify()
command ChangeSynergyCreateCRTaskList call s:ChangeSynergyCreateCRTaskList()
command ChangeSynergyCreateCRList call s:ChangeSynergyCreateCRList()
command ChangeSynergyCreateTaskList call s:ChangeSynergyCreateTaskList()
let s:CR_text = 'CR '
let s:Task_text = 'Task '
" Umformatieren der CR-Liste aus dem ChangeSynergy Bericht
function s:ChangeSynergyBeautify()
DelAllMultipleEmptyLines
call s:ChangeSynergyDeleteRejected()
call s:ChangeSynergyFormatTasks()
call s:ChangeSynergyFormatCRs()
endfunction
" Liste mit allen CRs incl. Tasks aus Bericht
function s:ChangeSynergyCreateCRTaskList()
call s:ChangeSynergyBeautify()
let RE = '^\(' . s:CR_text . '.*\)'
execute ':%s/' . RE . '/\r\1/e'
normal ggdddw
endfunction
" Liste mit allen CRs aus Bericht
function s:ChangeSynergyCreateCRList()
call s:ChangeSynergyBeautify()
let RE = '^' . s:Task_text . '.*\n'
execute ':%s/' . RE . '//e'
execute ':3,$sort'
endfunction
" Liste mit allen Tasks aus Bericht
function s:ChangeSynergyCreateTaskList()
call s:ChangeSynergyBeautify()
let RE = '^' . s:CR_text . '.*\n'
execute ':%s/' . RE . '//e'
execute ':3,$sort'
endfunction
" Löschen der CRs mit Status 'rejected'
function s:ChangeSynergyDeleteRejected()
let RE = s:ComposeCrTaskRE('rejected')
execute ':%s/' . RE . '//e'
endfunction
" Task umfomatieren
function s:ChangeSynergyFormatTasks()
let RE = '\%('
\ . 'Task Number:\s\+\(\d\+\)'
\ . '\s\+'
\ . 'Resolver:\s\+\(.\+\)'
\ . '\s\+'
\ . 'Status:\s\+\(\w\+\)'
\ . '\n'
\ . 'Synopsis:\s\+\(.*\)'
\ . '\n'
\ . '\)'
" execute '%:s/' . RE . '/' . s:Task_text . '\1\t\2:\t\4/e'
execute '%:s/' . RE . '/\=printf("%s%4s %-32s: %s", s:Task_text, submatch(1), submatch(2), submatch(4))/e'
endfunction
" CR umfomatieren
function s:ChangeSynergyFormatCRs()
let RE = '\%('
\ . 'CR ID:\s\+\(\d\+\)'
\ . '\s\+'
\ . 'Resolver:\s\+\(.\+\)'
\ . '\s\+'
\ . 'Status:\s\+\(\w\+\)'
\ . '\n'
\ . 'Synopsis:\s\+\(.*\)'
\ . '\n'
\ . '\)'
" execute '%:s/' . RE . '/' . s:CR_text . '\1\t\2:\t\4/e'
execute '%:s/' . RE . '/\=printf("%s %4s %-32s: %s", s:CR_text, submatch(1), submatch(2), submatch(4))/e'
endfunction
" Zusammensetzen der Regular Expression für ChangeRequests aus dem Bericht
" Open PST + CR + Task
function s:ComposeCrTaskRE(CRstatus)
if a:CRstatus == ''
let CRstatus = '\w\+'
else
let CRstatus = a:CRstatus
endif
let taskRE = '\(Task Number:.*\nSynopsis:.*\n\n\)'
let crRE = 'CR ID:.*Status:\s\+\(' . CRstatus . '\)\nSynopsis:.*\n\%(\s*\n\)*' . taskRE . '*'
return crRE
endfunction
EchoDebug 'loaded ccm.vim'

View File

@ -1,77 +0,0 @@
" ===========================================================================
" File: cvs.vim
" Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: handles version controlling with CVS
" ===========================================================================
" --------------------
" config datei für CVS
" --------------------
if !exists('g:cvs')
let g:cvs = 'cvs '
endif
" --------
" commands
" --------
"command -nargs=0 CHANGEABLE call GetChangeable('qx13468')
command -nargs=0 CVSdiff call s:CVSshowDifferences(expand('%:t'))
command -nargs=0 CVSedit call s:CVSedit(expand('%:t'))
command -nargs=0 CVSunedit call s:CVSunedit(expand('%:t'))
command -nargs=0 CVScommit call s:CVScommit(expand('%:t'))
command -nargs=0 CVSstatus call s:CVSstatus(expand('%:t'))
"---------------------------
function s:CVSedit(filename)
"---------------------------
let expression = g:cvs . ' edit ' . a:filename
let output = system(expression)
execute(':edit')
echo output
endfunction
"-----------------------------
function s:CVSunedit(filename)
"-----------------------------
let expression = g:cvs . ' unedit ' . a:filename
let output = system(expression)
execute(':edit')
echo output
endfunction
"-----------------------------
function s:CVScommit(filename)
"-----------------------------
let expression = g:cvs . ' commit ' . a:filename
let output = system(expression)
execute(':edit')
echo output
endfunction
"-----------------------------
function s:CVSstatus(filename)
"-----------------------------
let expression = g:cvs . ' status ' . a:filename
let output = system(expression)
execute(':edit')
echo output
endfunction
"--------------------------------------
function s:CVSdiff(filename, patchfile)
"--------------------------------------
silent execute '!' . g:cvs ' diff -u ' . a:filename . ' > ' . a:patchfile
endfunction
"--------------------------------------
function s:CVSshowDifferences(filename)
"--------------------------------------
let patchfile = tempname()
echo 'patchfile: ' . patchfile
call s:CVSdiff(a:filename, patchfile)
setlocal patchexpr=ReversePatch()
execute 'vertical diffpatch ' . patchfile
endfunction
EchoDebug 'loaded cvs.vim'

View File

@ -1,280 +0,0 @@
" ===========================================================================
" File: svn.vim
" Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: handles version controlling with subversion
" ===========================================================================
if !exists('g:svn')
let g:svn = 'svn '
endif
let g:SVNlogfile = fnamemodify(tempname(),':h') . '/SVNmessage.log'
" --------
" commands
" --------
command -nargs=? SVNdiff silent call s:SVNdiff('<args>')
command -nargs=? SVNcommit call s:SVNcommit('<args>')
command -nargs=0 SVNstatus call s:SVNstatus()
command -nargs=0 SVNupdate call s:SVNupdate()
command -nargs=0 SVNlog call s:SVNlog()
command -nargs=? SVNadd call s:SVNadd('<args>')
command -nargs=0 SVNstudio call s:SVNstudio()
" ----
" Menu
" ----
let s:SVNMenuLocation = 100
let s:SVNmenuname = '&VCS.&SVN.'
"-------------------------
function s:SVNRedrawMenu()
"-------------------------
exec 'anoremenu '.s:SVNMenuLocation.'.5 '.s:SVNmenuname.
\'&SVNstudio<tab>:SVNstudio'.
\' :SVNstudio<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.10 '.s:SVNmenuname.
\'&status<tab>:SVNstatus'.
\' :SVNstatus<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.15 '.s:SVNmenuname.
\'&update<tab>:SVNupdate'.
\' :SVNupdate<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.20 '.s:SVNmenuname.
\'&diff<tab>:SVNdiff'.
\' :SVNdiff<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.30 '.s:SVNmenuname.
\'&commit<tab>:SVNcommit'.
\' :SVNcommit<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.40 '.s:SVNmenuname.
\'&log<tab>:SVNlog'.
\' :SVNlog<CR>'
exec 'anoremenu '.s:SVNMenuLocation.'.50 '.s:SVNmenuname.
\'&add<tab>:SVNadd'.
\' :SVNadd<CR>'
endfunction
if !exists('nosvnmenu')
call s:SVNRedrawMenu()
endif
"----------------------------
function s:SVNcommit(logfile)
"----------------------------
if filereadable(a:logfile)
let options = '--file ' . a:logfile
elseif a:logfile == ''
let options = ''
else
echoerr 'Messagefile for SVNcommit not found: ' . a:logfile
return
endif
" save all files
wa
let expression = g:svn . ' commit ' . options
echo expression
let output = system(expression)
echo output
let expression = g:svn . ' update'
let output = system(expression)
echo output
if filereadable(a:logfile)
call delete(a:logfile)
endif
endfunction
"---------------------
function s:SVNupdate()
"---------------------
let expression = g:svn . ' update'
let output = system(expression)
echo output
endfunction
"---------------------
function s:SVNstatus()
"---------------------
let expression = g:svn . ' status'
let output = system(expression)
echo output
endfunction
"---------------------
function s:SVNlog()
"---------------------
let expression = g:svn . ' log'
let output = system(expression)
echo output
endfunction
"------------------------
function s:SVNdiff(input)
"------------------------
" default
let revision = ''
if a:input == ''
" ohne Argument einfach aktuelles File mit Headrevision vergleichen
let filename = expand('%:p')
else
if filereadable(a:input)
" mit Filenamen einfach File mit Headrevision vergleichen
let filename = a:input
elseif str2nr(a:input) == a:input
" Argument ist die Revision, mit der verglichen werden soll
let revision = '-r '.a:input.' '
let filename = expand('%:p')
else
echo 'Falsches Argument: '.a:input
exit
endif
endif
if filereadable(filename)
" open file in new tab
execute 'tabnew ' . filename
" store filetype
let filetype = &filetype
" open headrevision
let headrevision = tempname()
let command = '!' . g:svn . 'cat ' . revision . filename . ' > ' . headrevision
silent execute command
if winnr()==1
execute 'vsplit ' . headrevision
else
wincmd h
execute 'view ' . headrevision
endif
" set filetype
let &filetype=filetype
diffthis
wincmd l
diffthis
elseif isdirectory(filename)
echo filename . ' is a directory'
else
echoerr 'file ' . filename . ' not found'
endif
endfunction
"--------------------------
function s:SVNadd(filename)
"--------------------------
if a:filename == ''
let filename = expand('%:p')
else
let filename = a:filename
endif
let expression = g:svn . ' add ' . filename
echo expression
let output = system(expression)
echo output
endfunction
"--------------------------------
function SVNgetModifiedFiles(...)
"--------------------------------
let files = []
if a:0 > 0
let r1 = a:1
if a:0 > 1
let r2 = a:2
if str2nr(r1) > str2nr(r2)
let r = r2
let r2 = r1
let r1 = r
endif
else
let r2 = 'HEAD'
endif
let expression = g:svn . ' log --verbose --revision ' . r1 . ':' . r2
let re = '^\s\+\([AMR]\)\s\+\S*/\(src/\S*\)\(\s\+.*\)\?'
else
let expression = g:svn . ' status'
let re = '^\([AMR]\)......\s*\(\S*\)'
endif
let output = system(expression)
let lines = split(output, '\n')
for line in lines
let file = substitute(line, re, '\2', '')
if file == line
continue
endif
call add(files, file)
endfor
for file in files
endfor
return files
endfunction
"------------------------------------
function SVNgrepModified(regexp, ...)
"------------------------------------
execute 'let files = SVNgetModifiedFiles(' . join(a:000, ',') . ')'
if empty(files)
echo 'no files changed'
else
let command = 'vimgrep /'.a:regexp.'/g ' . join(files, ' ')
echo command
execute command
endif
endfunction
"---------------------
function s:SVNstudio()
"---------------------
" Log-Message unten öffnen
setlocal splitbelow
silent execute '20split' g:SVNlogfile
w
" Status-Meldung in Temp-File umleiten
let tempfile = tempname()
" File anzeigen
silent execute 'vsplit' tempfile
call SVNwriteWindow(tempfile)
" Show differences
nmap <buffer> <CR> :execute 'SVNdiff' SVNstudioGetFilename(getline("."))<CR>
nmap <buffer> <C-l> :silent execute '!' . g:svn . 'status > ' . g:SVNlogfile<CR>
nmap <buffer> <C-c> :execute 'SVNcommit' g:SVNlogfile<CR>
nmap <buffer> <C-a> :execute 'SVNadd' g:SVNlogfile<CR>
nmap <buffer> <C-s> :call SVNwriteWindow(expand('%:p'))<CR>
endfunction
"----------------------------
function SVNwriteWindow(file)
"----------------------------
normal ggdG
normal oSVN studio
normal ostatus message is displayed in this window
normal oenter log message in right hand window
normal o
normal o<CR> show differences of file under cursor
normal o<C-l> copy status-info to log-window
normal o<C-c> commit changes with logmessage in right window
normal o<C-a> add file under cursor to repository
normal o<C-s> update status window
normal o
normal o-------------------
normal o
w
let command = '!' . g:svn . 'status >> ' . a:file
"echo command
silent execute command
e
endfunction
"---------------------------------
function SVNstudioGetFilename(line)
"---------------------------------
let filename = substitute(a:line, '.\s\+\(.\+\)', '\1', '')
return filename
endfunction
EchoDebug 'loaded svn.vim'

View File

@ -0,0 +1,104 @@
command DlcPro call s:ProjectDlcproSet()
function s:ProjectDlcproSet()
compiler gcc
let s:makegoals = ['artifacts', 'device-control', 'user-interface', 'doxygen']
let s:makeopts = ['-j4']
let s:ProjectBaseDir = '/home/liebl/dlcpro/firmware'
let s:ProjectSrcDir = s:ProjectBaseDir.'/src'
let s:ProjectBuildDir = s:ProjectBaseDir.'/build'
let g:Program = s:ProjectBuildDir.'/device-control/device-control'
execute 'cd '.s:ProjectSrcDir
execute 'set path-=./**'
execute 'set path+=' . s:ProjectBaseDir.'/**'
set wildignore+=**/shg-firmware/**
let g:GdbHost = 'dlcpro_stefan'
let g:GdbPort = '2345'
let s:GdbSlave = '~/tools/gdb-slave.sh'
set spell spelllang=en,de
set expandtab
set cinoptions=:2,=2,l1,g2,h2,N-2,t0,+0,(0,w1,Ws,m1,)100,*100
command! -complete=custom,GetAllMakeCompletions -nargs=* Make call s:Make('<args>')
command! DlcProFirmwareUpdate call CopyFirmware('update')
command! DlcProFirmwareDebug call CopyFirmware('debug')
command! DlcProFirmwareStart call CopyFirmware('start')
command! DlcProDebug call DlcProDebug(g:Program)
" vc-plugin
let g:vc_branch_url = ['https://svn.toptica.com/svn/DiSiRa/SW/firmware/branches']
let g:vc_trunk_url = 'https://svn.toptica.com/svn/DiSiRa/SW/firmware/trunk'
" vim-clang
" let g:clang_cpp_options = '-std=c++11'
" let g:clang_compilation_database = s:ProjectBuildDir
" YouCompleteMe plugin
"set completeopt-=preview
"let g:ycm_add_preview_to_completeopt = 0
"let g:ycm_autoclose_preview_window_after_completion = 0
"let g:ycm_autoclose_preview_window_after_insertion = 0
"let g:ycm_key_previous_completion = ['<TAB>', '<Down>', '<Enter>']
let g:ycm_extra_conf_globlist = [
\'~/dlcpro/firmware/.ycm_extra_conf.py',
\'!~/tools/vimsuite/vimfiles.YouCompleteMe/*',
\]
" GdbFromVim plugin
let g:gdb_from_vim_log = 1
let g:gdb_from_vim_path = '/opt/OSELAS.Toolchain-2012.12.1/arm-cortexa8-linux-gnueabi/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/arm-cortexa8-linux-gnueabi-gdb'
" DlcPro configuration
let g:gdb_slave_script = '~/tools/gdb-slave.sh'
endfunction
" ====
" Make
" ====
function s:GetMakeOptions(args)
let makeopts = a:args
return makeopts
endfunction
function GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
return join(s:makegoals + s:makeopts + glob(a:ArgLead.'*', 1, 1), "\n")
endfunction
function s:Make(args)
echo a:args
execute 'cd '.s:ProjectBuildDir.' | make ' . s:GetMakeOptions(a:args) . ' | cd -'
execute 'cd '.s:ProjectSrcDir
try
clist
catch /E42/ " list is empty
echo 'no output'
endtry
endfunction
function CopyFirmware(command)
let command = 'bash '.s:GdbSlave.' -h '.g:GdbHost.' '.a:command
if a:command == 'update'
let command .= ' '.g:Program
endif
echom command
call system(command)
endfunction
function DlcProDebugGfV(program)
execute 'GdbFromVimRemote ' g:GdbHost ':' g:GdbPort
execute 'GdbFromVimSymbolFile ' g:Program
" GdbFromVimContinue
" execute 'D set sysroot '.s:ProjectBuildDir.'/dlcpro-sdk/sysroot-target'
endfunction
function DlcProDebug(program)
DlcProFirmwareDebug
let g:pyclewn_terminal = 'konsole, -e'
Pyclewn gdb
Cmapkeys
sleep 1
execute 'Ctarget remote ' g:GdbHost.':'.g:GdbPort
sleep 1
execute 'Cfile ' g:Program
" Ccontinue
endfunction

View File

@ -1,8 +1,7 @@
" =========================================================================== " ===========================================================================
" File: tools.vim " File: vimsuite.vim
" Author: Stefan Liebl (S.Liebl@gmx.de) " Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: some usefull tools " Description: some usefull tools
" Revision: $LastChangedRevision: 60 $
" =========================================================================== " ===========================================================================
" ---------------- " ----------------
@ -26,11 +25,6 @@ let g:projectsFile = fnamemodify($VIMRUNTIME . '/../projects.txt', ':p')
" SetProject " SetProject
" ---------- " ----------
command -complete=customlist,GetAllProjectFiles -nargs=? SetProject call s:SetProject('<args>') command -complete=customlist,GetAllProjectFiles -nargs=? SetProject call s:SetProject('<args>')
" only for backward compatibility
command -nargs=? SetBmskProject
\ execute 'source ' . g:vimfiles . '/tools/bmsk.vim'
\ | SetBmskProject <args>
"function GetAllProjectFiles(ArgLead, CmdLine, CursorPos) "function GetAllProjectFiles(ArgLead, CmdLine, CursorPos)
function GetAllProjectFiles(...) function GetAllProjectFiles(...)
let makefilePaths = [] let makefilePaths = []
@ -333,11 +327,7 @@ endfunction
" ------- " -------
" Session " Session
" ------- " -------
if (v:version > 602) command -complete=custom,GetAllSessions -nargs=? SessionLoad call s:SessionLoad('<args>')
command -complete=custom,GetAllSessions -nargs=? SessionLoad call s:SessionLoad('<args>')
else
command -nargs=? SessionLoad call s:SessionLoad('<args>')
endif
function s:SessionLoad(SessionFile) function s:SessionLoad(SessionFile)
if ((a:SessionFile == '') && has('browse')) if ((a:SessionFile == '') && has('browse'))
" Browse for session-file " Browse for session-file
@ -345,7 +335,7 @@ function s:SessionLoad(SessionFile)
let l:browsefilter = b:browsefilter let l:browsefilter = b:browsefilter
endif endif
let b:browsefilter = "Vim Sessions (*.vim)\t*.vim\nAll Files (*.*)\t*.*" let b:browsefilter = "Vim Sessions (*.vim)\t*.vim\nAll Files (*.*)\t*.*"
let SessionFile = browse(0, 'Select Session', $VIMRUNTIME . '/..', '') let SessionFile = browse(0, 'Select Session', '.', '')
if exists('l:browsefilter') if exists('l:browsefilter')
let b:browsefilter = l:browsefilter let b:browsefilter = l:browsefilter
endif endif
@ -353,12 +343,28 @@ function s:SessionLoad(SessionFile)
let SessionFile = a:SessionFile let SessionFile = a:SessionFile
endif endif
if filereadable(SessionFile) if filereadable(SessionFile)
execute('source ' . SessionFile) let g:sessionfile = SessionFile
" load session
execute('source ' . g:sessionfile)
" set autocmd to save session on exit
autocmd VimLeavePre * execute 'mksession!' g:sessionfile
" reset search path to session folder
set path+=./**
else else
echo 'No such File:' SessionFile echo 'No such File:' SessionFile
endif endif
endfunction endfunction
" Load .session.vim, if available in current directory and save on exit
if argc() == 0 " skip, if command-line-parameters were given
if !exists('g:sessionfile') && filereadable('.session.vim')
let g:sessionfile = '.session.vim'
endif
if exists('g:sessionfile') && filereadable(g:sessionfile)
call s:SessionLoad(g:sessionfile)
endif
endif
command -nargs=? SessionSave call s:SessionSave('<args>') command -nargs=? SessionSave call s:SessionSave('<args>')
command -nargs=? Exit SessionSave <args>|exit command -nargs=? Exit SessionSave <args>|exit
function s:SessionSave(SessionName) function s:SessionSave(SessionName)
@ -369,7 +375,7 @@ function s:SessionSave(SessionName)
let l:browsefilter = b:browsefilter let l:browsefilter = b:browsefilter
endif endif
let b:browsefilter = "Vim Sessions (*.vim)\t*.vim\nAll Files (*.*)\t*.*" let b:browsefilter = "Vim Sessions (*.vim)\t*.vim\nAll Files (*.*)\t*.*"
let SessionName = browse(1, 'Select Session File', $VIMRUNTIME . '/..', 'Session.vim') let SessionName = browse(1, 'Select Session File', '.', '.session.vim')
if exists('l:browsefilter') if exists('l:browsefilter')
let b:browsefilter = l:browsefilter let b:browsefilter = l:browsefilter
endif endif
@ -408,7 +414,40 @@ endfunction
function s:RedrawSessionMenu() function s:RedrawSessionMenu()
call s:DelSessions() call s:DelSessions()
" call s:AddAllKnownSessionsToMenu() call s:AddAllKnownSessionsToMenu()
endfunction
function s:AddAllKnownSessionsToMenu()
" set path from g:WAs
if exists('g:WAs')
for wa in g:WAs
" echom 'wa:' . wa . ':'
execute 'set path+=' . wa
endfor
endif
" search all session files in path
if !exists('g:SessionFileNames')
let g:SessionFileNames = [
\ '.session.vim',
\ 'Session.vim',
\]
endif
" echom 'SessionFileNames:' . join(g:SessionFileNames, ', ') . ':'
let sessionfiles_wa = []
for SessionFileName in g:SessionFileNames
let sessionfiles_wa += findfile('.session.vim', &path, -1)
" echom 'sessions:' . join(sessionfiles_wa, ', ') . ':'
endfor
" Add sessions to Gvim menu
for sessionfile in sessionfiles_wa
let cmd = 'anoremenu '.s:VimSuiteMenuLocation.'.40 '.s:VimSuiteMenuName.
\'Session.Load\ '. escape(sessionfile, '.') . '<tab>:SessionLoad'.
\' :SessionLoad ' . sessionfile . '<CR>'
" echom 'Command:' . cmd . ':'
exec cmd
endfor
endfunction endfunction
function s:RedrawMenu() function s:RedrawMenu()
@ -696,15 +735,6 @@ function ConvertUTF8()
silent! %s/&#226;&#130;&#172;/€/ " € silent! %s/&#226;&#130;&#172;/€/ " €
endfunction endfunction
" insert history comment
command HistoryComment call HistComment()
function HistComment()
let l:date = GetDate()
execute 'normal O' . l:date . ' IST_LIEBL'
execute 'normal o'
execute 'normal k$'
endfunction
" find all non-extern functions in h-files " find all non-extern functions in h-files
function FindDeclaration() function FindDeclaration()
let bmsk_sw = g:bmsk_sw let bmsk_sw = g:bmsk_sw
@ -782,30 +812,6 @@ function IndentWordNum(wordNum, pos)
call cursor(cursorLine, cursorCol) call cursor(cursorLine, cursorCol)
endfunction endfunction
" ----------------
" Comment In / Out
" ----------------
nnoremap <C-K> :call CommentInOut(b:commentstring)<CR>j
command CommentInOut call CommentInOut(b:commentstring)
function CommentInOut(commentstring)
let leadingWhitespace = '^\s\*'
let noLeadingWhitespace = '^'
let ignoreCase = '\c'
let CommentedString = ignoreCase . noLeadingWhitespace . a:commentstring
let line = GetLine()
let line_nr = line('.')
let found = match(line, CommentedString)
"echo l:found
if (found == -1)
"echo 'nicht gefunden'
let line = substitute(line, '^', a:commentstring, '')
else
"echo 'gefunden'
let line = substitute(line, a:commentstring, '', '')
endif
call setline(line_nr, line)
endfunction
" mark lines longer as textwidth " mark lines longer as textwidth
command MarkLongLines call MarkLongLines('on') command MarkLongLines call MarkLongLines('on')
command MarkLongLinesOff call MarkLongLines('off') command MarkLongLinesOff call MarkLongLines('off')
@ -893,7 +899,7 @@ endfunction
" ------------ " ------------
" diff options " diff options
" ------------ " ------------
set diffopt=filler set diffopt=filler,vertical
" turn diff off " turn diff off
@ -967,12 +973,6 @@ endfunction
"iabbreviate li !IST_LIEBL: */<Left><Left><Left> "iabbreviate li !IST_LIEBL: */<Left><Left><Left>
" ------
" python
" ------
command Batch echo system(expand('%:p:r.bat'))
command -nargs=* Python execute(':wa | cd ' . GetBmskDir()) | echo system(g:python . ' ' . expand('%:p') . ' <args>')
" --------- " ---------
" templates " templates
" --------- " ---------
@ -1007,4 +1007,10 @@ function s:OutlookBugfix()
silent execute ':%s$^\(\%([^,]*,\)\{47}\)"\/o[^,]*\"\(,"EX","[^(]*(\)\([^)]*\)\()",\)$\1"\3"\2\3\4$c' silent execute ':%s$^\(\%([^,]*,\)\{47}\)"\/o[^,]*\"\(,"EX","[^(]*(\)\([^)]*\)\()",\)$\1"\3"\2\3\4$c'
endfunction endfunction
" ---------
" VC plugin
" ---------
let g:vc_ignore_repos="-git"
let g:vc_browse_cach_all = 1
EchoDebug 'loaded tools.vim' EchoDebug 'loaded tools.vim'

View File

@ -1,22 +1,22 @@
" vim: filetype=vim " vim: filetype=vim
" ======== " ========
" Settings " Settings
" ======== " ========
let s:path = "c:/wa/bmsx,,c:/wa/bmsx/src/**,c:/wa/bmsx/out/k48_c1/d" let s:path = "c:/wa/bmsx,,c:/wa/bmsx/src/**,c:/wa/bmsx/out/k48_c1/d"
let s:tags = "c:/wa/bmsx/src/config/damos/tags,c:/wa/tools/python/2.5.1/tags,c:/wa/bmsx/src/make/tools/scons/tags,c:/wa/tools/shade/programme/makefile/v2.9.2/tags,c:/wa/bmsx/src/sg/z6xv/bosch/make.tags,c:/wa/bmsx/src/make/tags,c:/wa/bmsx/src/fsw/**/tags,c:/wa/bmsx/src/kt/**/tags,c:/wa/bmsx/src/bdl/**/tags,c:/wa/bmsx/src/sg/**/tags,c:/wa/bmsx/src/os/**/tags" let s:tags = "c:/wa/bmsx/src/config/damos/tags,c:/wa/tools/python/2.5.1/tags,c:/wa/bmsx/src/make/tools/scons/tags,c:/wa/tools/shade/programme/makefile/v2.9.2/tags,c:/wa/bmsx/src/sg/z6xv/bosch/make.tags,c:/wa/bmsx/src/make/tags,c:/wa/bmsx/src/fsw/**/tags,c:/wa/bmsx/src/kt/**/tags,c:/wa/bmsx/src/bdl/**/tags,c:/wa/bmsx/src/sg/**/tags,c:/wa/bmsx/src/os/**/tags"
let s:cscopeprg = "c:/wa/bmsx/src/make/tools/tags/cscope.exe" let s:cscopeprg = "c:/wa/bmsx/src/make/tools/tags/cscope.exe"
let s:cscopefile = "c:/wa/bmsx/out/k48_c1/cscope.out" let s:cscopefile = "c:/wa/bmsx/out/k48_c1/cscope.out"
let s:makegoals = ["-h","-c","objs","lsts","metric","libs","doxygen-view-fsw","asms","doxygen-install-server","branch","ctags","doxygen-view-bdl","bosch-osp-ref","lint","tags","developertest","delivery","funktionsdoku","doxygen-view-os","doxygen-view-make","doxygen-view-sg","damos-dfiles","doxygen","doxygen-view-kt","vim-config","doxygen-view","shade","distclean","cscope","integrationstest","shade-config","lint-project","labelstex","kgs-ref","miktex-update","bmw-a2l","stags","a2l-parse","dtags","merged-a2l","shade-proj-tags","doxygen-conf","ptags","doxygen-install","damos-osp","functionstex","damos-config","mtags","shade-tags","tags-all"] let s:makegoals = ["-h","-c","objs","lsts","metric","libs","doxygen-view-fsw","asms","doxygen-install-server","branch","ctags","doxygen-view-bdl","bosch-osp-ref","lint","tags","developertest","delivery","funktionsdoku","doxygen-view-os","doxygen-view-make","doxygen-view-sg","damos-dfiles","doxygen","doxygen-view-kt","vim-config","doxygen-view","shade","distclean","cscope","integrationstest","shade-config","lint-project","labelstex","kgs-ref","miktex-update","bmw-a2l","stags","a2l-parse","dtags","merged-a2l","shade-proj-tags","doxygen-conf","ptags","doxygen-install","damos-osp","functionstex","damos-config","mtags","shade-tags","tags-all"]
let s:makeopts = ["Motor=","Muster=","Stand=","verbose=","EXTRA_CCFLAGS=","funktionen=","CR=","text="] let s:makeopts = ["Motor=","Muster=","Stand=","verbose=","EXTRA_CCFLAGS=","funktionen=","CR=","text="]
let s:Motor = "K48" let s:Motor = "K48"
let s:MotorVarianten = ["K48","K4X-EGAS","KXX","K7X-EGAS","K2X-EGAS"] let s:MotorVarianten = ["K48","K4X-EGAS","KXX","K7X-EGAS","K2X-EGAS"]
let s:Muster = "C1" let s:Muster = "C1"
let s:MusterVarianten = ["C1"] let s:MusterVarianten = ["C1"]
let s:SW_Stand = "Test" let s:SW_Stand = "Test"
let s:StandVarianten = ["Test","Release","Bosch"] let s:StandVarianten = ["Test","Release","Bosch"]
let s:basedir = "c:/wa/bmsx" let s:basedir = "c:/wa/bmsx"
let s:Project = "bmsx" let s:Project = "bmsx"
let s:makeCommand = "c:/wa/bmsx/make.bat" let s:makeCommand = "c:/wa/bmsx/make.bat"
let g:sessionfile = "c:/wa/bmsx/out/session.vim" let g:sessionfile = "c:/wa/bmsx/out/session.vim"

Binary file not shown.

Binary file not shown.

View File

@ -1,23 +1,24 @@
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Setzen des Runtimepath, in dem die Vimfiles gesucht werden: " Setzen des Runtimepath, in dem die Vimfiles gesucht werden:
let runtimepath_orig = &runtimepath let runtimepath_orig = &runtimepath
let &runtimepath = '' let &runtimepath = ''
" zuerst in vimsuite suchen " zuerst in vimsuite suchen
let &runtimepath = &runtimepath . ',' . g:vimfiles let &runtimepath = &runtimepath . ',' . g:vimfiles
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles'
"let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.latex'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.damos'
" dann in vim Installation suchen " dann in vim Installation suchen
let &runtimepath = &runtimepath . ',' . runtimepath_orig let &runtimepath = &runtimepath . ',' . runtimepath_orig
" dann in vimsuite/after suchen " dann in vimsuite/after suchen
let &runtimepath = &runtimepath . ',' . g:vimfiles . '/after' let &runtimepath = &runtimepath . ',' . g:vimfiles . '/after'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles/after'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.latex/after'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.damos/after'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.stefan/after' let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.stefan/after'
" packages liegen unter vimsuite/pack
let &packpath = g:vimsuite
" Laden weiterer Einstellungen: " Laden weiterer Einstellungen:
if (has("win32") || has("win64")) if (has("win32") || has("win64"))
let g:os ='dos' let g:os ='dos'
@ -33,9 +34,6 @@ endif
" global settings " global settings
" --------------- " ---------------
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
set nobackup " keep no backup file set nobackup " keep no backup file
set history=50 " keep 50 lines of command line history set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time set ruler " show the cursor position all the time
@ -60,6 +58,9 @@ set hlsearch
set gdefault set gdefault
" case sensitive search " case sensitive search
set noignorecase set noignorecase
" ignore some pattern in filesearch
set wildignore+=.git
set wildignore+=.svn
" set very intelligent formatting " set very intelligent formatting
set formatoptions=croqwan2 set formatoptions=croqwan2
@ -67,20 +68,11 @@ set formatoptions=croqwan2
" -------- " --------
" Changing " Changing
" -------- " --------
" Don't use Ex mode, use Q for formatting
"map Q gq
" overwrite selected text " overwrite selected text
vnoremap p s<C-R>0<ESC> vnoremap p s<C-R>0<ESC>
vnoremap P s<C-R>0<ESC> vnoremap P s<C-R>0<ESC>
" list tags
inoremap <C-T> <ESC>:tselect /^<C-R><C-W><CR>
" search for visual block
vnoremap <silent> g/ y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
vnoremap <silent> g? y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
" ------- " -------
" Display " Display
" ------- " -------
@ -108,13 +100,17 @@ set showcmd
"vnoremap g4 vg4 "vnoremap g4 vg4
" set textwidth to 78 " set textwidth to 78
set textwidth=78 set textwidth=100
" special characters " special characters
" list special characters " list special characters
set list set list
" special characters: " special characters:
set listchars=eol:$,tab:>\ ,trail:_,extends,precedes set listchars=eol:$
set listchars+=tab:>\
set listchars+=trail:_
set listchars+=extends
set listchars+=precedes
" special characters for keywords " special characters for keywords
" set iskeyword+= " set iskeyword+=
@ -135,19 +131,12 @@ set scrolloff=10
" wrap line at (b=<BS>, s=<space>, h, l, <, >, [, ]) " wrap line at (b=<BS>, s=<space>, h, l, <, >, [, ])
set whichwrap= set whichwrap=
" backspace deletes: (indent,eol,start) " backspace deletes: (indent,eol,start)
set backspace=indent,start set backspace=indent
" find word under cursor set backspace+=start
nnoremap + /<C-R><C-W><CR>
" mark word under cursor " mark word under cursor
nnoremap gm :let @/ = "<C-R><C-W>"<CR>:set hlsearch<CR> nnoremap gm :let @/ = "<C-R><C-W>"<CR>:set hlsearch<CR>
" go to tag under cursor " go to tag under cursor
nnoremap <TAB> g<C-]> nnoremap tt g<C-]>
"nnoremap <CR> g<C-]>
nnoremap <CR> :tag <C-R><C-W><CR>
" return to previous position
nnoremap <S-TAB> <C-T>
nnoremap <BS> <C-T>
nnoremap <S-CR> <C-T>
" find next error " find next error
nnoremap <C-N> :cn<CR> nnoremap <C-N> :cn<CR>
" go back to previous edited file " go back to previous edited file
@ -156,7 +145,14 @@ nnoremap gb :call GotoLastFile()<CR>
" ----------- " -----------
" come and go " come and go
" ----------- " -----------
set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize set sessionoptions=blank
set sessionoptions+=buffers
set sessionoptions+=curdir
set sessionoptions+=folds
set sessionoptions+=help
set sessionoptions+=resize
set sessionoptions+=tabpages
set sessionoptions+=winsize
" open window size " open window size
if &diff if &diff
autocmd GUIEnter * set lines=60 columns=200 autocmd GUIEnter * set lines=60 columns=200
@ -193,58 +189,46 @@ set noswapfile
" ----------- " -----------
" spell check " spell check
" ----------- " -----------
set spelllang=de set spelllang=de,en
set spellfile=$VIM/myspell.add let &spellfile=g:vimfiles.'/spell/myspell.add'
let &spellfile=&spellfile . ',' . g:vimfiles . '/spell/bmsk.add'
if exists('g:debug')
if (g:debug > 0)
echo 'loaded vimrc'
endif
endif
" ---------- " ----------
" Completion " Completion
" ---------- " ----------
set completeopt=longest,menuone set completeopt=longest
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" set completeopt+=menuone
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
\ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
" -------------- " --------------
" DoxygenToolkit " DoxygenToolkit
" -------------- " --------------
let g:DoxygenToolkit_commandTag = "\\" "let g:DoxygenToolkit_commandTag = "\\"
"let g:DoxygenToolkit_authorName = "Stefan Liebl" let g:DoxygenToolkit_authorName = "Stefan Liebl"
let g:DoxygenToolkit_briefTag_pre = g:DoxygenToolkit_commandTag . "brief " "let g:DoxygenToolkit_briefTag_pre = g:DoxygenToolkit_commandTag . "brief "
"let g:DoxygenToolkit_briefTag_post = "" "let g:DoxygenToolkit_briefTag_post = ""
let g:DoxygenToolkit_paramTag_pre = g:DoxygenToolkit_commandTag . "param " "let g:DoxygenToolkit_paramTag_pre = g:DoxygenToolkit_commandTag . "param "
"let g:DoxygenToolkit_paramTag_post = " " "let g:DoxygenToolkit_paramTag_post = " "
let g:DoxygenToolkit_returnTag = g:DoxygenToolkit_commandTag . "return " "let g:DoxygenToolkit_returnTag = g:DoxygenToolkit_commandTag . "return "
"let g:DoxygenToolkit_blockHeader = "" "let g:DoxygenToolkit_blockHeader = ""
"let g:DoxygenToolkit_blockFooter = "" "let g:DoxygenToolkit_blockFooter = ""
"let g:DoxygenToolkit_licenseTag = s:licenseTag "let g:DoxygenToolkit_licenseTag = s:licenseTag
let g:DoxygenToolkit_fileTag = g:DoxygenToolkit_commandTag . "file " "let g:DoxygenToolkit_fileTag = g:DoxygenToolkit_commandTag . "file "
let g:DoxygenToolkit_authorTag = g:DoxygenToolkit_commandTag . "author " "let g:DoxygenToolkit_authorTag = g:DoxygenToolkit_commandTag . "author "
let g:DoxygenToolkit_dateTag = g:DoxygenToolkit_commandTag . "date " "let g:DoxygenToolkit_dateTag = g:DoxygenToolkit_commandTag . "date "
let g:DoxygenToolkit_dateFormat = "%d.%m.%Y" "let g:DoxygenToolkit_dateFormat = "%d.%m.%Y"
"let g:DoxygenToolkit_undocTag = "DOX_SKIP_BLOCK" "let g:DoxygenToolkit_undocTag = "DOX_SKIP_BLOCK"
let g:DoxygenToolkit_blockTag = g:DoxygenToolkit_commandTag . "name " "let g:DoxygenToolkit_blockTag = g:DoxygenToolkit_commandTag . "name "
let g:DoxygenToolkit_classTag = g:DoxygenToolkit_commandTag . "class " "let g:DoxygenToolkit_classTag = g:DoxygenToolkit_commandTag . "class "
"let g:DoxygenToolkit_cinoptions = "c1C1" "let g:DoxygenToolkit_cinoptions = "c1C1"
let g:DoxygenToolkit_startCommentTag = "/****************************************************************//*!" "let g:DoxygenToolkit_startCommentTag = "/****************************************************************//*!"
let g:DoxygenToolkit_startCommentBlock = "/*! " "let g:DoxygenToolkit_startCommentBlock = "/*! "
"let g:DoxygenToolkit_interCommentTag = "* " "let g:DoxygenToolkit_interCommentTag = "* "
let g:DoxygenToolkit_endCommentTag = "********************************************************************/" "let g:DoxygenToolkit_endCommentTag = "********************************************************************/"
"let g:DoxygenToolkit_endCommentBlock = " */" "let g:DoxygenToolkit_endCommentBlock = " */"
let g:DoxygenToolkit_descriptionTag = "Beschreibung" "let g:DoxygenToolkit_descriptionTag = "Beschreibung"
let g:DoxygenToolkit_attentionTag = g:DoxygenToolkit_commandTag . "attention " "let g:DoxygenToolkit_attentionTag = g:DoxygenToolkit_commandTag . "attention "
let g:DoxygenToolkit_saTag = g:DoxygenToolkit_commandTag . "sa " "let g:DoxygenToolkit_saTag = g:DoxygenToolkit_commandTag . "sa "
"let g:DoxygenToolkit_ignoreForReturn = "inline static virtual void" "let g:DoxygenToolkit_ignoreForReturn = "inline static virtual void"
@ -255,23 +239,78 @@ let g:DoxygenToolkit_saTag = g:DoxygenToolkit_commandTag . "sa
"let g:DoxygenToolkit_briefTag_funcName = "no" "let g:DoxygenToolkit_briefTag_funcName = "no"
" Add description to DoxAuthor if you want " Add description to DoxAuthor if you want
let g:DoxygenToolkit_author_description = "yes" "let g:DoxygenToolkit_author_description = "yes"
" Add description to Dox if you want " Add description to Dox if you want
let g:DoxygenToolkit_dox_description = "yes" "let g:DoxygenToolkit_dox_description = "yes"
" Add attention to Dox if you want " Add attention to Dox if you want
let g:DoxygenToolkit_dox_attention = "yes" "let g:DoxygenToolkit_dox_attention = "yes"
" Add sa to Dox if you want " Add sa to Dox if you want
let g:DoxygenToolkit_dox_sa = "yes" "let g:DoxygenToolkit_dox_sa = "yes"
" ----------- " ---------
" VCS Command " T-Comment
" ----------- " ---------
let g:VCSCommandMenuRoot = '&VCS' let g:tcommentOptions = {'col': 1, 'whitespace': 'no'}
" ---------
" VC plugin
" ---------
let g:vc_log_name = '~/vc.log'
" ---- " ----
" gitv " gitv
" ---- " ----
let g:Gitv_OpenHorizontal = 1 let g:Gitv_OpenHorizontal = 1
" -------------------
" DEIN plugin manager
" -------------------
" Required:
"call dein#begin(expand(g:vimsuite . '/plugins/'))
" Let dein manage dein
" Required:
"call dein#add('Shougo/dein.vim')
" Add or remove your plugins here:
"call dein#add('cgdb/cgdb')
"call dein#add('will133/vim-dirdiff')
"call dein#add('vim-scripts/DoxygenToolkit.vim')
"call dein#add('tpope/vim-fugitive')
"call dein#add('skibyte/gdb-from-vim', {'rev': 'develop'})
"call dein#add('gregsexton/gitv')
"call dein#add('sjl/gundo.vim')
"call dein#add('AndrewRadev/linediff.vim')
"call dein#add('idanarye/vim-merginal')
"call dein#add('lyuts/vim-rtags')
"call dein#add('vim-scripts/SrchRplcHiGrp.vim')
"call dein#add('majutsushi/tagbar')
"call dein#add('tomtom/tcomment_vim')
"call dein#add('juneedahamed/vc.vim')
"call dein#add('jreybert/vimagit')
"call dein#add('vim-scripts/VisIncr')
"call dein#add('othree/xml.vim')
" You can specify revision/branch/tag.
"call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
" Required:
"call dein#end()
" Required:
filetype plugin indent on
" If you want to install not installed plugins on startup.
"if dein#check_install()
" call dein#install()
"endif
if exists('g:debug')
if (g:debug > 0)
echo 'loaded vimrc'
endif
endif