Saturday, September 10, 2011

Re: reload syntax file without restarting vim

Am 09.09.2011 22:26, schrieb cyboman:
> sometimes i need to make modifications to the syntax file but in order
> for changes to take effect i need to restart vim. is it possible for
> changes to take effect without a restart? does anybody know how to do
> it?
>
> any help is appreciated

Should be quite simple:
Either reload the file

:e

or explicitly set the syntax (given your filetype is named "gobo")

:set syn=gobo

Doesn't that work? Or do it even "more manually":

:syn clear
:source {somepath}/syntax/gobo.vim

The latter requires that all syntax definitions are in one file.

If you're editing {somepath}/after/syntax/gobo.vim then at least two
files need to be sourced (the original and the "after" syntax file):

:syn clear
:runtime! syntax/gobo.vim

Hint: The :runtime command doesn't complain if it can't find any files.
Try :verb runtime! syntax/gobo.vim to get a message in that case.

In the help:

:h 'syn
:h :syn-clear
:h after
...

--
Andy

--
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

No comments: