factor/basis/editors/vim/vim.factor

24 lines
537 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
USING: definitions io io.launcher kernel math math.parser
2008-09-12 11:36:00 -04:00
namespaces parser prettyprint sequences editors accessors
2009-08-11 10:58:47 -04:00
make strings ;
2007-09-20 18:09:08 -04:00
IN: editors.vim
SYMBOL: vim-path
SYMBOL: vim-editor
2008-06-14 05:06:43 -04:00
HOOK: vim-command vim-editor ( file line -- array )
2007-09-20 18:09:08 -04:00
2008-06-14 05:11:30 -04:00
SINGLETON: vim
2007-09-20 18:09:08 -04:00
2008-06-14 05:06:43 -04:00
M: vim vim-command
2008-01-24 02:50:40 -05:00
[
2009-08-11 10:58:47 -04:00
vim-path get dup string? [ , ] [ % ] if
[ , ] [ number>string "+" prepend , ] bi*
2008-01-24 02:50:40 -05:00
] { } make ;
2007-09-20 18:09:08 -04:00
: vim ( file line -- )
vim-command run-detached drop ;
2007-09-20 18:09:08 -04:00
"vim" vim-path set-global
[ vim ] edit-hook set-global
\ vim vim-editor set-global