diff --git a/README.md b/README.md index 47152bf..3c6af65 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,22 @@ If for some reason vim can't find the path to the two launch scripts let g:sclangPipeApp = "~/.vim/bundle/scvim/bin/start_pipe" let g:sclangDispatcher = "~/.vim/bundle/scvim/bin/sc_dispatcher" +### Document support + +If vim is compiled with +clientserver option, SuperCollider can retrieve the path of the current vim buffer and enable String:loadRelative. +In debian based distributions, this option often comes with gui-enabled vim packages (vim-gtk for example). + + "fileInSameFolder.scd".loadRelative; + +To use this feature, you also need to start vim in server mode: + + vim --servername SCVIM + +You can change the default server name used by SuperCollider to contact vim: + + SCVim.vimServerName = "MYNAME"; + + Usage ----- To start open a file with the right extension :e foo.sc(d) diff --git a/sc/SCVim.sc b/sc/SCVim.sc index d11f4f2..b2127b1 100644 --- a/sc/SCVim.sc +++ b/sc/SCVim.sc @@ -23,13 +23,30 @@ SCVim.generateTagsFile(); */ +Document { + // needed for thisProcess.nowExecutingPath to work.. see Kernel::interpretCmdLine + var vimPath; + classvar nodes, <>vimPath, <>vimServerEnabled=false,