Skip to content

Instantly share code, notes, and snippets.

@joannecheng
Forked from glucero/custom_screen_send.vim
Created March 22, 2013 16:29
Show Gist options
  • Save joannecheng/5222700 to your computer and use it in GitHub Desktop.
Save joannecheng/5222700 to your computer and use it in GitHub Desktop.
let g:ScreenImpl = 'Tmux'
function! CustomScreenSend()
silent! %s/\s\+$//e
silent! g/^$/d
ScreenSend
silent! normal! ggdG
endfunction
function! CustomScreenShell(command, filetype)
execute 'setlocal ft=' . a:filetype
setlocal fileencoding=utf-8
setlocal cursorline
setlocal buftype=nofile
setlocal noswapfile
setlocal nowrap
setlocal nomodified
execute 'ScreenShell ' . a:command
nmap <silent> <enter> :call CustomScreenSend()<cr>
endfunction
command! -nargs=0 Pry call CustomScreenShell('pry', 'ruby')
command! -nargs=0 Zsh call CustomScreenShell('zsh', 'sh')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment