Created
March 22, 2013 16:26
-
-
Save glucero/5222682 to your computer and use it in GitHub Desktop.
custom functions for the screen vim plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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