vim-factor


Ⅰ. 插件描述

Pathogen-friendly packaging of Factor's Vim support (BSD licensed). I have no plans of actively maintaining this, it's mainly for personal convenience.

Ⅱ. 基本信息

创建日期:  2012-12-19
使用用户:  6
Github星:  6
插件作者:  Brandon Bloom

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Vim support for Factor

This directory contains various support files that make editing Factor code
more pleasant in Vim.

Installation

The file-layout exactly matches the Vim runtime
structure, so you can install them by copying the contents of this directory
into ~/.vim/ or the equivalent path on other platforms (Open Vim and type
:help 'runtimepath' for details).

File organization

The current set of files is as follows:

  • ftdetect/factor.vim - Teach Vim when to load Factor support files.
  • ftplugin/factor.vim - Teach Vim to follow the Factor Coding Style guidelines.
  • plugin/factor.vim - Teach Vim some commands for navigating Factor source code. See below.
  • syntax/factor.vim - Syntax highlighting for Factor code.

Commands

The plugin/factor.vim file implements the following commands for navigating Factor source.

:FactorVocab factor.vocab.name

Opens the source file implementing the factor.vocab.name vocabulary.

:NewFactorVocab factor.vocab.name

Creates a new factor vocabulary under the working vocabulary root.

:FactorVocabImpl

Opens the main implementation file for the current vocabulary
(name.factor). The keyboard shortcut <Leader>fi is bound to this command.

:FactorVocabDocs

Opens the documentation file for the current vocabulary
(name-docs.factor). The keyboard shortcut <Leader>fd is bound to this command.

:FactorVocabTests

Opens the unit test file for the current vocabulary
(name-tests.factor). The keyboard shortcut <Leader>ft is bound to this command.

Configuration

In order for the :FactorVocab command to work, you'll need to set some variables in your vimrc file.

g:FactorRoot

This variable should be set to the root of your Factor

  1. The default value is ~/factor.

g:FactorVocabRoots

This variable should be set to a list of Factor vocabulary roots.
The paths may be either relative to g:FactorRoot or absolute paths.
The default value is ["core", "basis", "extra", "work"].

g:FactorNewVocabRoot

This variable should be set to the vocabulary root in which
vocabularies created with NewFactorVocab should be created.
The default value is work.

Note

The syntax-highlighting file is automatically generated to include the
names of all the vocabularies Factor knows about. To regenerate it manually,
run the following code in the listener:

"editors.vim.generate-syntax" run

or run it from the command line:

factor -run=editors.vim.generate-syntax

添加新评论