Versioning the rest of my vimfiles directory.
[vimrc.git] / plugin / slime.vim
blob0e9aa547138aaa8c14a7269f5a27dd2be384cc50
1 function Send_to_Screen(text)
2   if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
3     call Screen_Vars()
4   end
6   echo system("screen -S " . g:screen_sessionname . " -p " . g:screen_windowname . " -X stuff '" . substitute(a:text, "'", "'\\\\''", 'g') . "'")
7 endfunction
9 function Screen_Session_Names(A,L,P)
10   return system("screen -ls | awk '/Attached/ {print $1}'")
11 endfunction
13 function Screen_Vars()
14   if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
15     let g:screen_sessionname = ""
16     let g:screen_windowname = "0"
17   end
19   let g:screen_sessionname = input("session name: ", "", "custom,Screen_Session_Names")
20   let g:screen_windowname = input("window name: ", g:screen_windowname)
21 endfunction
23 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
25 vmap <C-c><C-c> "ry :call Send_to_Screen(@r)<CR>
26 nmap <C-c><C-c> vip<C-c><C-c>
28 nmap <C-c>v :call Screen_Vars()<CR>