|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
[linux] scvim help folder installationhi,
I just realised that the 'scvim-help' directory gets installed to PREFIX/share/SuperCollider instead of the PREFIX/share/SuperCollider/Help folder. its just cosmetic, but plays some role when packaging sc. call me a neat-freak :) greetings, karsten [SConstruct.diff] 1103c1103 < pkg_data_dir(INSTALL_PREFIX, 'scvim-help'), --- > pkg_data_dir(INSTALL_PREFIX, 'Help/scvim-help'), _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationor even cleaner: install the help in "Extensions/scvim/Help"? Would be glad if someone could look this over and commit, as it would make packaging supercollider much easier (less exceptions to write).
thanks, karsten On Thu, May 1, 2008 at 3:08 PM, krgn <k.gebbert@...> wrote: hi, [SConstruct.diff] 1103c1103 < pkg_data_dir(INSTALL_PREFIX, 'scvim-help'), --- > pkg_data_dir(INSTALL_PREFIX, 'Extensions/scvim/Help'), _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationOn Thursday 01 May 2008 10:08:31 krgn wrote:
> hi, > > I just realised that the 'scvim-help' directory gets installed to > PREFIX/share/SuperCollider instead of the PREFIX/share/SuperCollider/Help > folder. its just cosmetic, but plays some role when packaging sc. call me a > neat-freak :) This is done intentionally, since the scvim-help files are not html but text based. If you have converted the complete helpfiles to text based documents, you don't want to have both in the Help tree of supercollider to show up in the Help.gui, as everything would show up twice. sincerely, Marije _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationOn Thursday 01 May 2008 15:52:27 nescivi wrote:
> On Thursday 01 May 2008 10:08:31 krgn wrote: > > hi, > > > > I just realised that the 'scvim-help' directory gets installed to > > PREFIX/share/SuperCollider instead of the PREFIX/share/SuperCollider/Help > > folder. its just cosmetic, but plays some role when packaging sc. call me > > a neat-freak :) > > This is done intentionally, since the scvim-help files are not html but > text based. If you have converted the complete helpfiles to text based > documents, you don't want to have both in the Help tree of supercollider to > show up in the Help.gui, as everything would show up twice. addendum: it could be good to have the help file for the SCVim class itself inside the class extension folder, so that it *will* show up in the Help.gui, and just have in the scvin-help folder the converted files of the main Help file tree. sincerely, Marije _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationSo I've been thinking about this a little bit.
first, a little bit of background for those who don't know scvim so well. scvim has a script that it runs in order to remove html and rtf formatting from help files so that they can be used as help files within vim itself. As vim is simply a text editor it doesn't do any html or rtf formatting [which is preferable if you ask me], so the html/rtf help files aren't very useful inside vim. I figure the install script should run this unhtml/unrtf script so that scvim users have the help docs when they first run scvim. I figure PREFIX/share/SuperCollider/scvim-help is a file place for that.. scvim_make_help.rb already merges the SCVim.scd help file so I'm not sure what use it would be to have that in Extensions because the SCVim class is pretty useless outside of scvim. in order to have up-to-date syntax highlighting [based on classes users might write and include in their class library, or extensions they add], scvim needs to have a location where it can write to. I figure a ~/.scvim directory would be a good place for that. This could also be the location where more up to date help docs would be written [those from add on libraries, etc], after the installation is over. also, I figure the installation process should put scvim_make_help.rb and sclangpipe_app.sh into PREFIX/bin, the contents of ftplugin, indent, syntax into PREFIX/share/vim/vimfiles/{ftplugin,indent,syntax} I'll have to update scvim a little in order to get it to work with these new locations and the possibility of a ~/.scvim folder.. but I figured I'd check first to see if there are any objections to anything I've said. I think with these changes, plus a default "system wide" scvimrc file [that could be overloaded with a ~/.scvimrc file for a particular user (or maybe it should be ~/.scvim/config or something)] we could finally have a one step scvim install solution. -Alex On 0, nescivi <nescivi@...> wrote: > On Thursday 01 May 2008 10:08:31 krgn wrote: > > hi, > > > > I just realised that the 'scvim-help' directory gets installed to > > PREFIX/share/SuperCollider instead of the PREFIX/share/SuperCollider/Help > > folder. its just cosmetic, but plays some role when packaging sc. call me a > > neat-freak :) > > This is done intentionally, since the scvim-help files are not html but text > based. If you have converted the complete helpfiles to text based documents, > you don't want to have both in the Help tree of supercollider to show up in > the Help.gui, as everything would show up twice. > > sincerely, > Marije > _______________________________________________ > Sc-devel mailing list > Sc-devel@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationHi Alex,
On Thursday 01 May 2008 19:46:49 Alex Norman wrote: > scvim has a script that it runs in order to remove html and rtf formatting > from help files so that they can be used as help files within vim itself. > As vim is simply a text editor it doesn't do any html or rtf formatting > [which is preferable if you ask me], so the html/rtf help files aren't very > useful inside vim. > > I figure the install script should run this unhtml/unrtf script so that > scvim users have the help docs when they first run scvim. I figure > PREFIX/share/SuperCollider/scvim-help is a file place for that.. yes. I tried to get this done in SCons but didn't get it to work yet, and since then did not get around to further investigate. > scvim_make_help.rb already merges the SCVim.scd help file so I'm not sure > what use it would be to have that in Extensions because the SCVim class is > pretty useless outside of scvim. But the help file would be found by the Help.gui, which some people might want to use for help browsing, even from within SC. So if the SCVim help file is put into the Extensions folder, this would be useful for that purpose. > in order to have up-to-date syntax highlighting [based on classes users > might write and include in their class library, or extensions they add], > scvim needs to have a location where it can write to. I figure a ~/.scvim > directory would be a good place for that. This could also be the location > where more up to date help docs would be written [those from add on > libraries, etc], after the installation is over. This makes sense. > also, I figure the installation process should put scvim_make_help.rb and > sclangpipe_app.sh into PREFIX/bin, the contents of ftplugin, indent, syntax > into PREFIX/share/vim/vimfiles/{ftplugin,indent,syntax} this as well. > I'll have to update scvim a little in order to get it to work with these > new locations and the possibility of a ~/.scvim folder.. but I figured I'd > check first to see if there are any objections to anything I've said. > > I think with these changes, plus a default "system wide" scvimrc file [that > could be overloaded with a ~/.scvimrc file for a particular user (or maybe > it should be ~/.scvim/config or something)] we could finally have a one > step scvim install solution. It all seems quite logical, so I'd say, go ahead with making the necessary changes. I'll try to assist where needed. sincerely, Marije > > -Alex > > On 0, nescivi <nescivi@...> wrote: > > On Thursday 01 May 2008 10:08:31 krgn wrote: > > > hi, > > > > > > I just realised that the 'scvim-help' directory gets installed to > > > PREFIX/share/SuperCollider instead of the > > > PREFIX/share/SuperCollider/Help folder. its just cosmetic, but plays > > > some role when packaging sc. call me a neat-freak :) > > > > This is done intentionally, since the scvim-help files are not html but > > text based. If you have converted the complete helpfiles to text based > > documents, you don't want to have both in the Help tree of supercollider > > to show up in the Help.gui, as everything would show up twice. > > > > sincerely, > > Marije > > _______________________________________________ > > Sc-devel mailing list > > Sc-devel@... > > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationAll sounding good to me. One small query:
> > also, I figure the installation process should put scvim_make_help.rb and > > sclangpipe_app.sh into PREFIX/bin, the contents of ftplugin, indent, syntax > > into PREFIX/share/vim/vimfiles/{ftplugin,indent,syntax} They're not binaries, they're scripts, so putting them in "bin" is a bit unusual, isn't it? Not sure Dan 2008/5/2 nescivi <nescivi@...>: > Hi Alex, > > > On Thursday 01 May 2008 19:46:49 Alex Norman wrote: > > scvim has a script that it runs in order to remove html and rtf formatting > > from help files so that they can be used as help files within vim itself. > > As vim is simply a text editor it doesn't do any html or rtf formatting > > [which is preferable if you ask me], so the html/rtf help files aren't very > > useful inside vim. > > > > I figure the install script should run this unhtml/unrtf script so that > > scvim users have the help docs when they first run scvim. I figure > > PREFIX/share/SuperCollider/scvim-help is a file place for that.. > > yes. > I tried to get this done in SCons but didn't get it to work yet, and since > then did not get around to further investigate. > > > > scvim_make_help.rb already merges the SCVim.scd help file so I'm not sure > > what use it would be to have that in Extensions because the SCVim class is > > pretty useless outside of scvim. > > But the help file would be found by the Help.gui, which some people might want > to use for help browsing, even from within SC. So if the SCVim help file is > put into the Extensions folder, this would be useful for that purpose. > > > > in order to have up-to-date syntax highlighting [based on classes users > > might write and include in their class library, or extensions they add], > > scvim needs to have a location where it can write to. I figure a ~/.scvim > > directory would be a good place for that. This could also be the location > > where more up to date help docs would be written [those from add on > > libraries, etc], after the installation is over. > > This makes sense. > > > > also, I figure the installation process should put scvim_make_help.rb and > > sclangpipe_app.sh into PREFIX/bin, the contents of ftplugin, indent, syntax > > into PREFIX/share/vim/vimfiles/{ftplugin,indent,syntax} > > this as well. > > > > I'll have to update scvim a little in order to get it to work with these > > new locations and the possibility of a ~/.scvim folder.. but I figured I'd > > check first to see if there are any objections to anything I've said. > > > > I think with these changes, plus a default "system wide" scvimrc file [that > > could be overloaded with a ~/.scvimrc file for a particular user (or maybe > > it should be ~/.scvim/config or something)] we could finally have a one > > step scvim install solution. > > It all seems quite logical, so I'd say, go ahead with making the necessary > changes. > I'll try to assist where needed. > > sincerely, > Marije > > > > > > > > -Alex > > > > On 0, nescivi <nescivi@...> wrote: > > > On Thursday 01 May 2008 10:08:31 krgn wrote: > > > > hi, > > > > > > > > I just realised that the 'scvim-help' directory gets installed to > > > > PREFIX/share/SuperCollider instead of the > > > > PREFIX/share/SuperCollider/Help folder. its just cosmetic, but plays > > > > some role when packaging sc. call me a neat-freak :) > > > > > > This is done intentionally, since the scvim-help files are not html but > > > text based. If you have converted the complete helpfiles to text based > > > documents, you don't want to have both in the Help tree of supercollider > > > to show up in the Help.gui, as everything would show up twice. > > > > > > sincerely, > > > Marije > > > _______________________________________________ > > > Sc-devel mailing list > > > Sc-devel@... > > > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel > > > _______________________________________________ > Sc-devel mailing list > Sc-devel@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel > -- http://www.mcld.co.uk _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationOn Fri, May 02, 2008 at 11:59:53AM +0100, Dan Stowell wrote:
> They're not binaries, they're scripts, so putting them in "bin" is a > bit unusual, isn't it? Not sure I think the bin directory usually indicates files that are executable and not strictly something compiled to a binary format. jy _______________________________________________ Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
|
|
Re: [linux] scvim help folder installationokay, I think I've made all the changes and have committed them to svn.. I've
included the commit message at the bottom of my message [I explain the changes in the log message]. I've included an "INSTALL" file that should be removed soon and replaced with the scons setup [I haven't done any work on the scons stuff]. There is 1 issue with the install. I was thinking before that we could install the vim files in /usr/local/share/vim/vimfiles but it turns out that that location isn't in vim's default runtime path (at least when vim is installed in /usr/bin/)... the runtimepath differs from system to system, but ~/.vim/ is the common place to put these files for a single user install. When package maintainers make a package of scvim they'll probably put the files in /usr/share/vim/vimfiles [or somewhere else that has been included in the vim runtimepath for that distro]. Basically, what this means is that for scvim we need a couple of targets: scvim/bin/* -> PREFIX/bin scvim/{scclasses/SCVim.sc,SCVim.scd} -> PREFIX/share/SuperCollider/Extensions/scvim/ scvim/scvimrc -> PREFIX/share/scvim/ scvim/{ftplugin,syntax,indent} -> VIMPREFIX or at least, with the way it is currently written, I think this is what is necessary. But now, I think there is a 1 'click' install solution. I've actually created an 'scvim' executable [scvim -g gives gvim], which looks for scvimrc files, loads the appropriate ftplugin file, and starts the interpreter. It is just slightly more complicated than the alias was before, but provides a route to the 1 'click' install. if someone wouldn't mind downloading the new svn of scvim and testing this install out, tell me if it actually works, I'd appreciate it! -Alex Revision: 7545 http://svn.sourceforge.net/supercollider/?rev=7545&view=rev Author: alexnorman Date: 2008-05-06 16:24:22 -0700 (Tue, 06 May 2008) Log Message: ----------- changed a lot of things.. $SCVIM_DIR is no longer needed (or used) the cache dir defaults to ~/.scvim the syntax and ftplugin directory contents must be put in a folder which is in the vimruntimepath (for example ~/.vim or /usr/share/vim/vimfiles/ .. unfortunately /usr/local/share/vim/.. is not one of them) there is an executable now called 'scvim' (which can take a -g switch to launch gvim instead of vim) this executable searches for scvimrc files in the following locations (in this order) ~/.scvimrc /usr/local/share/scvim/scvimrc /usr/share/scvim/scvimrc I've created a temporary INSTALL script which should be replaced by the scons stuff [but will give the scons editors something to work from] I'm pretty sure that now after downloading scvim, running INSTALL as sudo, you should be able to run "scvim" and have it "just work". Modified Paths: -------------- trunk/editors/scvim/NEWS trunk/editors/scvim/README trunk/editors/scvim/bin/scvim_make_help.rb trunk/editors/scvim/ftplugin/supercollider.vim trunk/editors/scvim/scclasses/SCVim.sc trunk/editors/scvim/scvimrc trunk/editors/scvim/syntax/supercollider.vim Added Paths: ----------- trunk/editors/scvim/INSTALL trunk/editors/scvim/SCVim.scd trunk/editors/scvim/bin/scvim Removed Paths: ------------- trunk/editors/scvim/bash_scvim_aliases trunk/editors/scvim/cache/doc/ Added: trunk/editors/scvim/INSTALL =================================================================== --- trunk/editors/scvim/INSTALL (rev 0) +++ trunk/editors/scvim/INSTALL 2008-05-06 23:24:22 UTC (rev 7545) @@ -0,0 +1,32 @@ +#!/bin/sh +VIM_FILES_DEST=$HOME/.vim +BIN_DEST=/usr/local/bin/ +SCCLASS_DEST=/usr/local/share/SuperCollider/Extensions/scvim +CACHE_DIR=$HOME/.scvim + +cp -r indent ftplugin syntax $VIM_FILES_DEST +cp bin/* $BIN_DEST +cp -r scclasses/ $SCCLASS_DEST + +#create the cache dir if it doesn't exist. +if [ ! -d $CACHE_DIR ] +then + mkdir $CACHE_DIR + if [ $SUDO_USER ] + then + chown $SUDO_USER $CACHE_DIR + fi +fi + +#create the doc dir if it doesn't exist +if [ ! -d $CACHE_DIR/doc ] +then + mkdir $CACHE_DIR/doc + if [ $SUDO_USER ] + then + chown $SUDO_USER $CACHE_DIR/doc + fi +fi + +#copy the help file +cp SCVim.scd $CACHE_DIR/doc/ Property changes on: trunk/editors/scvim/INSTALL ___________________________________________________________________ Name: svn:executable + * Modified: trunk/editors/scvim/NEWS =================================================================== --- trunk/editors/scvim/NEWS 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/NEWS 2008-05-06 23:24:22 UTC (rev 7545) @@ -1,3 +1,9 @@ +2008-05-06 + I have changed a lot of things in order to make installation *hopefully* + easier. There is now an scvim executable that looks for scvimrc to load in this order: + ~/.scvimrc, /usr/local/share/scvim/scvimrc, /usr/share/scvim/scvimrc + the cache dir defaults to ~/.scvim/ + there is no need for the SCVIM_DIR environment variable anymore 2008-04-08 Dan Stowell moved the SCVim supercollider code into a class, now SCVim docs and cache data can be updated inside SuperCollider. Dan has also moved Modified: trunk/editors/scvim/README =================================================================== --- trunk/editors/scvim/README 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/README 2008-05-06 23:24:22 UTC (rev 7545) @@ -20,33 +20,48 @@ INSTALLATION STEPS: -1) Put this ("scvim") directory into your SuperCollider Extensions directory. +1) copy the contents of bin/ somewhere in your path.. for example + sudo cp bin/* /usr/local/bin/ + +2) copy the folders ftplugin/ syntax/ indent/ somewhere in your vim runtimepath + *the runtimepath differs depending on your distribution. + type :help runtimepath in vim for more info + + to install for just one user the easiest place to put it is in ~/.vim + ie (after creating the directory ~/.vim if it doesn't exist) + cp -r ftplugin/ syntax/ indent/ ~/.vim + +3) copy the scvimrc file to one of these locations: + ~/.scvimrc + /usr/local/share/scvim/scvimrc + /usr/share/scvim/scvimrc + (you can then customize this file as you wish) + +4) Put the ("scclasses") directory into your SuperCollider Extensions directory. (on linux, typically /usr/local/share/SuperCollider/Extensions) + ie do this: + cp -r scclasses /usr/local/share/SuperCollider/Extensions/scvim + Make sure that this folder is sourced in your .sclang.cfg file. + +/usr/local/share/SuperCollider/Extensions/scvim * You can put the scvim directory somewhere else if you please, just make sure that you have the SCVim supercollider class sourced in your .sclang.cfg ie: - +$SCVIM_DIR/scclasses + +/usr/local/share/scvim/scclasses -2) Create an environment variable SCVIM_DIR that points to where you put this - directory, i.e. add this line into your .bashrc file: - export SCVIM_DIR=/usr/local/share/SuperCollider/Extensions/scvim - -3) Optional, but handy: Add "scvim" and "scgvim" aliases to your shell - environment by adding this line to the appropriate file (e.g. add it to - ~/.bash_profile or ~/.bash_aliases): - source $SCVIM_DIR/bash_scvim_aliases - -4) Add the following line to your ~/.vimrc file (which might not exist yet): - source $SCVIM_DIR/scvimrc - You can edit scvimrc to change keybindings etc. - -Now you should be ready to use scvim, e.g. by running "scvim" or "scgvim" from +Now you should be ready to use scvim, e.g. by running "scvim" or "scvim -g" from a command prompt. ________________________________________________________________________________ OPTIONAL EXTRA INSTALLATION STEPS: +* If you want to be able to read supercollider files, with syntax highlighting, the + ability to start the language and the keybindings you've set up without having to + launch sclang at the start of your vim session then source your scvimrc file in your + ~/.vimrc + for example, if you have a ~/.scvimrc file you could put this line in your ~/.vimrc + so ~/.scvimrc + * I put this in my ~/.sclang.sc so that each time I start sclang I have updated Object completion and highlighting, as well as Object Definition Lookup: //set up the scvim stuff Copied: trunk/editors/scvim/SCVim.scd (from rev 7537, trunk/editors/scvim/cache/doc/SCVim.scd) =================================================================== --- trunk/editors/scvim/SCVim.scd (rev 0) +++ trunk/editors/scvim/SCVim.scd 2008-05-06 23:24:22 UTC (rev 7545) @@ -0,0 +1,76 @@ +SCVim SuperCollider in the VIM editor. + +created by Alex Norman, SuperCollider class created by Dan Stowell +the webpage is here: http://www.x37v.info/scvim/ +if you have improvements/suggestions email alex at x37v dot info + +View the scvim README for installation instructions. +________________________________________________________________________________ + +Quick intro: + +In order for syntax highlighting and class definition lookup to work you must +run: + +SCVim.updateCaches; + +it is best to put this in your ~/.sclang.sc file. But for now you can just +put the cursor over that line and hit F6 to send it to the language. +After you've done that you can update the syntax highlighting info by executing +the following (in vim): +runtime syntax/supercollider.vim + +________________________________________________________________________________ + +USAGE (inside vim): + +defaults (most work in both command and insert mode): + +:SClangStart starts/restarts the interpreter in an xterm + (if you want to recompile the supercollider library just type :SClangStart + and you'll kill the current interpreter, start up a new one and have a + recompiled library) +:SClangKill kills the xterm/interpreter +(exiting vim also kills the interpreter) + +F5 sends a whole block (looks for the outermost parens and sends that data) +F6 sends a single line (the line the cursor is currently on) +F7 calls TempoClock.default.clear; +F8 calls s.freeAll; +F12 calls thisProcess.stop; (i.e. the same as cmd-. on Mac) + +in visual mode F5 and F6 both send the whole visual block + +use :SChelp to get to SC help topics, or use K on a word (in command mode) + (this has tab completion) +use :SCdef to see the class definitions for an object, or use ^k (in command or normal mode) + on a word (this also has tab completion) + +These key bindings can all be changed through editing your scvimrc file. + +________________________________________________________________________________ + +HELP DOCS: + +scvim uses preprocessed versions of the help files (converted to plain-text), +and to update these help files from the main files you can run the following +line in sclang (put the cursor on line and hit F6): + + SCVim.updateHelpCache + +This actually calls a Ruby script called scvim_make_help.rb, so can be used +outside SC if desired. You can do something like: + + ./scvim_make_help.rb -c -s /usr/local/share/SuperCollider/Help + +This will delete any help docs that are in your ~/.scvim/docs dir, and copy in the +more up to date [hopefully] docs from /usr/local/share/SuperCollider/Help to +that dir [after they are formatted]. If you have help docs in more than one +location you can now copy in more help docs by doing + + ./scvim_make_help -s <other location> + +or you can do it all in one go by specifying multiple sources + + ./scvim_make_help -c -s /usr/local/share/SuperCollider/Help -s <other location> + Deleted: trunk/editors/scvim/bash_scvim_aliases =================================================================== --- trunk/editors/scvim/bash_scvim_aliases 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/bash_scvim_aliases 2008-05-06 23:24:22 UTC (rev 7545) @@ -1,2 +0,0 @@ -alias scvim='vim -c "set filetype=supercollider" -c "source $SCVIM_DIR/ftplugin/supercollider.vim | SClangStart"' -alias gscvim='gvim -c "set filetype=supercollider" -c "source $SCVIM_DIR/ftplugin/supercollider.vim | SClangStart"' Added: trunk/editors/scvim/bin/scvim =================================================================== --- trunk/editors/scvim/bin/scvim (rev 0) +++ trunk/editors/scvim/bin/scvim 2008-05-06 23:24:22 UTC (rev 7545) @@ -0,0 +1,33 @@ +#!/bin/sh + +#which vim to use +vim="vim" +localrcfile=/usr/local/share/scvim/scvimrc +rcfile=/usr/share/scvim/scvimrc + +#parse ops +while getopts "gh" opt; do + case $opt in + g ) vim=gvim;; + h ) echo "supercollider in vim" + echo "usage:\nscvim [-h] [-g]" + echo "\t -h prints this help" + echo "\t -g use gvim (graphical vim)" + exit 0;; + esac +done + +#load an rc file if it exists. +#first we look for ~/.scvimrc, then /usr/local/share/scvim/scvimrc then /usr/share/scvim/scvimrc +if [ -r $HOME/.scvimrc ] +then + exec $vim --cmd "source $HOME/.scvimrc" -c "set filetype=supercollider | runtime ftplugin/supercollider.vim | SClangStart" +elif [ -r $localrcfile ] +then + exec $vim --cmd "source $localrcfile" -c "set filetype=supercollider | runtime ftplugin/supercollider.vim | SClangStart" +elif [ -r $rcfile ] +then + exec $vim --cmd "source $rcfile" -c "set filetype=supercollider | runtime ftplugin/supercollider.vim | SClangStart" +else + exec $vim -c "set filetype=supercollider | runtime ftplugin/supercollider.vim | SClangStart" +fi Property changes on: trunk/editors/scvim/bin/scvim ___________________________________________________________________ Name: svn:executable + * Modified: trunk/editors/scvim/bin/scvim_make_help.rb =================================================================== --- trunk/editors/scvim/bin/scvim_make_help.rb 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/bin/scvim_make_help.rb 2008-05-06 23:24:22 UTC (rev 7545) @@ -33,13 +33,18 @@ #along with SCVIM. If not, see <http://www.gnu.org/licenses/>. $uselinks = false -scvim_dir = ENV["SCVIM_DIR"].sub(/\/$/,"") scvim_cache_dir = ENV["SCVIM_CACHE_DIR"] if !scvim_cache_dir or scvim_cache_dir=="" - scvim_cache_dir = scvim_dir + "/cache" + scvim_cache_dir = File.join(ENV["HOME"],".scvim") else scvim_cache_dir.sub!(/\/$/,"") end + +#if the cache dir doesn't exist, create it +if not File.exists?(scvim_cache_dir) + Dir.mkdir(scvim_cache_dir) +end + help_dest = File.join(scvim_cache_dir, "/doc/") help_tags_file = File.join(help_dest, "TAGS_HELP") help_completion_file = File.join(help_dest, "sc_help_completion") Modified: trunk/editors/scvim/ftplugin/supercollider.vim =================================================================== --- trunk/editors/scvim/ftplugin/supercollider.vim 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/ftplugin/supercollider.vim 2008-05-06 23:24:22 UTC (rev 7545) @@ -18,26 +18,38 @@ "au VimLeave -if exists("$SCVIM_DIR") == 0 - echo "$SCVIM_DIR must be defined for SCVIM to work" - finish -endif -if exists("$SCVIM_CACHE_DIR") == 0 - let s:scvim_cache_dir = $SCVIM_DIR . "/cache" - let $SCVIM_CACHE_DIR = s:scvim_cache_dir -else - let s:scvim_cache_dir = $SCVIM_CACHE_DIR -endif +"if exists("$SCVIM_DIR") == 0 +" echo "$SCVIM_DIR must be defined for SCVIM to work" +" finish +"endif + "source the syntax file as it can change -so $SCVIM_DIR/syntax/supercollider.vim +"so $SCVIM_DIR/syntax/supercollider.vim +runtime! syntax/supercollider.vim if exists("loaded_scvim") || &cp finish endif let loaded_scvim = 1 +"first if SCVIM_CACHE_DIR is defined, use that, +"otherwise use ~/.scvim +if exists("$SCVIM_CACHE_DIR") + let s:scvim_cache_dir = $SCVIM_CACHE_DIR +else + let s:scvim_cache_dir = $HOME . "/.scvim" + let $SCVIM_CACHE_DIR = s:scvim_cache_dir +endif +"source the scvimrc file if it exists +"if filereadable($HOME . "/.scvimrc") +" source $HOME/.scvimrc +"end + +"add the cache dir to +set runtimepath+=$SCVIM_CACHE_DIR + if exists("g:sclangKillOnExit") let s:sclangKillOnExit = g:sclangKillOnExit else @@ -67,7 +79,7 @@ if exists("g:sclangPipeApp") let s:sclangPipeApp = g:sclangPipeApp else - let s:sclangPipeApp = "$SCVIM_DIR/bin/sclangpipe_app.sh" + let s:sclangPipeApp = "sclangpipe_app.sh" endif "function SClangRunning() @@ -258,18 +270,21 @@ function SCdef(subject) let l:tagfile = s:scvim_cache_dir . "/TAGS_SCDEF" + let l:tagdest = s:scvim_cache_dir . "/doc/tags" + if !filereadable(l:tagfile) echo "definition tag cache does not exist, you must run SCVim.updateCaches in supercollider" - let l:dontcare = system("echo 'SC:SCVim SCVim.scd /^' > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("echo 'SC:SCVim SCVim.scd /^' > " . l:tagdest) exe "help SC:SCVim" else - let l:dontcare = system("grep SCDEF:" . a:subject . " $SCVIM_CACHE_DIR/TAGS_SCDEF > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("grep SCdef:" . a:subject . " " . l:tagfile . " > " . l:tagdest) exe "help SCdef:" . a:subject end endfun function SChelp(subject) let l:tagfile = s:scvim_cache_dir . "/doc/TAGS_HELP" + let l:tagdest = s:scvim_cache_dir . "/doc/tags" if !filereadable(l:tagfile) echo "help tag cache does not exist, you must run SCVim.updateHelpCache in supercollider in order have help docs" let l:dontcare = system("echo 'SC:SCVim SCVim.scd /^' > $SCVIM_CACHE_DIR/doc/tags") @@ -279,16 +294,16 @@ "the keybindings won't find * but will find ** for some reason if a:subject == "" - let l:dontcare = system("grep \"SC:Help\" $SCVIM_CACHE_DIR/doc/TAGS_HELP > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("grep \"SC:Help\" " . l:tagfile . " > " . l:tagdest) exe "help SC:Help" elseif a:subject == "*" - let l:dontcare = system("grep \"SC:\\*\" $SCVIM_CACHE_DIR/doc/TAGS_HELP > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("grep \"SC:\\*\" " . l:tagfile . " > " . l:tagdest) exe "help SC:\*" . a:subject elseif a:subject == "**" - let l:dontcare = system("grep \"SC:\\*\\*\" $SCVIM_CACHE_DIR/doc/TAGS_HELP > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("grep \"SC:\\*\\*\" " . l:tagfile . " > " . l:tagdest) exe "help SC:\*\*" . a:subject else - let l:dontcare = system("grep SC:\"" . a:subject . "\" $SCVIM_CACHE_DIR/doc/TAGS_HELP > $SCVIM_CACHE_DIR/doc/tags") + let l:dontcare = system("grep SC:\"" . a:subject . "\" " . l:tagfile . " > " . l:tagdest) exe "help SC:" . a:subject endif endfun Modified: trunk/editors/scvim/scclasses/SCVim.sc =================================================================== --- trunk/editors/scvim/scclasses/SCVim.sc 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/scclasses/SCVim.sc 2008-05-06 23:24:22 UTC (rev 7545) @@ -21,17 +21,9 @@ classvar <scvim_dir, <scvim_cache_dir; *initClass { - var scvim_dir_env = getenv("SCVIM_DIR"); var scvim_cache_dir_env = getenv("SCVIM_CACHE_DIR"); - if(scvim_dir_env.isNil){ - scvim_dir = this.filenameSymbol.asString.dirname.dirname; - setenv("SCVIM_DIR", scvim_dir); - "Shell evironment variable SCVIM_DIR was not set".warn; - }{ - scvim_dir = scvim_dir_env; - }; if(scvim_cache_dir_env.isNil){ - scvim_cache_dir = scvim_dir +/+ "cache"; + scvim_cache_dir = "~/.scvim".standardizePath; setenv("SCVIM_CACHE_DIR", scvim_cache_dir); //inform("SCVim: I've set the cache dir based on the scvim dir"); }{ @@ -46,50 +38,66 @@ var object_list, object_dict; var ob_vim_file, ob_comp_file, tags_file; - //open the files - //for supercollider_objects.vim - ob_vim_file = File(scvim_cache_dir +/+ "supercollider_objects.vim","w"); - //for TAGS_SCDEF (object definitions) - tags_file = File(scvim_cache_dir +/+ "TAGS_SCDEF","w"); - //for object completion && object lookup in the SChelp function - ob_comp_file = File(scvim_cache_dir +/+ "sc_object_completion","w"); + r{ + //if scvim_cache_dir doesn't exist, make it + if(File.exists(scvim_cache_dir) == false){ + ("mkdir " ++ scvim_cache_dir).unixCmd; + //wait until the file exists + //while(File.exists(scvim_cache_dir) == false, 1.wait; ); + 1.wait; + }; - ob_vim_file.write("syn keyword\tscObject\t"); - object_list = SortedList.new(0); - object_dict = Dictionary.new; - //add Object itself - object_list = object_list.add(Object.asString); - object_dict.add(Object.asString -> Object); - //sort the Objects (add to a sorted list) - Object.allSubclasses.do( - {|i| - object_list = object_list.add(i.asString); - object_dict.add(i.asString -> i); - }); - //go through the Objects in order and write what needs to be written to the files - object_list.do {|ob_string| - ob_vim_file.write(ob_string ++ " "); - /* disregard any Meta_ Classes */ - if(ob_string.find("Meta_",false,0).isNil, - {ob_comp_file.write(ob_string ++ "\n")}); - tags_file.write("SCDEF:" ++ - ob_string ++ - "\t" ++ object_dict.at(ob_string).filenameSymbol ++ - "\tgo " ++ - (object_dict.at(ob_string).charPos + 1) ++ "\n"); + if(File.exists(scvim_cache_dir ++ "/doc") == false){ + ("mkdir " ++ scvim_cache_dir ++ "/doc").unixCmd; + //wait until the file exists + //while(File.exists(scvim_cache_dir) == false, 1.wait; ); + 1.wait; }; - //add some extra new lines - ob_vim_file.write("\n\n"); - [ob_vim_file, tags_file, ob_comp_file].do(_.close); - "SCVim files written".postln; + + //open the files + //for supercollider_objects.vim + ob_vim_file = File(scvim_cache_dir +/+ "supercollider_objects.vim","w"); + //for TAGS_SCDEF (object definitions) + tags_file = File(scvim_cache_dir +/+ "TAGS_SCDEF","w"); + //for object completion && object lookup in the SChelp function + ob_comp_file = File(scvim_cache_dir +/+ "sc_object_completion","w"); + + ob_vim_file.write("syn keyword\tscObject\t"); + object_list = SortedList.new(0); + object_dict = Dictionary.new; + //add Object itself + object_list = object_list.add(Object.asString); + object_dict.add(Object.asString -> Object); + //sort the Objects (add to a sorted list) + Object.allSubclasses.do( + {|i| + object_list = object_list.add(i.asString); + object_dict.add(i.asString -> i); + }); + //go through the Objects in order and write what needs to be written to the files + object_list.do {|ob_string| + ob_vim_file.write(ob_string ++ " "); + /* disregard any Meta_ Classes */ + if(ob_string.find("Meta_",false,0).isNil, + {ob_comp_file.write(ob_string ++ "\n")}); + tags_file.write("SCdef:" ++ + ob_string ++ + "\t" ++ object_dict.at(ob_string).filenameSymbol ++ + "\tgo " ++ + (object_dict.at(ob_string).charPos + 1) ++ "\n"); + }; + //add some extra new lines + ob_vim_file.write("\n\n"); + [ob_vim_file, tags_file, ob_comp_file].do(_.close); + "SCVim files written".postln; + }.play; } // end *updateCaches *updateHelpCache { | helpPaths | var script; if(helpPaths.isNil){ helpPaths = [Platform.helpDir]}; // Just run the ruby script - script = scvim_dir +/+ "bin/scvim_make_help.rb"; - (script.quote + "-c -f" + helpPaths.collect{|p| "-s" + p.quote}).systemCmd; + ("scvim_make_help.rb".quote + "-c -f" + helpPaths.collect{|p| "-s" + p.quote}).systemCmd; } } // end class Modified: trunk/editors/scvim/scvimrc =================================================================== --- trunk/editors/scvim/scvimrc 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/scvimrc 2008-05-06 23:24:22 UTC (rev 7545) @@ -1,6 +1,7 @@ "for scvim (supercollider vim) "this indicates the -d varaible [rundir] for running sclang in +"default /tmp "let $SCLANG_RUNDIR = "/home/user/scwork" "set this to 0 if you don't want to kill the terminal with sclangpipe running @@ -12,37 +13,29 @@ let g:sclangTerm = "xterm -e" "this indicates the location to create a pipe for vim to communicate with -"sclang -let g:sclangPipeLoc = "/tmp/sclang-pipe" +"sclang +"defaults /tmp/sclang-pipe +"let g:sclangPipeLoc = "/tmp/sclang-pipe" "this indicates a file where the process id for sclangpipe_app is stored -let g:sclangPipeAppPidLoc = "/tmp/sclangpipe_app-pid" +"default /tmp/sclangpipe_app-pid +"let g:sclangPipeAppPidLoc = "/tmp/sclangpipe_app-pid" -"this indicates the actual location of sclangpipe_app.sh -let g:sclangPipeApp = "$SCVIM_DIR/bin/sclangpipe_app.sh" - -set runtimepath+=$SCVIM_DIR -if exists("$SCVIM_CACHE_DIR") == 0 - set runtimepath+=$SCVIM_CACHE_DIR -else - set runtimepath+=$SCVIM_DIR/cache -endif - au BufWinEnter,BufNewFile,BufRead *.sc set filetype=supercollider -au BufWinEnter,BufNewFile,BufRead *.sc let &iskeyword="@,48-57,_,192-255" | source $SCVIM_DIR/ftplugin/supercollider.vim +au BufWinEnter,BufNewFile,BufRead *.sc let &iskeyword="@,48-57,_,192-255" | runtime ftplugin/supercollider.vim au BufWinEnter,BufNewFile,BufRead *.sc set sw=4 ts=4 autoindent "this line can be changed however you like -"source $SCVIM_DIR/indent/sc_indent.vim "sc help files au BufWinEnter,BufNewFile,BufRead *.scd set filetype=supercollider -au BufWinEnter,BufNewFile,BufRead *.scd let &iskeyword="@,48-57,_,192-255,-,|" | source $SCVIM_DIR/ftplugin/supercollider.vim +au BufWinEnter,BufNewFile,BufRead *.scd let &iskeyword="@,48-57,_,192-255,-,|" | runtime ftplugin/supercollider.vim au BufWinEnter,BufNewFile,BufRead *.scd set sw=4 ts=4 autoindent "this line can be changed however you like "required for matching au Filetype supercollider,supercollider_help let b:match_skip = 's:scComment\|scString\|scSymbol' au Filetype supercollider,supercollider_help let b:match_words = '(:),[:],{:}' -au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc source $SCVIM_DIR/indent/sc_indent.vim +"indenting if you want it +"au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc runtime indent/sc_indent.vim "supercollider vim keybindings Modified: trunk/editors/scvim/syntax/supercollider.vim =================================================================== --- trunk/editors/scvim/syntax/supercollider.vim 2008-05-06 15:14:55 UTC (rev 7544) +++ trunk/editors/scvim/syntax/supercollider.vim 2008-05-06 23:24:22 UTC (rev 7545) @@ -70,10 +70,12 @@ " load list of all objects if filereadable($SCVIM_CACHE_DIR . "/supercollider_objects.vim") source $SCVIM_CACHE_DIR/supercollider_objects.vim +elseif filereadable($HOME . ".scvim/supercollider_objects.vim") + source $HOME/supercollider_objects.vim end " load all the language stuff -source $SCVIM_DIR/syntax/supercollider_lang.vim -source $SCVIM_DIR/syntax/supercollider_operators.vim +runtime! syntax/supercollider_lang.vim +runtime! syntax/supercollider_operators.vim " comments syn match scComment "//.*$" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ sc-dev mailing list sc-dev@... http://lists.create.ucsb.edu/mailman/listinfo/sc-dev On 0, nescivi <nescivi@...> wrote: > Hi Alex, > > On Thursday 01 May 2008 19:46:49 Alex Norman wrote: > > scvim has a script that it runs in order to remove html and rtf formatting > > from help files so that they can be used as help files within vim itself. > > As vim is simply a text editor it doesn't do any html or rtf formatting > > [which is preferable if you ask me], so the html/rtf help files aren't very > > useful inside vim. > > > > I figure the install script should run this unhtml/unrtf script so that > > scvim users have the help docs when they first run scvim. I figure > > PREFIX/share/SuperCollider/scvim-help is a file place for that.. > > yes. > I tried to get this done in SCons but didn't get it to work yet, and since > then did not get around to further investigate. > > > scvim_make_help.rb already merges the SCVim.scd help file so I'm not sure > > what use it would be to have that in Extensions because the SCVim class is > > pretty useless outside of scvim. > > But the help file would be found by the Help.gui, which some people might want > to use for help browsing, even from within SC. So if the SCVim help file is > put into the Extensions folder, this would be useful for that purpose. > > > in order to have up-to-date syntax highlighting [based on classes users > > might write and include in their class library, or extensions they add], > > scvim needs to have a location where it can write to. I figure a ~/.scvim > > directory would be a good place for that. This could also be the location > > where more up to date help docs would be written [those from add on > > libraries, etc], after the installation is over. > > This makes sense. > > > also, I figure the installation process should put scvim_make_help.rb and > > sclangpipe_app.sh into PREFIX/bin, the contents of ftplugin, indent, syntax > > into PREFIX/share/vim/vimfiles/{ftplugin,indent,syntax} > > this as well. > > > I'll have to update scvim a little in order to get it to work with these > > new locations and the possibility of a ~/.scvim folder.. but I figured I'd > > check first to see if there are any objections to anything I've said. > > > > I think with these changes, plus a default "system wide" scvimrc file [that > > could be overloaded with a ~/.scvimrc file for a particular user (or maybe > > it should be ~/.scvim/config or something)] we could finally have a one > > step scvim install solution. > > It all seems quite logical, so I'd say, go ahead with making the necessary > changes. > I'll try to assist where needed. > > sincerely, > Marije > > > > > > -Alex > > > > On 0, nescivi <nescivi@...> wrote: > > > On Thursday 01 May 2008 10:08:31 krgn wrote: > > > > hi, > > > > > > > > I just realised that the 'scvim-help' directory gets installed to > > > > PREFIX/share/SuperCollider instead of the > > > > PREFIX/share/SuperCollider/Help folder. its just cosmetic, but plays > > > > some role when packaging sc. call me a neat-freak :) > > > > > > This is done intentionally, since the scvim-help files are not html but > > > text based. If you have converted the complete helpfiles to text based > > > documents, you don't want to have both in the Help tree of supercollider > > > to show up in the Help.gui, as everything would show up twice. > > > > > > sincerely, > > > Marije > > > _______________________________________________ > > > Sc-devel mailing list > > > Sc-devel@... > > > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel > > > _______________________________________________ > Sc-devel mailing list > Sc-devel@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-devel Sc-devel mailing list Sc-devel@... http://lists.create.ucsb.edu/mailman/listinfo/sc-devel |
| Free Forum Powered by Nabble | Forum Help |