.vimrc review

This commit is contained in:
Vahagn Khachatryan
2016-04-08 14:06:50 -04:00
parent 2e69a93b14
commit 8d90b9f83f
2 changed files with 86 additions and 42 deletions

View File

@@ -128,7 +128,7 @@ function! s:CompileMSVC(run) "{{{2
endif
endfunction
"
"
" GCC
"
function! s:CompileGCC(run) "{{{2
@@ -138,7 +138,7 @@ function! s:CompileGCC(run) "{{{2
let ccline="g++ ".g:cppflags." ".g:lcppflags." ".g:ldflags." ".srcname." -o".exename
call s:appendOutput(ccline)
let cout = system( ccline )
if v:shell_error
if v:shell_error
call s:appendOutput(cout)
return
endif
@@ -228,7 +228,7 @@ function! s:getOutputWindow()
if (winnr < 0)
execute "below 10new ".obuff
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
" setlocal nomodifiable
" setlocal nomodifiable
let winnr = bufwinnr('^'.obuff.'$')
endif
@@ -241,10 +241,10 @@ function! s:appendOutput( text )
if exists("g:cf5output") && (g:cf5output==1)
let cwinnr = winnr()
let owinnr = s:getOutputWindow()
" setlocal modifiable
" setlocal modifiable
execute owinnr . 'wincmd w'
execute 'normal! Go'.a:text
" setlocal nomodifiable
" setlocal nomodifiable
execute cwinnr.'wincmd w'
else
echo a:text
@@ -257,13 +257,18 @@ function! s:clearOutputWindow()
if exists("g:cf5output") && (g:cf5output==1)
let cwinnr = winnr()
let owinnr = s:getOutputWindow()
" setlocal modifiable
" setlocal modifiable
execute owinnr . 'wincmd w'
execute 'normal ggdG'
" setlocal nomodifiable
" setlocal nomodifiable
execute cwinnr . 'wincmd w'
endif
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Public interface.
""
"
" Load compile instructions and call window or linux compiler. {{{1
"
@@ -292,4 +297,16 @@ function! CF5Compile(run)
"
call s:Compile(a:run)
endfunction
"
" Load compile instructions and call window or linux compiler.
"
function! CF5CompileAndRun()
call CF5Compile(1)
endfunction
"
" Load compile instructions and call window or linux compiler.
"
function! CF5CompileOnly()
call CF5Compile(0)
endfunction