This commit is contained in:
2023-12-09 11:49:45 +01:00
parent 0110d8d801
commit cd10f76030
5 changed files with 33 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ function! Build()
let l:filetype = &filetype
if l:filetype == 'c' || l:filetype == 'cpp' || l:filetype == 'h' || l:filetype == 'hpp'
execute 'make'
execute '!make'
elseif l:filetype == 'py' || l:filetype == 'python'
execute '!python3 %'
elseif l:filetype == 'tex'
@@ -30,11 +30,13 @@ function! Build()
elseif l:filetype == 'rs'
execute 'cargo run'
elseif l:filetype == 'S'
execute 'make'
execute '!make'
elseif l:filetype == 'verilog'
execute 'verilator --binary %'
execute '!verilator --binary %'
elseif l:filetype == 'rust'
execute 'cargo run'
execute '!cargo run'
elseif l:filetype == 'markdown'
execute '!okular %&'
else
echo "Unsupported file type: " . l:filetype
endif
@@ -43,4 +45,3 @@ endfunction
nnoremap <C-b> :call Build()<CR>
nnoremap <M-w> :bdelete<CR>
nnoremap <C-y> :b#<CR>