vim library; added formatting options for dockerfile, added dotnet core testing function

This commit is contained in:
Wryn Wagner 2021-04-09 15:25:32 -06:00
parent 78591fb234
commit fe209d1418
2 changed files with 27 additions and 0 deletions

View File

@ -31,6 +31,7 @@ augroup filetype_specific_formatting
autocmd FileType haskell call FormatFileType(2, v:true, 'indent', 99, v:false) autocmd FileType haskell call FormatFileType(2, v:true, 'indent', 99, v:false)
autocmd FileType perl call FormatFileType(4, v:true, 'indent', 99, v:false) autocmd FileType perl call FormatFileType(4, v:true, 'indent', 99, v:false)
autocmd FileType kotlin call FormatFileType(2, v:true, 'indent', 99, v:false) autocmd FileType kotlin call FormatFileType(2, v:true, 'indent', 99, v:false)
autocmd FileType dockerfile call FormatFileType(4, v:true, 'indent', 99, v:false)
augroup end augroup end
augroup forced_filetype_recognition augroup forced_filetype_recognition

View File

@ -61,6 +61,32 @@ function GetDjangoManagePy()
endfunction endfunction
" ===================================================================
" === dotnet core ===================================================
" ===================================================================
function DotnetTest(filter = '')
let l:command =
\ 'cd ' . GetDotnetProjectLocation()
\ . ';' . 'dotnet build -clp:ErrorsOnly'
\ . ';' . 'cd ' . GetDotnetProjectLocation(1)
\ . ';' . 'dotnet test -clp:ErrorsOnly'
if a:filter != ''
let l:command = l:command . ' --filter ' . a:filter
endif
call TmuxTest(l:command)
endfunction
function GetDotnetProjectLocation(test = 0)
let l:projectRoot = substitute(expand(getcwd()), '/code.*', '/code', '')
if a:test
let l:testPath = system('ls ' . l:projectRoot . '/**/*.csproj | grep Test | head -1')
else
let l:testPath = system('ls ' . l:projectRoot . '/**/*.csproj | grep -v Test | head -1')
endif
return substitute(l:testPath, '\(.*\)/.*.csproj.*', '\1', '')
endfunction
" =================================================================== " ===================================================================
" === npm =========================================================== " === npm ===========================================================
" =================================================================== " ===================================================================