autofind the path for gvim on unix and windows
parent
4cde2561e2
commit
b475180d8e
|
@ -1,10 +1,18 @@
|
|||
USING: kernel math math.parser namespaces editors.vim ;
|
||||
USING: io.backend io.files kernel math math.parser
|
||||
namespaces editors.vim sequences system windows.shell32 ;
|
||||
IN: editors.gvim
|
||||
|
||||
TUPLE: gvim ;
|
||||
|
||||
HOOK: gvim-path io-backend ( -- path )
|
||||
|
||||
|
||||
M: gvim vim-command ( file line -- string )
|
||||
[ "\"" % vim-path get % "\" \"" % swap % "\" +" % # ] "" make ;
|
||||
[ "\"" % gvim-path % "\" \"" % swap % "\" +" % # ] "" make ;
|
||||
|
||||
t vim-detach set-global ! don't block the ui
|
||||
|
||||
T{ gvim } vim-editor set-global
|
||||
"gvim" vim-path set-global
|
||||
|
||||
USE-IF: unix? editors.gvim.unix
|
||||
USE-IF: windows? editors.gvim.windows
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
USING: editors.gvim io.unix.backend kernel namespaces ;
|
||||
IN: editors.gvim.unix
|
||||
|
||||
M: unix-io gvim-path
|
||||
\ gvim-path get-global [
|
||||
"gvim"
|
||||
] unless* ;
|
|
@ -0,0 +1,8 @@
|
|||
USING: editors.gvim io.files io.windows kernel namespaces
|
||||
sequences windows.shell32 ;
|
||||
IN: editors.gvim.windows
|
||||
|
||||
M: windows-io gvim-path
|
||||
\ gvim-path get-global [
|
||||
program-files walk-dir [ "gvim.exe" tail? ] find nip
|
||||
] unless* ;
|
Loading…
Reference in New Issue