From 938e69e79107c7388ef68350ad98dc8720542040 Mon Sep 17 00:00:00 2001 From: Stefan Liebl Date: Thu, 6 Feb 2025 15:48:46 +0100 Subject: [PATCH] cleanup --- vimfiles.stefan/plugin/toptica.vim | 94 +++++++++++++++--------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/vimfiles.stefan/plugin/toptica.vim b/vimfiles.stefan/plugin/toptica.vim index 5deba08..32365b1 100644 --- a/vimfiles.stefan/plugin/toptica.vim +++ b/vimfiles.stefan/plugin/toptica.vim @@ -1,21 +1,21 @@ -command -nargs=1 -complete=dir DlcPro call s:ProjectSet('dlcpro-new', '') -command -nargs=1 -complete=dir DlcProOld call s:ProjectSet('dlcpro', '') -command -nargs=1 -complete=dir DlcProShg call s:ProjectSet('shg', '') -command -nargs=1 -complete=dir DlcProGui call s:ProjectSet('dlcpro-gui', '') -command -nargs=1 -complete=dir DlcProTui call s:ProjectSet('dlcpro-tui', '') -command -nargs=1 -complete=dir DlcProTuiSimulator call s:ProjectSet('dlcpro-tui-simulator', '') -command -nargs=1 -complete=dir DlcProCan call s:ProjectSet('dlcpro-can', '') -command -nargs=1 -complete=dir DlcProSpecalyser call s:ProjectSet('dlcpro-specalyser', '') -command -nargs=1 -complete=dir Topmode call s:ProjectSet('topmode', '') -command -nargs=1 -complete=dir TopmodeGui call s:ProjectSet('topmode-gui', '') -command -nargs=1 -complete=dir DigiFalc call s:ProjectSet('digifalc', '') -command -nargs=1 -complete=dir ServoBoard call s:ProjectSet('servoboard', '') -command -nargs=1 -complete=dir DlMotor call s:ProjectSet('dl-motor', '') -command -nargs=1 -complete=dir Pfd call s:ProjectSet('pfd', '') -command -nargs=1 -complete=dir Tiny call s:ProjectSet('tiny', '') -command -nargs=1 -complete=dir OperationPanelF1 call s:ProjectSet('operation-panel-f1', '') -command -nargs=1 -complete=dir OperationPanelF4 call s:ProjectSet('operation-panel-f4', '') -command -nargs=1 -complete=dir DeCoF call s:ProjectSet('decof', '') +command -nargs=? -complete=dir DlcPro call s:ProjectSet('dlcpro-new', '') +command -nargs=? -complete=dir DlcProOld call s:ProjectSet('dlcpro', '') +command -nargs=? -complete=dir DlcProShg call s:ProjectSet('shg', '') +command -nargs=? -complete=dir DlcProGui call s:ProjectSet('dlcpro-gui', '') +command -nargs=? -complete=dir DlcProTui call s:ProjectSet('dlcpro-tui', '') +command -nargs=? -complete=dir DlcProTuiSimulator call s:ProjectSet('dlcpro-tui-simulator', '') +command -nargs=? -complete=dir DlcProCan call s:ProjectSet('dlcpro-can', '') +command -nargs=? -complete=dir DlcProSpecalyser call s:ProjectSet('dlcpro-specalyser', '') +command -nargs=? -complete=dir Topmode call s:ProjectSet('topmode', '') +command -nargs=? -complete=dir TopmodeGui call s:ProjectSet('topmode-gui', '') +command -nargs=? -complete=dir DigiFalc call s:ProjectSet('digifalc', '') +command -nargs=? -complete=dir ServoBoard call s:ProjectSet('servoboard', '') +command -nargs=? -complete=dir DlMotor call s:ProjectSet('dl-motor', '') +command -nargs=? -complete=dir Pfd call s:ProjectSet('pfd', '') +command -nargs=? -complete=dir Tiny call s:ProjectSet('tiny', '') +command -nargs=? -complete=dir OperationPanelF1 call s:ProjectSet('operation-panel-f1', '') +command -nargs=? -complete=dir OperationPanelF4 call s:ProjectSet('operation-panel-f4', '') +command -nargs=? -complete=dir DeCoF call s:ProjectSet('decof', '') command DeviceFirmwareUpdate call s:DeviceFirmwareUpdate() command -nargs=? -complete=file JenkinsLinter call s:Jenkins_linter('') @@ -216,8 +216,6 @@ function! s:ProjectSet(project_type, project_base_dir) echo "no project" endif - let g:BuildType = 'Default' - " Settings for invoke development let s:invoke = 'invoke' let s:tasks_file_dev = '/home/stefan/tools/invoke/'.g:project_type.'/tasks.py' @@ -229,44 +227,35 @@ function! s:ProjectSet(project_type, project_base_dir) echoerr 'tasks.py not found' endif - " editor settings - set spell spelllang=en,de - set expandtab - set cinoptions=l1,g2,h2,N-2,t0,+0,(0,w1,Ws,m1,)100,*100 - set textwidth=120 - " python tags execute "set tags+=" . s:ProjectBaseDir . '/tags' " compiler - compiler gcc if exists("s:Program") let g:Program = g:ProjectBuildDir.s:Program let g:Elffile = g:ProjectBuildDir.s:Elffile endif - command! -complete=customlist,GetAllMakeCompletions -nargs=* MakeCmd call s:Make('', 'async') - - " configure quickfix window for asyncrun - augroup QuickfixStatus - autocmd BufWinEnter quickfix setlocal - \ statusline=%t\ [%{g:asyncrun_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P - augroup END - - function! s:DeviceFirmwareUpdate() - call s:Make('kill', 'bang') - call s:Make('flash', 'bang') - call s:Make('run', 'bang') - endfunction - - command! DeviceDebug call s:DeviceDebug(0) - command! DeviceDebugAttach call s:DeviceDebug(1) - - " little helpers - let $QT_FONT_DPI=96 " Size for qt-application in debugger - - endfunction +" ============= +" Some settings +" ============= +set spell spelllang=en,de +set expandtab +set cinoptions=l1,g2,h2,N-2,t0,+0,(0,w1,Ws,m1,)100,*100 +set textwidth=120 +let $QT_FONT_DPI=96 " Size for qt-application in debugger +let g:BuildType = 'Default' +compiler gcc +command! -complete=customlist,GetAllMakeCompletions -nargs=* MakeCmd call s:Make('', 'async') + +" configure quickfix window for asyncrun +augroup QuickfixStatus + autocmd BufWinEnter quickfix setlocal + \ statusline=%t\ [%{g:asyncrun_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P +augroup END + + " ==== " Make " ==== @@ -325,6 +314,12 @@ function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos) return bash#complete(l:command) endfunction +function! s:DeviceFirmwareUpdate() + call s:Make('kill', 'bang') + call s:Make('flash', 'bang') + call s:Make('run', 'bang') +endfunction + function! g:JLinkSWOviewer() let cmd = '/JLinkSWOViewerCLExe -device STM32H743ZI -itmmask 0xffffffff -swofreq 450000' call asyncrun#quickfix_toggle(10, 1) @@ -343,6 +338,9 @@ function! s:StartDebugger(elffile, attach) endif endfunction + +command! DeviceDebug call s:DeviceDebug(0) +command! DeviceDebugAttach call s:DeviceDebug(1) function! s:DeviceDebug(attach) if g:DebugRemote call s:Make('kill', 'bang')