Comments (8)
I just created a PR for adding an option to use %cpaste
from slimux.
I've got the same issue!
from slimux.
same here ... bpython works tho
from slimux.
I have this problem too! My only fault for an AWESOME plugin.
I did find though that exiting out of IPython to just a normal bash prompt, SlimuxREPLSendSelection DOES indeed send the selection only, however, after left clicking in the bash prompt pane (and hearing n -1 terminal beeps when copying over n lines). Just interesting...it DOES work, just not in the new IPython.
from slimux.
Same issue. Anyone find a workaround?
from slimux.
I found a workaround, but note that I haven't yet checked all corner cases. Here's a line that makes the visual selection mode work with Slimux in Ipython 5 for me, binding the command to <C-c><C-c>
(of course, you can bind it to any other shortcut):
vnoremap <C-c><C-c> :<C-w>SlimuxShellRun %cpaste<CR>:'<,'>SlimuxREPLSendSelection<CR>:SlimuxShellRun --<CR>
In short, the idea is to use the %cpaste magic to enter text. This has the added advantage that it probably works better with heavily indented code, although I haven't fully checked.
Here's what it does:
- Delete the
'<,'>
that vim automatically adds to command lines in visual selection mode - Send over
%cpaste
- Send over the selection, which needs to be preceeded by
'<,'>
- Send over
--
to end the%cpaste
magic
from slimux.
One concern about %cpaste is it will not be saved in ipython's history. Checkout ipython/ipython#1384
After some investigation, I found that
- Ipython >= 5 will support multiple paste (via Ctrl-V or Command-V). That means it will recognize the pasted content and handle the indentation well(basically keep the indentation).
- The pasted content is recognized utilizing a technique called bracketed paste mode
- tmux's
paste-buffer
supportbracketed paste mode
via-p
option.
I've created a PR accordingly: #75.
The main advantage of the paste
way is that the pasted content will be stored in ipython's history.
from slimux.
I have this on my work station but on my laptop it works just fine!
from slimux.
Related Issues (20)
- Julia for loop break HOT 6
- Allow users to filter out panes based on arbitrary strings
- Slimux not Affecting the Selected Tmux Pane HOT 13
- Don't try to send to pane that doesn't exist anymore
- Allow SendSelection to use marks and ranges HOT 2
- Error after sending visual selection to ipython with vim splits
- vim hanging when using SlimuxREPLSendLine HOT 12
- Sending selection by stripping comments HOT 1
- how to use the Slimux in tmux? HOT 1
- Slimux breaks when `g:slimux_tmux_path` is unset HOT 3
- Send text object to REPL HOT 1
- SlimuxSendKeys() bug? HOT 4
- IndentationError: unindent does not match any outer indentation level (Extra spaces produced in IPython) HOT 3
- mismatched quotes in slimux.vim
- Escaping R Code HOT 3
- Vim to Vim in Normal mode
- protocol version mismatch HOT 1
- Repl send line adds indentation
- Repository maintenance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slimux.