File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ By default, the following mappings are enabled :
2121 A cell is similar to MATLAB's cell and is defined as the line ranging from
2222 the previous ## to the next ##
2323
24+ Options
25+ -------
26+ If you set * vimux_pyutils_use_tslime* to 1 in your vimrc, this script will use
27+ tslime instead of vimux. This has the advantage that the script will work
28+ from outside a tmux session (in GVim for example).
29+
30+ Note that tslime has to be configured to target the correct session/pane :
31+
32+ let g:tmux_sessionname='0'
33+ let g:tmux_windowname='./ipython.sh'
34+ let g:tmux_panenumber='0'
35+
36+ let g:vimux_pyutils_use_tslime=1
37+
2438Difference with vim-ipython
2539---------------------------
2640Note that if you want more advanced integration with IPython (using the new
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ if !has('python')
22 finish
33endif
44
5+ if ! exists (" g:vimux_pyutils_use_tslime" )
6+ let g: vimux_pyutils_use_tslime= 0
7+ endif
8+
59python << endpython
610import re
711
@@ -43,8 +47,15 @@ def run_tmux_python_chunk():
4347 #vim .command (' :call VimuxRunCommand("\n--\n", 0)' )
4448
4549 # 2 . With cpaste (better, only one command , but rely on system clipboard )
46- set_register (' +' , lines )
47- vim .command (' :call VimuxRunCommand("%paste\n", 0)' )
50+
51+ # Global variable can be used to switch between vimux and tslime
52+ if vim .eval (" g:vimux_pyutils_use_tslime" ) == " 1" :
53+ vim .command (' :call Send_to_Tmux("\%cpaste\n")' )
54+ vim .command (' :call Send_to_Tmux("%s")' % lines )
55+ vim .command (' :call Send_to_Tmux("\n--\n")' )
56+ else :
57+ set_register (' +' , lines )
58+ vim .command (' :call VimuxRunCommand("%paste\n", 0)' )
4859
4960 # 3 . Directly send the raw text to vimux. This require that we add
5061 # indentation to blank lines : otherwise, this will break the input if
You can’t perform that action at this time.
0 commit comments