Skip to content

Commit

Permalink
APL REPL added (#24)
Browse files Browse the repository at this point in the history
* Updates to documentation

* Added apl as plugin

* README notes
  • Loading branch information
williamjameshandley authored Jan 2, 2020
1 parent e04eb42 commit dbd37d1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Vimteractive
============
:vimteractive: send commands from text files to interactive programs via vim
:Author: Will Handley
:Version: 2.2.1
:Version: 2.3.0
:Homepage: https://github.com/williamjameshandley/vimteractive
:Documentation: ``:help vimteractive``

Expand All @@ -28,6 +28,7 @@ The activating commands are
- zsh ``:Izsh``
- python ``:Ipython``
- clojure ``:Iclojure``
- apl ``:Iapl``
- autodetect based on filetype ``:Iterm``

Commands may be sent from a text file to the chosen terminal using ``CTRL-S``.
Expand Down Expand Up @@ -143,6 +144,7 @@ Supported terminals
- ``:Izsh`` Activate a zsh terminal
- ``:Ipython`` Activate a python terminal
- ``:Iclojure`` Activate a clojure terminal
- ``:Iapl`` Activate an apl terminal
- ``:Iterm`` Activate default terminal for this filetype

Sending commands
Expand Down
34 changes: 18 additions & 16 deletions doc/vimteractive.txt → doc/vimteractive
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*vimteractive.txt* Sending commands from vim to interactive programs
*vimteractive* Sending commands from vim to interactive programs

Vimteractive - main help file

Expand Down Expand Up @@ -35,6 +35,7 @@ The activating commands are
- zsh |:Izsh|
- python |:Ipython|
- clojure |:Iclojure|
- apl |:Iclojure|
- autodetect based on filetype |:Iterm|

Commands may be sent from a text file to the chosen terminal using CTRL-S. If
Expand All @@ -44,7 +45,7 @@ there is no terminal, CTRL-S will automatically open one for you using
Note: it's highly recommended to use IPython as your default Python
interpreter. You can set it like this:

let g:vimteractive_default_shells = { 'python': 'ipython' }
let g:vimteractive_default_shells = { 'python': 'ipython' }

Since this package leverages the native vim interactive terminal, it is
only compatible with vim 8 or greater.
Expand All @@ -60,7 +61,7 @@ stty -ixon
into your .bashrc (or equivalent shell profile file)

------------------------------------------------------------------------------
Example usage *vimteractive-usage*
Example usage *vimteractive-example*

Create a python file "test.py" with the following content:

Expand Down Expand Up @@ -96,14 +97,15 @@ connect two buffers to one terminal, use |:Iconn| command.
------------------------------------------------------------------------------
Supported terminals *vimteractive-terminals*

*:Iipython* Activate an ipython terminal
*:Ijulia* Activate a julia terminal
*:Imaple* Activate a maple terminal
*:Ibash* Activate a bash terminal
*:Izsh* Activate a zsh terminal
*:Ipython* Activate a python terminal
*:Iclojure* Activate a clojure terminal
*:Iterm* Activate a terminal based on current filetype
*:Iipython* Activate an ipython terminal
*:Ijulia* Activate a julia terminal
*:Imaple* Activate a maple terminal
*:Ibash* Activate a bash terminal
*:Izsh* Activate a zsh terminal
*:Ipython* Activate a python terminal
*:Iclojure* Activate a clojure terminal
*:Iapl* Activate an apl terminal
*:Iterm* Activate a terminal based on current filetype

------------------------------------------------------------------------------
Sending commands *v_CTRL_S*
Expand Down Expand Up @@ -141,7 +143,7 @@ interpreter, you may be on an older system which does not have bracketed paste
enabled, or have other shell misbehaviour issues. You can change the default
setting with

let g:vimteractive_bracketed_paste_default = 0
let g:vimteractive_bracketed_paste_default = 0


==============================================================================
Expand All @@ -159,23 +161,23 @@ These options can be put in your |.vimrc|, or run manually as desired:
To add a new interpreter to Vimteractive, you should define
g:vimteractive_commands variable. For example:

let g:vimteractive_commands = { 'pythonasync': 'python -m asyncio' }
let g:vimteractive_commands = { 'pythonasync': 'python -m asyncio' }

will provide you :Ipythonasync command starting Python 3.8+ asyncio REPL.
If you want to make this command default for python filetype, you should do

let g:vimteractive_default_shells = { 'python': 'pythonasync' }
let g:vimteractive_default_shells = { 'python': 'pythonasync' }

If you see escape sequences appearing when you do CTRL-S for your interpreter,
you may try to disable bracketed paste mode for it:

let g:vimteractive_bracketed_paste = { 'pythonasync': 0 }
let g:vimteractive_bracketed_paste = { 'pythonasync': 0 }

If your interpreter has slow-starting REPL (like Clojure), you may want to
wait before sending data to it at the first time. Specify time to wait in
milliseconds like this:

let g:vimteractive_slow_prompt = { 'pythonasync': 200 }
let g:vimteractive_slow_prompt = { 'pythonasync': 200 }

This project is very much in an beta phase, so if you have any issues that
arise on your system, feel free to contact me:
Expand Down
2 changes: 2 additions & 0 deletions plugin/vimteractive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ let g:vimteractive_commands.zsh = 'zsh'
let g:vimteractive_commands.julia = 'julia'
let g:vimteractive_commands.maple = 'maple -c "interface(errorcursor=false);"'
let g:vimteractive_commands.clojure = 'clojure'
let g:vimteractive_commands.apl = 'apl'

" Override default shells for different filetypes
if !has_key(g:, 'vimteractive_default_shells')
Expand All @@ -53,6 +54,7 @@ let g:vimteractive_bracketed_paste.clojure = 0
let g:vimteractive_bracketed_paste.python = 0
let g:vimteractive_bracketed_paste.python2 = 0
let g:vimteractive_bracketed_paste.python3 = 0
let g:vimteractive_bracketed_paste.apl = 0

" If present, wait this amount of time in ms when starting term on ^S
if !has_key(g:, 'vimteractive_slow_prompt')
Expand Down

0 comments on commit dbd37d1

Please sign in to comment.