Comments (5)
In iron you can send multiple lines together as a chunk of text using the the mapping for send motion, just like in the example config:
iron.setup {
config = {
-- ...
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
keymaps = {
send_motion = "<space>sc",
-- ...
}
}
In this case, if you run <space>scap
you'll send the whole paragraph. If you use treesitter, you can use nvim-treesitter-textobjects' af
to send a function: <space>scaf
.
I hope this helps.
Best regards,
Henry
from iron.nvim.
Hi, <space>scap
is perfect. This is exactly what I needed. I also found the following technique but I don't really know why it works. It is less immediate compared to the command you were suggesting though. Sardine is the name of a custom Python interpreter I am running (see my repo):
python = {
command = { "sardine" },
format = require("iron.fts.common").bracketed_paste,
},
How would you remap <space>scap
on something like <space><CR>
?
from iron.nvim.
ap
is a vim text object that would read as around paragraph
, just like iw
would read `inner word.
You should be able to use regular nmap <space><CR> <space>scap
, but bear in mind that it is usually preferred to use text objects and motions as each case is different. If, for example, you have a function with an empty line, say, for better readability, you'd probably want to use treesitter's af
instead, or at least <space>sc2ap
, for sending two whole paragraphs instead.
I hope this solves your issue, but feel free to reopen if you have any further questions!
from iron.nvim.
For reference, here is the link to treesitter's text-object: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
from iron.nvim.
I am facing a similar problem regarding the ap
key binding.
I have send_motion = "<c-s>"
, and indeed I can send a paragraph of text by typing <c-s>ap
.
However, I am unable to abbreviate this sequence of keys to <c-z>
.
I attempted the latter by writing vim.keymap.set("n", "<c-z>", "<c-s>ap")
.
Which mistake am I making?
Thanks in advance!
from iron.nvim.
Related Issues (20)
- Unable to send a cell to repl HOT 5
- [Feature Request] Send a valid Treesitter node to REPL HOT 2
- Code not sent to R REPL if REPL doesn't already exist
- Send multiline code chunk HOT 4
- bug(python): python REPL detection is broken HOT 5
- On start error, the REPL window closes immediately so one can't read the error
- config broken? HOT 2
- basic config leads to python unexpected indent HOT 7
- Allow 'cwd' option on repl_definition? Potential PR HOT 1
- repl on the bottom makes status window disappear HOT 1
- code is sent to the ipython console but not run HOT 16
- iron.core not found with LazyVim HOT 1
- Why am I not able to resize the REPL window/split? HOT 2
- How to detach from the IronFocus window HOT 4
- Connect to python kernel and virtual environment
- Abandoned? HOT 2
- Highlights randomly appears and disappears
- How to resize REPL window HOT 1
- Fix broken tests
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 iron.nvim.