1
0
Fork
You've already forked intim
0
Interactively Interface Interpreters with Neovim
  • Vim Script 83.1%
  • Python 14.6%
  • R 2.3%
2025年08月13日 14:07:54 +02:00
doc Export more basic functions as functions. 2022年10月03日 12:08:45 +02:00
ftdetect Bunch-define invoke commands for python-likes 2018年03月23日 13:10:06 +01:00
ftplugin Bunch-define invoke commands for python-likes 2018年03月23日 13:10:06 +01:00
plugin Source in subshell to avoid spurious exit. 2025年08月13日 14:07:54 +02:00
.gitignore Start building doc/intim.txt :) 2017年06月03日 00:01:06 +02:00
LICENSE Escape backticks 2019年03月14日 22:11:04 +01:00
README.md Update copyright year. Not sure why, though.. 2020年08月12日 09:11:21 +02:00
TODO.md Map pdb commands with no arguments. 2019年03月28日 00:18:49 +01:00

Intim

interactively interface vim with interpreters


This plugin makes you open, from within Vim, an interactive interpreter in another terminal. This interpreter may be a shell, python, R or anything you want. You feed input to this terminal via predefined or custom Vim mappings: like sending commands, interrupting, restarting, analyzing variables etc.

This plugin is mostly inspired from vim-R plugin, a great plugin dedicated do this with R.
The intent is to extend the idea to any interpreter and to offer more configuration options.

Major features, as for today:

  • Launch interpreter session without leaving Vim.
  • Send lines, words, visual selections, chunks and whole files to your interpreter.
  • Dynamically update your syntax file to get your script variables colored as they get declared in your interpreter.
  • Use custom hotkeys to send very specific expressions built from the variables currently under cursor.
  • Bonus hotkeys edit your very script with these specific expressions.
  • Access and read the interpreter help from within a vim buffer.
  • Detect and handle debug modes.
  • Enter loops to get into their execution contexts.
  • Quit and restart Vim without exiting the session.
  • Easy configuration.
  • Easy extension to other languages.
    • Full-support yet for:
      • python, (Pdb) (2, 3, ipython, bpython, ...)
      • R
    • A few utilities already implemented for:
      • bash
      • LaTeX
      • Rust, C++ (gdb)

Installation

Intim uses tmux to open a multiplexed interactive shell session. Then Intim uses it to launch and communicate with your favourite interpreter. Tmux is typically installed on debian-based systems with:

sudo apt-get install tmux

on Arch, try:

sudo pacman -S tmux

Once done, install Intim with any Vim package manager you like.

With Pathogen

Typically

cd ~/.vim/bundle
git clone https://github.com/iago-lito/intim

With Vundle

Add the following line to your .vimrc:

Plugin 'iago-lito/intim'

Then run :PluginInstall.

First steps

Launch and close an Intim session with these default mappings.

nmap <F10> <Plug>IntimLaunchSession
nmap <F2> <Plug>IntimEndSession 

They should be automatically defined by Intim, unless you wish changing them to something you like better. Intim will try never to override a mapping you had before. In this case, you will have to pick another mapping yourself.

Then, start communicating with your interpreter with these default mappings:

  • <space>: send the current line to your interpreter.
  • ,<space>: send the word under cursor.
  • ,uc: update syntax coloring as your variables and functions get declared.
  • ,mx-hotkey: ask python for the max() of the variable under cursor.
    • ;mx-edition-hotkey: actually wrap your variable in max().
  • ,sm-hotkey: ask R for the summary() of the variable under cursor.
    • ;sm-edition-hotkey: actually wrap your variable in summary().
  • <F1>: ask your interpreter for help about the item under cursor.

Configure

Remap anything you want.

Enjoy hooks to manipulate, tile, bring focus to your terminal, play sounds or anything you like, for instance:

call IntimLaunchCommand('python', ['cd ~']) " first commands to tmux
call IntimInvokeCommand('python', 'python3 -B') " invoke your interpreter the way you like

Create any new hotkey you like, for instance:

call Intim_prefixedExpression('python', 'sf', 'self = ')
call Intim_headedExpression('R', 'ac', 'as.character')
call Intim_hotkeys('R', 'ii', '* <- * + 1')

Find more in :help intim<cr>.

Contribute

Intim code is open. It comes with no guarantees. But it also comes with extension points, and complete documentation to encourage development of any new feature. Feel free to contribute of course: share, comment, report bugs, ask for features, help in development, anything's good :)

License

This package is licensed under the GPL v3 license. © 2020 Intim contributors