-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyjlslime.vim
36 lines (29 loc) · 995 Bytes
/
pyjlslime.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
let g:slime_target = "tmux"
let g:slime_paste_file = "$HOME/.slime_paste"
"------------------------------------------------------------------------------
" slime configuration
"------------------------------------------------------------------------------
let g:slime_python_ipython = 1
let g:slime_target = 'tmux'
let g:slime_default_config = {"socket_name": "default", "target_pane": ":.1"}
let g:slime_dont_ask_default = 1
" Run cell for vim-slime
function! SendCell(pattern)
let start_line = search(a:pattern, 'bnW')
if start_line
let start_line = start_line + 1
else
let start_line = 1
endif
let stop_line = search(a:pattern, 'nW')
if stop_line
let stop_line = stop_line - 1
else
let stop_line = line('$')
endif
call slime#send_range(start_line, stop_line)
endfunction
" Custom vim-slime mappings
let g:slime_no_mappings = 1
xmap <c-c><c-c> <Plug>SlimeRegionSend
nmap <c-c><c-c> :<c-u>call SendCell('^#.\+%%')<cr>