Closed gBopHuk closed 7 years ago
@gBopHuk VimuxSendText
still exists.
There's a section in the documentation explaining how to set up a couple of mappings to use VimuxSendText
. I've just pasted the following into my .vimrc
and I'm able to send Ruby code from my buffer to a pry
session running in a tmux pane:
function! VimuxSlime()
call VimuxSendText(@v)
call VimuxSendKeys("Enter")
endfunction
" If text is selected, save it in the v buffer and send that buffer it to tmux
vmap <Leader>vs "vy :call VimuxSlime()<CR>
" Select current paragraph and send it to tmux
nmap <Leader>vs vip<LocalLeader>vs<CR>
@gBopHuk or use https://github.com/tpope/vim-tbone (I use both)
BTW I found the difference between ipython and python interesting.
After running VimuxRunCommand "ipython"
, I select the following Python code inside of vim:
def flappy(): num = 1 print(num * num)
and then hit
In [20]: def flappy(): ...: num = 1 ...: print(num * num) File "<ipython-input-20-e69ed03d3e2a>", line 3 print(num * num) ^ IndentationError: unexpected indent
It's not obvious but each subsequent line in the ipython REPL has one more level of indent than the last.
This works fine in plain old python's REPL. iPython must be inserting its own indentation. Sounds like I need a custom version of VimuxSlime() for when the target does indentation automatically.
Closing this question as it was answered by @english.
I see you removed VimuxSendText. How to send text to a tmux pane at now?