All Projects → metakirby5 → Codi.vim

metakirby5 / Codi.vim

Licence: mit
📔 The interactive scratchpad for hackers.

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to Codi.vim

Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (-88.47%)
Mutual labels:  interpreter, repl
Mico
Mico ("Monkey" in catalan). Monkey language implementation done with C++. https://interpreterbook.com/
Stars: ✭ 19 (-99.23%)
Mutual labels:  interpreter, repl
Ok
An open-source interpreter for the K5 programming language.
Stars: ✭ 408 (-83.44%)
Mutual labels:  interpreter, repl
malluscript
A simple,gentle,humble scripting language for mallus, based on malayalam memes.
Stars: ✭ 112 (-95.45%)
Mutual labels:  interpreter, repl
Charly
🐈 The Charly Programming Language | Written by @KCreate
Stars: ✭ 185 (-92.49%)
Mutual labels:  interpreter, repl
lambda-dti
Interpreter of the ITGL with dynamic type inference
Stars: ✭ 18 (-99.27%)
Mutual labels:  interpreter, repl
Bic
A C interpreter and API explorer.
Stars: ✭ 719 (-70.82%)
Mutual labels:  interpreter, repl
klisp
A Lisp written in about 200 lines of Ink, featuring an interactive literate programming notebook
Stars: ✭ 28 (-98.86%)
Mutual labels:  interpreter, repl
Endbasic
BASIC environment with a REPL, a web interface, and RPi support written in Rust
Stars: ✭ 106 (-95.7%)
Mutual labels:  interpreter, repl
Goto
Goto is an interpreted programming language written in go.
Stars: ✭ 79 (-96.79%)
Mutual labels:  interpreter, repl
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (-98.34%)
Mutual labels:  interpreter, repl
Gomacro
Interactive Go interpreter and debugger with REPL, Eval, generics and Lisp-like macros
Stars: ✭ 1,784 (-27.6%)
Mutual labels:  interpreter, repl
lambda
lambda calculus interpreter
Stars: ✭ 23 (-99.07%)
Mutual labels:  interpreter, repl
retro12
This repo is retired. See http://forthworks.com:8000/
Stars: ✭ 18 (-99.27%)
Mutual labels:  interpreter, repl
ol
Otus Lisp (Ol in short) is a purely* functional dialect of Lisp.
Stars: ✭ 157 (-93.63%)
Mutual labels:  interpreter, repl
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (+91.76%)
Mutual labels:  interpreter, repl
charm
A [ functional stack ] based language.
Stars: ✭ 26 (-98.94%)
Mutual labels:  interpreter, repl
endbasic
BASIC environment with a REPL, a web interface, a graphical console, and RPi support written in Rust
Stars: ✭ 220 (-91.07%)
Mutual labels:  interpreter, repl
Mappy
A functional programming language. Like LISP but focused around maps rather than lists.
Stars: ✭ 10 (-99.59%)
Mutual labels:  interpreter, repl
Brain
An esoteric programming language compiler on top of LLVM based on Brainfuck
Stars: ✭ 112 (-95.45%)
Mutual labels:  interpreter, repl

codi.vim Gitter Buy Me a Coffee at ko-fi.com

The interactive scratchpad for hackers.

Codi demo.

Using Codi as a Python scratchpad through the shell wrapper

Codi is an interactive scratchpad for hackers, with a similar interface to Numi. It opens a pane synchronized to your main buffer which displays the results of evaluating each line as you type (with NeoVim or Vim with +job and +channel, asynchronously). It's extensible to nearly any language that provides a REPL (interactive interpreter)!

Languages with built-in support: Python, JavaScript, CoffeeScript, Haskell, PureScript, Ruby, OCaml, R, Clojure/ClojureScript, PHP, Lua, C++, Julia, Elm, Elixir, TypeScript, Mathjs

Pull requests for new language support welcome!

Note: without async support, evaluation will trigger on cursor hold rather than text change.

