Skip to content

Instantly share code, notes, and snippets.

@glucero
Created March 22, 2013 16:26
Show Gist options
  • Save glucero/5222682 to your computer and use it in GitHub Desktop.
Save glucero/5222682 to your computer and use it in GitHub Desktop.
custom functions for the screen vim plugin
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