citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

slime.vim (984B)


      1 
      2 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
      3 
      4 function Send_to_Screen(text)
      5   if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
      6     call Screen_Vars()
      7   end
      8 
      9   echo system("screen -S " . g:screen_sessionname . " -p " . g:screen_windowname . " -X stuff '" . substitute(a:text, "'", "'\\\\''", 'g') . "'")
     10 endfunction
     11 
     12 function Screen_Session_Names(A,L,P)
     13   return system("screen -ls | awk '/Attached/ {print $1}'")
     14 endfunction
     15 
     16 function Screen_Vars()
     17   if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
     18     let g:screen_sessionname = ""
     19     let g:screen_windowname = "0"
     20   end
     21 
     22   let g:screen_sessionname = input("session name: ", "", "custom,Screen_Session_Names")
     23   let g:screen_windowname = input("window name: ", g:screen_windowname)
     24 endfunction
     25 
     26 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     27 
     28 vmap <C-c><C-c> "ry :call Send_to_Screen(@r)<CR>
     29 nmap <C-c><C-c> vip<C-c><C-c>
     30 
     31 nmap <C-c>v :call Screen_Vars()<CR>
     32