I have an update for the sshconfig.vim syntax file, which has been suggested by Tom Ryder.
The output of hg diff is as follows:
diff -r 25b3106f17bd runtime/syntax/sshconfig.vim --- a/runtime/syntax/sshconfig.vim Sun Feb 19 18:19:30 2012 +0100 +++ b/runtime/syntax/sshconfig.vim Sun Feb 19 22:20:27 2012 +0000 @@ -4,7 +4,7 @@ " Maintainer: Leonard Ehrenfried <leonard.ehrenfr...@web.de> " Modified By: Thilo Six " Originally: 2009-07-09 -" Last Change: 2011 Oct 31 +" Last Change: 2012 Feb 19 " SSH Version: 5.9p1 "
@@ -92,7 +92,8 @@ syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>" - +syn match sshconfigHostPort "\(Host \)\@<=.\+" +syn match sshconfigHostPort "\(HostName \)\@<=.\+"
" case off syn case ignore
I have attached an updated version of the file.
Thanks, Leonard
On 18 February 2012 15:50, Tom Ryder <t...@sanctum.geek.nz> wrote:
> I have a suggestion for the sshconfig Vim syntax file you maintain.
> Because everything that follows a Host pragma must by definition be > intended as a host, and not necessarily one that actually resolves via DNS > (e.g. it could be an abbreviation for an actual host specified in the > section by a HostName command), both this and the HostName option I think > should always fall into the sshconfigHostPort group.
> Here's a suggested patch if you agree. It uses zero-width lookbehind > assertions.
> --- sshconfig.vim 2012-02-19 03:47:47.000000000 +1300 > +++ sshconfig.fix.vim 2012-02-19 03:47:38.000000000 +1300 > @@ -92,6 +92,8 @@ > syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" > syn match sshconfigHostPort > "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" > syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>" > +syn match sshconfigHostPort "\(Host \)\@<=.\+" > +syn match sshconfigHostPort "\(HostName \)\@<=.\+"
> " case off
> And an example of a config file stanza for which this fixes the > highlighting for the word "webserver":
> I would be interested in helping out for known problems in other > syntax files; I've been wanting to contribute to Vim for quite a > while.
That would be appreciated. There are quite a number runtimefiles which use linecontinuation but are known not to take care of cpoptions, see ':h cpo-C'.
When providing patches, one might also check the value of 'ts' in modelines. For official runtimefiles a 'ts=8' is preferred. Probably a reindent is necessary then.
Also i think there a quite a common mistake which i made myself, too. Inside square brackets '[]' characters like '[.~' do not need to be escaped. But then one can find often '[\[\~\.]' and so on. These just mean '\' is added to list which might or might not be what is intended.
I'm currently a bit short of time myself. -- Regards, Thilo
> -- > You received this message from the "vim_dev" 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