Skip to content

Commit

Permalink
Added ability to have vertical terminals (#21)
Browse files Browse the repository at this point in the history
* Added ability to have vertical terminals

* Corrected comment lines

* Updated changelog
  • Loading branch information
williamjameshandley authored Dec 13, 2019
1 parent 3c1def1 commit 306c74e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
12 changes: 11 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.1.0
:Version: 2.2.0
:Homepage: https://github.com/williamjameshandley/vimteractive
:Documentation: ``:help vimteractive``

Expand Down Expand Up @@ -160,6 +160,15 @@ In Visual mode, ``CTRL-S`` sends the current selection to the terminal.

``ALT-S`` sends all lines from the start to the current line.

Options
~~~~~~~
These options can be put in your ``.vimrc``, or run manually as desired:

.. code:: vim
let g:vimteractive_vertical = 1 " Vertically split terminals
let g:vimteractive_autostart = 0 " Don't start terminals by default
Extending functionality
-----------------------

Expand Down Expand Up @@ -218,6 +227,7 @@ Similar projects

Changelist
----------
:v2.2: `Vertical splitting option <https://github.com/williamjameshandley/vimteractive/pull/21>`__
:v2.1: `Visual selection improvement <https://github.com/williamjameshandley/vimteractive/pull/15>`__
:v2.0: `Multiple terminal functionality <https://github.com/williamjameshandley/vimteractive/pull/9>`__
:v1.7: `Autodetection of terminals <https://github.com/williamjameshandley/vimteractive/pull/5>`__
Expand Down
6 changes: 4 additions & 2 deletions autoload/vimteractive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ function! vimteractive#term_start(term_type)
if v:version < 801
call term_start(l:term_command, {
\ "term_name": l:term_bufname,
\ "term_finish": "close"
\ "term_finish": "close",
\ "vertical": g:vimteractive_vertical
\ })
else
call term_start(l:term_command, {
\ "term_name": l:term_bufname,
\ "term_kill": "term",
\ "term_finish": "close"
\ "term_finish": "close",
\ "vertical": g:vimteractive_vertical
\ })
endif

Expand Down
11 changes: 10 additions & 1 deletion doc/vimteractive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ create one for you using |:Iterm|.
connect any number of buffers to one REPL. {buffer}
can be omitted if there is only one terminal.

==============================================================================
3. Vimteractive options *vimteractive-options*

These options can be put in your |.vimrc|, or run manually as desired:

let g:vimteractive_vertical = 1 " Vertically split terminals
let g:vimteractive_autostart = 0 " Don't start terminals by default


==============================================================================
4. Extending functionality *vimteractive-extending*

Expand Down Expand Up @@ -159,7 +168,7 @@ milliseconds like this:
This project is very much in an alpha phase, so if you have any issues that
arise on your system, feel free to contact me:

[email protected].
[email protected]

==============================================================================
5. About *vimteractive-functionality*
Expand Down
6 changes: 6 additions & 0 deletions plugin/vimteractive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ if !has_key(g:, 'vimteractive_autostart')
let g:vimteractive_autostart = 1
endif

" Start in a horizontal terminal by default
if !has_key(g:, 'vimteractive_vertical')
let g:vimteractive_vertical = 0
endif

" Variables for running the various sessions
if !has_key(g:, 'vimteractive_commands')
let g:vimteractive_commands = { }
endif


let g:vimteractive_commands.ipython = 'ipython --matplotlib --no-autoindent'
let g:vimteractive_commands.ipython2 = 'ipython2 --matplotlib --no-autoindent'
let g:vimteractive_commands.ipython3 = 'ipython3 --matplotlib --no-autoindent'
Expand Down

0 comments on commit 306c74e

Please sign in to comment.