[Pacemaker] Syntax highlighting in vim for crm configure edit

Trevor Hemsley themsley at voiceflex.com
Mon Nov 21 20:27:02 UTC 2011


Patrick H. wrote:
> Sent: Tue Nov 15 2011 02:47:59 GMT-0700 (MST)
> From: Raoul Bhatia [IPAX] <r.bhatia at ipax.at>
> To: The Pacemaker cluster resource manager 
> <pacemaker at oss.clusterlabs.org>
> Subject: Re: [Pacemaker] Syntax highlighting in vim for crm configure 
> edit
>> hi!
>>
>> On 2011-08-19 16:28, Dan Frincu wrote:
>>> Hi,
>>>
>>> On Thu, Aug 18, 2011 at 5:53 PM, Digimer<linux at alteeve.com>  wrote:
>>>> On 08/18/2011 10:39 AM, Trevor Hemsley wrote:
>>>>> Hi all
>>>>>
>>>>> I have attached a first stab at a vim syntax highlighting file for 
>>>>> 'crm
>>>>> configure edit'
>>>>>
>>>>> To activate this, I have added 'filetype plugin on' to my 
>>>>> /root/.vimrc
>>>>> then created /root/.vim/{ftdetect,ftplugin}/pcmk.vim
>>>>>
>>>>> In /root/.vim/ftdetect/pcmk.vim I have the following content
>>>>>
>>>>> au BufNewFile,BufRead /tmp/tmp* set filetype=pcmk
>>>>>
>>>>> but there may be a better way to make this happen. 
>>>>> /root/.vim/pcmk.vim
>>>>> is the attached file.
>>>>>
>>>>> Comments (not too nasty please!) welcome.
>>>
>>> I've added a couple of extra keywords to the file, to cover a couple
>>> more use cases. Other than that, great job.
>>
>> will this addition make it into some package(s)?
>> would it be right to ship this vim syntax file with crm?
>>
>> thanks,
>> raoul
>
> Gave this syntax file a shot and I dont think it should be included in 
> the standard package. Its very colorful, but it breaks too many 
> standard highlighting conventions.
>
>     * The 'node' keyword doesnt gets highligted with a different color
>       than 'primitive', 'property', etc
>     * The names of primitives, clones, etc should be highlighed with
>       "Identifier" not "Type"
>     * The primitive type (ocf:hearbeat:whatever) should be "Normal"
>     * Chars like '=' '\' ':' should not be assigned a color ("Normal"
>       or left alone)
>     * Colors of weights are assigned different colors when used in
>       location rules and colocation/order rules. These should get the
>       same color policy, and should also be something other than "String".
>
> The color output you get from 'configure show' should be what vim 
> looks like, or very close to it.
You are welcome to amend it as you see fit and submit your version to 
the list!

 From my POV, 'colorful' is better than black and white which is the 
current alternative.






More information about the Pacemaker mailing list