vim-scheme


Ⅰ. 插件描述

Interact with MIT Scheme from Neovim

Ⅱ. 基本信息

创建日期:  2018-04-16
使用用户:  1
Github星:  10
插件作者:  Oliver Caldwell

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'olical/vim-scheme-frighten-you'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'olical/vim-scheme-frighten-you'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'olical/vim-scheme-frighten-you'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/olical/vim-scheme

Ⅳ. 文档说明

# vim-scheme

Warning: Currently depends on [vim-sexp][] for selecting forms.

This plugin allows you to evaluate [Scheme][] from within your buffer. It delegates evaluation to an [mit-scheme][] REPL started by a Vim/Neovim :terminal command.

I wrote this tool to make working through [SICP][] easier, I thought I'd put it out there for use by other Lisp enthusiasts that can't (or won't) leave their beloved modal environment of choice.

Since I'm a [Clojure][] developer by day (and night), I named the commands and bindings after [vim-fireplace][].

Installation

Use your favourite plugin manager, mine is [vim-plug][].

Plug 'Olical/vim-scheme', { 'for': 'scheme', 'on': 'SchemeConnect' }

" You'll need vim-sexp too for selecting forms.
Plug 'guns/vim-sexp'

" And while you're here, tpope's bindings make vim-sexp a little nicer to use.
Plug 'tpope/vim-sexp-mappings-for-regular-people'

Usage

The plugin defines the following things:

  • :SchemeConnect which starts a REPL in a terminal buffer.
  • cp{motion...} evaluates the result of the motion, so cpaf is the current form your cursor is on.
  • cpp is a shorthand version of cpaf, can come in pretty handy.
  • <localleader>rc is bound to SchemeConnect.
  • <localleader>rr issues a restart, great for getting out of an error state.
  • <localleader>re evaluates the outer most / top level form and jumps the cursor back to where it was.
  • <localleader>rf evaluates the entire file and jumps the cursor back to where it was.

Note: The re and rf mappings use the s mark for jumping back to where your cursor was at the time of the evaluation. As long as you're not using the s mark for anything you shouldn't notice. This can be remapped or even improved in a PR.

Configuration

You may set g:scheme_split_size to change the size of the terminal that's created when you connect.

let g:scheme_split_size = -10

Thanks to [@markx][] you can set g:scheme_executable to change the name of the Scheme you wish to work with. If you'd like to work with Racket, for example, you can use this.

let g:scheme_executable = "racket"

The plugin mappings are currently set up for scheme or racket by default, you may have to pull request in more if you'd like to use them with another filetype.

Unlicenced

Find the full [unlicense][] in the UNLICENSE file, but here's a snippet.

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

Do what you want. Learn as much as you can. Unlicense more software.

添加新评论