diff options
Diffstat (limited to '.vimrc')
| -rw-r--r-- | .vimrc | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -224,13 +224,22 @@ " }}} " Code terminal {{{ + " Program in which build actions are executed. If no value, build commands are executes as bash commands. + " This is only really useful in languages with interpreters let g:codeenvs = { \ 'scheme': 'racket' \ } + + " The following two dictionaries support certain substitutions: + " %F - location of current file (relative path) + " %D - directory of current file (full path) + + " Building the current file only let g:codebuildsingle = { \ 'scheme': '(enter! "%F")', \ 'cpp' : "g++ -g -pedantic '%F' && ./a.out" \ } + " Building all files in the directory (and subdirectories) of the current file let g:codebuildproject = { \ 'cpp' : "g++ -g -pedantic '%D/'**/*.cpp && ./a.out" \ } @@ -238,19 +247,24 @@ noremap <F3> :call CodeTerminal(g:codebuildsingle)<CR> noremap <F4> :call CodeTerminal(g:codebuildproject)<CR> + let t:codetermbufnr = -1 let t:codetermft = "" let t:codetermhadenv = 0 function! OpenCodeTerminal() if !bufexists(t:codetermbufnr) term + " Latest buffer is the terminal buffer we just opened let t:codetermbufnr = bufnr("$") + " We go back to the file from which this was called wincmd p endif if &filetype != t:codetermft if t:codetermhadenv + " This is kinda bad, since certain environments might not close with this only call term_sendkeys(t:codetermbufnr, "\<C-D>") + " The sleep is kinda bad, but it fixes the next term_sendkeys not working properly sleep 500m endif |
