Comments (8)
I like this idea, and I don't think it would be too difficult to implement. Though I'd likely change run-before
to require
, so it would look like this:
<!-- name: library -->
```python
import numpy as np
```
<!-- target: array, require: library -->
```python
print(np.array([1,2,3]))
```
<!-- name: array -->
```
result
```
I'll take a look at implementing this when I have some time.
from vim-medieval.
Please give the require
branch (#5) a try and let me know if you run into any issues. Also let me know if all looks well, and I'll merge it into master.
from vim-medieval.
Sorry, I found your plugin yesterday and I didn't have it installed. I'm testing some stuff now but there are some things not working for me (for example, :EvalBlock
alone is not working, I'll see if I see why and if not I'll open another issue)
This is my configuration:
Plug 'gpanders/vim-medieval', { 'branch': 'require' }
let g:medieval_langs = ['python', 'sh', 'console=bash']
So far I can tell you that:
- Your examples of
require
in the docs work if runned with:EvalBlock!
or:EvalBlock output
(withoutput
being the name of the output block). - If you misspell the
require
code block, the block runs anyway but without the required code block, of course. This is nice I think, this way I can have a snippet with<!-- target: blabla, require: -->
leave therequire
field blank if not necessary. - This is not working for me:
<!-- name: library -->
```sh
x=5
```
<!-- target: output, require: library -->
```sh
echo $x
```
But this works:
<!-- target: output, require: library -->
```sh
x=5
echo $x
```
As I said, I could only test with :EvalBlock!
and :EvalBlock output
.
And sorry again, since I don't know much bout vimscripting and cannot be of much help looking at the code.
from vim-medieval.
Your example wasn't working for me either, and I figured out why. It's a problem that only happens when the very first line is a block label (as in your example). I just pushed a fix for that, so please try again.
from vim-medieval.
It works now for me with :EvalBlock output
and :EvalBlock!
.
from vim-medieval.
It works correctly for me with :EvalBlock
as well if I don't have
set clipboard=unnamed
in my vimrc.
from vim-medieval.
See my comment in #6.
from vim-medieval.
Merged in #5.
from vim-medieval.
Related Issues (8)
- Regex Custom Block Support HOT 3
- Last line missing from output when it doesn't have an endline HOT 3
- [Feature request] Add a hook or event at end of evaluation HOT 5
- Feature request: Asynchronous execution HOT 2
- `:EvalBlock` not working HOT 7
- Feature request: create result code block if "target" does not match any "name" HOT 1
- [Question] Feature comparison with org-babel. HOT 4
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-medieval.