Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbrooksuk/sublime-evaluate
Selection evaluation in Sublime Text
https://github.com/jbrooksuk/sublime-evaluate
Last synced: about 11 hours ago
JSON representation
Selection evaluation in Sublime Text
- Host: GitHub
- URL: https://github.com/jbrooksuk/sublime-evaluate
- Owner: jbrooksuk
- Created: 2011-09-20T14:46:52.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T08:25:02.000Z (almost 6 years ago)
- Last Synced: 2024-08-02T13:34:43.779Z (2 months ago)
- Language: Python
- Homepage: https://james-brooks.uk
- Size: 1.47 MB
- Stars: 24
- Watchers: 1
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sublime Evaluate [![Gittip](http://badgr.co/gittip/jbrooksuk.png)](https://www.gittip.com/jbrooksuk/)
A powerful plugin which returns the value of selected regions.# Evaluation Environment
Sublime Evaluate is able to evaluate the `math` and `datetime` import as part of its enviroment. This opens up access to a whole range of Python functions such as:```python
math.atan2(80, 40)math.pi * 60
datetime.date(2013,4,2) # Returns a formatted date
datetime.date.today()
```We can also perform morecomplex expressions such as:
```python
(math.pi * 2) / math.pi * 0.5
```# Evaluate Shell Script
Sublime Evaluate also supports evaluating code as shell script, Just add a `!` at the beginning:```bash
! echo hello # > hello! ! true; echo $? # > 1
# Even multilines
! for i in `seq 10`; do
echo I got a $i
done```
#### Current Working Dir
Current working dir is the Sublime install dir. You can get it with a `!pwd`.#### Stderr
Stderr is captured as well as stdout.#### Timeout
Currently a 5s timeout is set. You code will be terminated when it runs more than 5s.#### OS/Sublime Support
Though the it is supposed to work on all OSs / Sublime 2/3, this feature is tested on macOS + Sublime 3.Please kindly report to us if you find an issue. We'd be happy to fix it.
#### Demo
![](shell-eval.gif)# License
MIT - [http://jbrooksuk.mit-license.org](http://jbrooksuk.mit-license.org)