For more information, check out the documentation. Watch a screencast!

Installation

Use your favorite package manager (vim-plug, Vundle, pathogen.vim), or add this directory to your Vim runtime path.

For example, if you're using vim-plug, add the following line to ~/.vimrc:

Plug 'metakirby5/codi.vim'

Dependencies

  • OS X or Linux (Windows support coming soon!)
  • Vim 7.4 (with +job and +channel for asynchronous evaluation) or NeoVim (still in its infancy - please report bugs!)
  • uname
  • If not using NeoVim, script (BSD or Linux, man page should say at least 2013)

Each interpreter also depends on its REPL. These are loaded on-demand. For example, if you only want to use the Python Codi interpreter, you will not need ghci.

Default interpreter dependencies:

  • Python: python
  • JavaScript: node
  • CoffeeScript: coffee
  • Haskell: ghci (be really careful with lazy evaluation!)
  • PureScript pulp psci
  • Ruby: irb
  • OCaml: ocaml
  • R: R
  • Clojure: planck
  • PHP: psysh
  • Lua: lua
  • C++: cling
  • Julia: julia
  • Elm: elm
  • Elixir: iex
  • TypeScript: tsun
  • Mathjs: mathjs

Usage

  • Codi [filetype] activates Codi for the current buffer, using the provided filetype or the buffer's filetype.
  • Codi! deactivates Codi for the current buffer.
  • Codi!! [filetype] toggles Codi for the current buffer, using the provided filetype or the buffer's filetype.

Shell wrapper

A nice way to use Codi is through a shell wrapper that you can stick in your ~/.bashrc:

# Codi
# Usage: codi [filetype] [filename]
codi() {
  local syntax="${1:-python}"
  shift
  vim -c \
    "let g:startify_disable_at_vimenter = 1 |\
    set bt=nofile ls=0 noru nonu nornu |\
    hi ColorColumn ctermbg=NONE |\
    hi VertSplit ctermbg=NONE |\
    hi NonText ctermfg=0 |\
    Codi $syntax" "$@"
}

Options

  • g:codi#interpreters is a list of user-defined interpreters. See the documentation for more information.
  • g:codi#aliases is a list of user-defined interpreter filetype aliases. See the documentation for more information.

The below options can also be set on a per-interpreter basis via g:codi#interpreters:

  • g:codi#autocmd determines what autocommands trigger updates. See the documentation for more information.
  • g:codi#width is the width of the Codi split.
  • g:codi#rightsplit is whether or not Codi spawns on the right side.
  • g:codi#rightalign is whether or not to right-align the Codi buffer.
  • g:codi#autoclose is whether or not to close Codi when the associated buffer is closed.
  • g:codi#raw is whether or not to display interpreter results without alignment formatting (useful for debugging).
  • g:codi#sync is whether or not to force synchronous execution. No reason to touch this unless you want to compare async to sync.

Autocommands

  • CodiEnterPre, CodiEnterPost: When a Codi pane enters.
  • CodiUpdatePre, CodiUpdatePost: When a Codi pane updates.
  • CodiLeavePre, CodiLeavePost: When a Codi pane leaves.

FAQ

  • Why doesn't X work in Codi, when it works in a normal source file?
    • Codi is not meant to be a replacement for actually running your program; it supports nothing more than what the underlying REPL supports. This is why Haskell language pragmas don't work and OCaml statements must end with ;;.
  • Codi leaves a bunch of old processes running, what's going on?
    • The cause of this issue is still unknown, but it happens infrequently. See :h codi-introduction-warnings for more information.
  • Codi doesn't seem to work on my setup.
    • Check :h codi-introduction-gotchas.

Thanks to

  • @DanielFGray and @purag for testing, feedback, and suggestions
  • @Joaquin-V for helping me discover critical bugs with vanilla settings
  • Everyone who has reported an issue or sent in a pull request :)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].