From 0d7031199bde51fa1b6a41229964bf626829b551 Mon Sep 17 00:00:00 2001 From: Jannik Zander <59698@grundfos.com> Date: Sat, 14 Jul 2018 12:22:30 +0200 Subject: [PATCH] Add mycomp to vim --- .vim/vimrc | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index 25b37aa..9162f1b 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -36,9 +36,9 @@ set relativenumber set titlestring=vim:\ %f " folding -set foldmethod=syntax +"set foldmethod=indent set foldopen+=jump,search -set foldclose=all +"set foldclose=all " keyboard let mapleader = "," @@ -95,7 +95,7 @@ set background=dark highlight normal ctermbg=black ctermfg=white highlight linenr ctermfg=grey -" fonts +" fonts and chars set list if has('multi_byte') && &encoding ==# 'utf-8' let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' @@ -107,30 +107,26 @@ let &t_ti.="\e[1 q" let &t_SI.="\e[5 q" let &t_EI.="\e[1 q" let &t_te.="\e[0 q" -"set errorformat=\ %#%f(%l)%#:\ %#%t%[A-z]%#\ :\ %m -"set errorformat+=%#:%#\ %[A-Z\ ]%#%n:%# " make -" visual studio -set makeprg=cmake -" filename(line): error|warning|fatal error C0000: message -set errorformat=\ %#%f(%l)%#:\ %#%t%[A-z]%#\ %[A-Z\ ]%#%n:\ %m -" filename(line): error|warning|fatal : message -"set errorformat=\ %#%f(%l)%#:\ %#%t%[A-z]%#\ :\ %m - -" IAR compiler -"set makeprg=vim-iarbuild.cmd -"set errorformat=%f(%l)\ :\ %m - -" Doxygen -"set makeprg=doxygen -"set errorformat+=%f:%l:\ %m - - +let mycomp="msvc" + +if mycomp == "msvc" + compiler msvc + let &errorformat="%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f|%l| %m" + set makeprg=cmake +elseif mycomp == "doxygen" + set errorformat+=%f:%l:\ %m + set makeprg=doxygen +elseif mycomp == "iar" + set errorformat=%f(%l)\ :\ %m + set makeprg=vim-iarbuild.cmd +endif " grep +" file:line:coloumn:message +set grepformat^=%f:%l:%c:%m set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp\ --cc -set grepformat^=%f:%l:%c:%m " file:line:coloumn:message nnoremap * :grep \| copen " Netrw @@ -233,6 +229,11 @@ tnoremap j tnoremap k tnoremap l +" My functions +function! SetCmakeRoot(path) + let &makeprg="cmake ". a:path +endfunction + " Autocommands if has('autocmd') augroup filetypes -- 2.43.0