working on contrib/vim
parent
2228c9fe54
commit
db061d7d4c
|
@ -2,14 +2,19 @@ IN: vim
|
||||||
USING: definitions embedded io kernel namespaces parser prettyprint process
|
USING: definitions embedded io kernel namespaces parser prettyprint process
|
||||||
sequences ;
|
sequences ;
|
||||||
|
|
||||||
|
SYMBOL: vim-path
|
||||||
|
|
||||||
|
"vim" vim-path set-global
|
||||||
|
|
||||||
|
: vim-command ( file line -- string )
|
||||||
|
[ "\"" % vim-path get % "\" \"" % swap % "\" +" % # ] "" make ;
|
||||||
|
|
||||||
: vim-location ( file line -- )
|
: vim-location ( file line -- )
|
||||||
>r [ file-modified ] keep r>
|
vim-command run-process ;
|
||||||
[ "vim \"" % over % "\" +" % # ] "" make system drop
|
|
||||||
file-modified = [ drop ] [ run-file ] if ;
|
|
||||||
|
|
||||||
: vim ( spec -- )
|
: vim ( spec -- )
|
||||||
#! Edit the file in vim. Rerun the file if the timestamp is changed.
|
#! Edit the file in vim. Rerun the file if the timestamp is changed.
|
||||||
dup where first2 vim-location ;
|
where first2 vim-location ;
|
||||||
|
|
||||||
[ vim-location ] edit-hook set-global
|
[ vim-location ] edit-hook set-global
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue