Comments (12)
Right now the IPython mode is controlled through a global variable. It wouldn't be too hard to chain a conditional on a buffer variable b:slime_python_ipython
.
In practice, when inside a specific buffer, how will you toggle the mode?
Alternatively, you could have another key mapping that:
- unsets the global variable
- sends the text
- resets the global variable
but that's not super-elegant.
from vim-slime.
In practice, when inside a specific buffer, how will you toggle the mode?
I would like to set the variable with an ftplugin
so that all python files automatically get this option, but other languages do not get it.
from vim-slime.
I'm sorry, we're commenting in a few issues at the same time. Can you walk me through your use cases? (I want to make sure I really understand the problem)
from vim-slime.
Right. Maybe I have several different file types open in different buffers. I want to connect them to multiple tmux panes. For some of these buffers, setting g:slime_python_ipython
might be necessary because they are connected to ipython. For other buffers this option might not be necessary (maybe because I am sending code snippets to an IRC conversation in weechat or whatever).
from vim-slime.
Or maybe thinking the other way around: certain transformations applied to the text sent to e.g. tmux, could be tied to the slime connection.
from vim-slime.
Although the g:slime_python_ipython
is a global variable -- it doesn't affect all buffers.
For example, when you send text, vim-slime checks what filetype you sent the text from and runs it onlu through the specific filter. As such, python files get the python filter, etc.
Is that not the behavior you see?
from vim-slime.
Oh right, I missed that.
from vim-slime.
I thought you might be mixing python and ipython buffers. (something currently not supported)
from vim-slime.
Ok. I understand.
The only thing that see from a design point of view is that the filters to apply not only relate to the file type, but also to the connection information. If I connect a python file to my mcabber session (inside tmux), I do not want to have the ipython transformation, but a transformation where the message starts with /msay begin
etc.
If the transformations were maintained inside the connection information, and multiple connection could be open in parallel, then some very interesting use cases could be possible. E.g. I could create one key mapping to send to ipython and a second one to send to mcabber or weechat etc. That way it would be very easy to create code and on parallel discuss this code with others without ever having to use the clipboard manually.
from vim-slime.
This is all possible today, with some tweaking.
All buffers have their own "connection config". With different mappings, you could overwrite b:slime_config
before invoking the slime binding.
- send text to python, slime gets configured
- (save b:slime_config, set to null)
- send text to mcabber, slime gets configured
- now you have the saved b:slime_config from the python connection, and b:slime_config currently points to mcabber … if you swap those before you send to slime, you can send to the connection you want
You would, essentially, build a channel-selector in front of vim-slime.
from vim-slime.
Ok, that's nice. But this lacks the ability so select the transformations to apply as they are not contained in the slime_config
.
from vim-slime.
2-year old, closing.
from vim-slime.
Related Issues (20)
- Cursor returns to the beginning of a selection when sending code from a script in one tmux pane to the terminal in the other terminal pane. HOT 8
- send to multiple panes HOT 2
- How to send <Ctrl-C> via tmux? HOT 2
- <C-c><Text object> HOT 2
- Option to change bracket paste delimiters HOT 4
- neovim tmux in msys2 in windows HOT 4
- Run vimscript commands interactively HOT 5
- Issue #23 returns HOT 1
- Can SlimeConfig apply to all vim buffers HOT 10
- slime_no_mappings works only if declaredbefore plugin is loaded HOT 1
- Naming convention inconsistency HOT 1
- kitty slime broken in kitty v0.32 HOT 5
- WezTerm Pane Direction ID has trailing whitespace
- Proposal for Changes to `autoload/slime.vim` HOT 6
- Additional 'return' required when sending indented, commented code to ipython HOT 3
- neovim target TermOpen autocmd interactions with other terminal buffers HOT 3
- working with ConqueTerm HOT 1
- Error raised after trigger send if there is no neovim terminal opened HOT 6
- Issue to send multiple lines with recent versions of vim-slime HOT 7
- "Undefined variable: g:slime_config_defaults" on opening Python files HOT 6
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 vim-slime.