Permalink
Browse files

basis for nyt system

  • Loading branch information...
1 parent 232b5ae commit 35bda070e3bf9346d935a27dac45ee88d4fcbff1 @kristoff3r committed Oct 17, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 vim/plugin/slime.vim
View
@@ -0,0 +1,32 @@
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+function Send_to_Screen(text)
+ if !exists("b:slime")
+ call Screen_Vars()
+ end
+
+ let escaped_text = substitute(shellescape(a:text), "\\\\\n", "\n", "g")
+ call system("screen -S " . b:slime["sessionname"] . " -p " . b:slime["windowname"] . " -X stuff " . escaped_text)
+endfunction
+
+function Screen_Session_Names(A,L,P)
+ return system("screen -ls | awk '/Attached/ {print $1}'")
+endfunction
+
+function Screen_Vars()
+ if !exists("b:slime")
+ let b:slime = {"sessionname": "slime", "windowname": "0"}
+ end
+
+ let b:slime["sessionname"] = input("session name: ", b:slime["sessionname"], "custom,Screen_Session_Names")
+ let b:slime["windowname"] = input("window name: ", b:slime["windowname"])
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+vmap <silent> <C-c><C-c> "ry:call Send_to_Screen(@r)<CR>
+nmap <C-c><C-c> vip<C-c><C-c>
+nmap <C-c><C-d> ggVG<C-c><C-c>
+
+nmap <C-c>v :call Screen_Vars()<CR>

0 comments on commit 35bda07

Please sign in to comment.