Permalink
Browse files

Unexpose plugin functions

  • Loading branch information...
1 parent ef4cd62 commit 9b88bae04d3b320f3b7a63e71a1d987563f2fd40 @caio caio committed Nov 27, 2011
Showing with 16 additions and 16 deletions.
  1. +16 −16 plugin/slime.vim
View
@@ -3,16 +3,16 @@
" Screen
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-function! ScreenSend(config, text)
- let escaped_text = _EscapeText(a:text)
+function! s:ScreenSend(config, text)
+ let escaped_text = s:_EscapeText(a:text)
call system("screen -S " . a:config["sessionname"] . " -p " . a:config["windowname"] . " -X stuff " . escaped_text)
endfunction
function! ScreenSessionNames(A,L,P)
return system("screen -ls | awk '/Attached/ {print $1}'")
endfunction
-function! ScreenConfig()
+function! s:ScreenConfig()
if !exists("b:slime_config")
let b:slime_config = {"sessionname": "", "windowname": "0"}
end
@@ -25,12 +25,12 @@ endfunction
" Tmux
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-function! TmuxSend(config, text)
- let escaped_text = _EscapeText(a:text)
+function! s:TmuxSend(config, text)
+ let escaped_text = s:_EscapeText(a:text)
call system("tmux -L " . a:config["socket_name"] . " send-keys " . escaped_text)
endfunction
-function! TmuxConfig()
+function! s:TmuxConfig()
if !exists("b:slime_config")
let b:slime_config = {"socket_name": "default"}
end
@@ -43,7 +43,7 @@ endfunction
" Helpers
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-function! _EscapeText(text)
+function! s:_EscapeText(text)
return substitute(shellescape(a:text), "\\\\\\n", "\n", "g")
endfunction
@@ -55,29 +55,29 @@ if !exists("g:slime_target")
let g:slime_target = "screen"
end
-function! SlimeSend(text)
+function! s:SlimeSend(text)
if !exists("b:slime_config")
- call SlimeDispatch('Config')
+ call s:SlimeDispatch('Config')
end
- call SlimeDispatch('Send', b:slime_config, a:text)
+ call s:SlimeDispatch('Send', b:slime_config, a:text)
endfunction
-function! SlimeConfig()
- call SlimeDispatch('Config')
+function! s:SlimeConfig()
+ call s:SlimeDispatch('Config')
endfunction
" delegation
-function! SlimeDispatch(name, ...)
+function! s:SlimeDispatch(name, ...)
let target = substitute(tolower(g:slime_target), '\(.\)', '\u\1', '') " Capitalize
- return call(target . a:name, a:000)
+ return call("s:" . target . a:name, a:000)
endfunction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Setup key bindings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-vmap <C-c><C-c> "ry:call SlimeSend(@r)<CR>
+vmap <C-c><C-c> "ry:call <SID>SlimeSend(@r)<CR>
nmap <C-c><C-c> vip<C-c><C-c>
-nmap <C-c>v :call SlimeConfig()<CR>
+nmap <C-c>v :call <SID>SlimeConfig()<CR>

0 comments on commit 9b88bae

Please sign in to comment.