]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/vim/vim.factor
a62ed9e0a5af6dc176085fcec20d50912f24c4fa
[factor.git] / basis / editors / vim / vim.factor
1 USING: definitions io io.launcher kernel math math.parser
2 namespaces parser prettyprint sequences editors accessors
3 make strings ;
4 IN: editors.vim
5
6 SYMBOL: vim-path
7 SYMBOL: vim-editor
8 HOOK: vim-command vim-editor ( file line -- array )
9
10 SINGLETON: vim
11
12 M: vim vim-command
13     [
14         vim-path get dup string? [ , ] [ % ] if
15         [ , ] [ number>string "+" prepend , ] bi*
16     ] { } make ;
17
18 : vim ( file line -- )
19     vim-command run-detached drop ;
20
21 "vim" vim-path set-global
22 [ vim ] edit-hook set-global
23 \ vim vim-editor set-global