vim library; added formatting options for dockerfile, added dotnet core testing function
This commit is contained in:
parent
78591fb234
commit
fe209d1418
@ -31,6 +31,7 @@ augroup filetype_specific_formatting
|
||||
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 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 forced_filetype_recognition
|
||||
|
@ -61,6 +61,32 @@ function GetDjangoManagePy()
|
||||
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 ===========================================================
|
||||
" ===================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user