public
Last active

Vim - My current settings for ConqueTerm

  • Download Gist
conque_term_settings.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
" Conque
" http://www.vim.org/scripts/script.php?script_id=2771
 
" ~/.vim/after/ftplugin/conque_term.vim
 
augroup MyConqueTerm
autocmd!
" start Insert mode on BufEnter
autocmd BufEnter *
\ if &l:filetype ==# 'conque_term' |
\ startinsert! |
\ endif
augroup END
 
let g:ConqueTerm_Color = 1
let g:ConqueTerm_TERM = 'vt100'
let g:ConqueTerm_Syntax = 'conque'
let g:ConqueTerm_ReadUnfocused = 1
let g:ConqueTerm_CWInsert = 1
 
let g:ConqueTerm_MyCommand = 'zsh'
let g:ConqueTerm_MyTermPosition = 'J'
 
function! s:term_pop(termnr)
let command = split(g:ConqueTerm_MyCommand, '\s\+')[0]
let bufname = printf('%s - %d', command, a:termnr)
 
if a:termnr == 0 || (a:termnr == 1 && !bufexists(bufname))
execute "ConqueTermSplit" g:ConqueTerm_MyCommand
execute 'wincmd' g:ConqueTerm_MyTermPosition
setlocal bufhidden=hide
setlocal nobuflisted
setlocal buftype=nofile
setlocal noswapfile
elseif bufexists(bufname)
let bufnr = bufnr(bufname)
let winnr = bufwinnr(bufnr)
if winnr == -1
execute 'sbuffer' bufnr
execute 'wincmd' g:ConqueTerm_MyTermPosition
else
execute winnr 'wincmd w'
endif
else
echo "term buffer not created yet"
endif
endfunction
 
" pop the main shell
nnoremap <silent> H :<C-u>call <SID>term_pop(1)<CR>
" pop the shell of the given term number
nnoremap <silent> <Space>1 :<C-u>call <SID>term_pop(1)<CR>
nnoremap <silent> <Space>2 :<C-u>call <SID>term_pop(2)<CR>
nnoremap <silent> <Space>3 :<C-u>call <SID>term_pop(3)<CR>
nnoremap <silent> <Space>4 :<C-u>call <SID>term_pop(4)<CR>
nnoremap <silent> <Space>5 :<C-u>call <SID>term_pop(5)<CR>
nnoremap <silent> <Space>6 :<C-u>call <SID>term_pop(6)<CR>
nnoremap <silent> <Space>7 :<C-u>call <SID>term_pop(7)<CR>
nnoremap <silent> <Space>8 :<C-u>call <SID>term_pop(8)<CR>
nnoremap <silent> <Space>9 :<C-u>call <SID>term_pop(9)<CR>
 
" create a new shell
nnoremap <silent> <Space>sh :<C-u>call <SID>term_pop(0)<CR>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.