4 This directory contains various support files that make editing Factor code
9 The file-layout exactly matches the Vim runtime structure,
10 so you can install them by copying the contents of this directory
11 into `~/.vim/` or the equivalent path on other platforms
12 (open Vim and type `:help 'runtimepath'` for details).
16 The current set of files is as follows:
18 * ftdetect/factor.vim - Teach Vim when to load Factor support files.
19 * ftplugin/factor.vim - Teach Vim to follow the Factor Coding Style guidelines.
20 * ftplugin/factor-docs.vim - Teach Vim about documentation style differences.
21 * plugin/factor.vim - Teach Vim some commands for navigating Factor source code. See below.
22 * syntax/factor.vim - Teach Vim about highlighting Factor source code syntax.
23 * syntax/factor/generated.vim - Syntax highlighting lessons generated from a Factor VM.
27 The `plugin/factor.vim` file implements the following commands for navigating Factor source.
29 ### :FactorVocab factor.vocab.name
31 Opens the source file implementing the `factor.vocab.name` vocabulary.
33 ### :NewFactorVocab factor.vocab.name
35 Creates a new factor vocabulary under the working vocabulary root.
39 Opens the main implementation file for the current vocabulary
40 (name.factor). The keyboard shortcut `<Leader>fi` is bound to this command.
44 Opens the documentation file for the current vocabulary
45 (name-docs.factor). The keyboard shortcut `<Leader>fd` is bound to this command.
49 Opens the unit test file for the current vocabulary
50 (name-tests.factor). The keyboard shortcut `<Leader>ft` is bound to this command.
54 In order for the `:FactorVocab` command to work, you'll need to set some variables in your vimrc file.
58 This variable should be set to the root of your Factor
59 installation. The default value is `~/factor`.
61 ### g:FactorVocabRoots
63 This variable should be set to a list of Factor vocabulary roots.
64 The paths may be either relative to g:FactorRoot or absolute paths.
65 The default value is `["core", "basis", "extra", "work"]`.
67 ### g:FactorNewVocabRoot
69 This variable should be set to the vocabulary root in which
70 vocabularies created with NewFactorVocab should be created.
71 The default value is `work`.
75 The `syntax/factor/generated.vim` syntax highlighting file
76 is automatically generated
77 to include the names of all the vocabularies Factor knows about.
78 To regenerate it manually, run the following code in the listener:
80 "editors.vim.generate-syntax" run
82 or run it from the command line:
84 factor -run=editors.vim.generate-syntax