On 11/06/10 17:40, Gary Johnson wrote:
On 2010-06-11, Gusman wrote:

On Thu, Jun 10, 2010 at 4:42 PM,<[email protected]>  wrote:

     On Wed, 09 Jun 2010 03:53:56 +0100, Gusman<[email protected]>  wrote:


         I think you can try Ifdef script on
         http://www.vim.org/scripts/script.php?script_id=7
         Hope it's helpful.


     Thanks Gusman - that looks just what I need.

     I'll have to be honest and say I have no idea how to use this script(!) I
     don't understand enough to follow the installation instructions. Could a
     kind person help me out? The instructions say (slightly edited to apply to
     C):

     - Use as a syntax plugin (source ifdef.vim from ~/vimfiles/after/syntax/
     c.vim)

     Already I'm stumped. I haven't got a vimfiles/after/ directory, but have
     got $VIM/vim72/syntax/c.vim. Would I edit this one, or copy it to vimfiles/
     after/syntax/ and work on it from there?

     [later] ... I was going to type up some more of what I'd found, but this is
     just too advanced for me to understand in the time I've got available. If
     someone uses this plugin and could easily post a couple of steps on how to
     use it I'd be really grateful, otherwise I'll have to drop it.

1. I put ifdef.vim in $VIMRUNTIME/syntax

2. Edit $VIMRUNTIME/syntax/c.vim, I add folowing line at the end of c.vim
     "source $VIMRUNTIME/syntax/ifdef.vim"

Adding and editing files under $VIMRUNTIME is not a good idea.  If
you keep your runtime files up to date, your changes may be
overwritten by a newer version of a file you changed.  As soon as
you update your Vim installation to a newer version (e.g., 7.2 to
7.3), Vim will use the newer $VIMRUNTIME and will not see your
changes.

If you need to change the behavior of any runtime files, put those
changes in your ~/.vim directory on Unix, or your \Program
Files\Vim\vimfiles or %HOME%\vimfiles directory on Windows.

In this particular case, ifdef.vim should be put in your
~/.vim/syntax directory.  Then create a new file,
~/.vim/after/syntax/c.vim and put into that file this line:

     runtime syntax/ifdef.vim

...and if any of these directories don't exist, create them (on Unix: mkdir -pv ~/.vim/syntax ~/.vim/after/syntax). The -v option is optional, if used mkdir will tell you which (not yet existing) directories it created.

Also: on Windows, use ~/vimfiles (in Vim terminology) or %HOME%\vimfiles (in Windows terminology, when calling mkdir from inside Vim) instead of ~/.vim

All these directories need only exist if you have something to put in them.

See :help 'runtimepath'


Your changes will be easy to find, easy to separate from the
official runtime files, and won't be lost when you update Vim.


Also, please don't top post.  The convention on this list is to trim
the post to which you're replying to the relevant points and to add
your reply to the bottom, as it says in the footers of all messages
from this list.

Regards,
Gary


Best regards,
Tony.
--
"Nondeterminism means never having to say you are wrong."

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to