Ⅰ. 插件描述
Interactively interface Vim with interpretersⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'iago-lito/intim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'iago-lito/intim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'iago-lito/intim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/iago-lito/intim
Ⅳ. 文档说明
# 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](https://github.com/jcfaria/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:
bashLaTeXRust, 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: askpythonfor themax()of the variable under cursor.;mx-edition-hotkey: actually wrap your variable inmax().
,sm-hotkey: askRfor thesummary()of the variable under cursor.;sm-edition-hotkey: actually wrap your variable insummary().
<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](http://www.gnu.org/copyleft/gpl.html). © 2017 Intim contributors