Skip to content

Instantly share code, notes, and snippets.

@h1mesuke
Created June 23, 2010 23:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save h1mesuke/450696 to your computer and use it in GitHub Desktop.
Save h1mesuke/450696 to your computer and use it in GitHub Desktop.
Vim - My current settings for ConqueTerm
" 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment