Giter Site home page Giter Site logo

tomtom / tterminal_vim Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 32 KB

Evaluate code in a terminal (with special support for R)

License: GNU General Public License v3.0

Vim Script 91.41% R 8.52% Rebol 0.07%
vim vim-plugin r terminal vim-terminal

tterminal_vim's Introduction

The :Tterminal command facilitates evaluating code in a terminal.

  • It start the right command (defined via run configurations aka "runconfigs") for the current filetype
  • It installs a map (<c-cr>) that sends the current line or selection to the terminal
  • For certain filetypes (e.g. R) it also supports omnicompletion (see 'omnifunc') via <c-x><c-o> NOTE: The terminal must be visible for this to work since this relies on terminal-api.
  • All buffers with the same runconfig and the same working directory (usually all buffers of a project with the same 'filetype') share the same terminal

Examples: >

" Run a terminal with the default command for the current filetype.
" If no runconfig is defined for the current filetype, open 'shell'.
:Tterminal

" Run a terminal with a custom runconfig (e.g. a command with special 
" command-line arguments)
:Tterminal r-nosave

" Run a terminal with custom command (if the name is no pre-configured 
" runconfig)
:Tterminal my-r-wrapper.sh

General maps:

<c-cr> ... Send the current line or selection to the terminal

For additional maps per filetype please see:

R -> tterminal#runconfig#r#SetupBuffer()


Install

Either use the zip archive:

  • Download the zip archive
  • Extract it to ~/.vim/pack/tml/start/tterminal_vim

or install from github:

  • Start a terminal
  • Change the working directory to ~/.vim/pack/tml/start/
  • Type: git clone https://github.com/tomtom/tterminal_vim

or use a VIM plugin manager like vim-plug, vundle, dein.vim, VAM etc.

NOTE: On Windows, ~/.vim might be ~/vimfiles. Please see 'runtimepath' for details.

Some features require the tlib_vim plugin to be installed: https://github.com/tomtom/tlib_vim

Also available via git: http://github.com/tomtom/tterminal_vim

Setup

Please configure the plugin via the following parameters:

  • g:tterminal_autoenable_filetypes
  • g:tterminal#runconfigs
  • g:tterminal#cmd_map

License: GPLv3 or later

tterminal_vim's People

Contributors

tomtom avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.