Xmodmap syxtax highlighting

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Xmodmap syxtax highlighting

cubancigar

Hi!

Vim only recognises files named "xmodmap". Change of case in any
letter is not detected. Thus, if the file is named "Xmodmap", no
syntax highlighting is done.

It would be nice if vim would just ignore the case while loading.
There are several programs which do not detect xmodmap but Xmodmap...
right now my solution is to have xmodmap and a link to it named
Xmodmap

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Xmodmap syxtax highlighting

Tony Mechelynck

mapuna wrote:

> Hi!
>
> Vim only recognises files named "xmodmap". Change of case in any
> letter is not detected. Thus, if the file is named "Xmodmap", no
> syntax highlighting is done.
>
> It would be nice if vim would just ignore the case while loading.
> There are several programs which do not detect xmodmap but Xmodmap...
> right now my solution is to have xmodmap and a link to it named
> Xmodmap
>
> Thanks

I think this is a bug in the Vim runtime files. The workaround is as follows:

Create (or edit) a file named (assuming ;-) you're on a Unix-like system)
$HOME/.vim/filetype.vim

and make sure that it contains (possibly among others) the following lines, in
this order:

        augroup filetypedetect

        au BufRead,BufNewFile Xmodmap setf xmodmap

        augroup END


If some of the directories in the path to this file don't yet exist, create
them. Then, after saving your work, restart Vim. It should recognise Xmodmap
from now on, without the need for a link.


Best regards,
Tony.
--
Bathquake, n.:
        The violent quake that rattles the entire house when the water
faucet is turned on to a certain point.
                -- Rich Hall, "Sniglets"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Xmodmap syxtax highlighting

Bram Moolenaar
In reply to this post by cubancigar


Anupam Srivastava wrote:

> Vim only recognises files named "xmodmap". Change of case in any
> letter is not detected. Thus, if the file is named "Xmodmap", no
> syntax highlighting is done.
>
> It would be nice if vim would just ignore the case while loading.
> There are several programs which do not detect xmodmap but Xmodmap...
> right now my solution is to have xmodmap and a link to it named
> Xmodmap

I try to detect only file names that are really used, ignoring case is a
bit expensive.

I can add "*Xmodmap" as a pattern, I would think that finds most files.
I notice ".Xmodmap" being used in examples.

--
hundred-and-one symptoms of being an internet addict:
24. You realize there is not a sound in the house and you have no idea where
    your children are.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Xmodmap syxtax highlighting

cubancigar
In reply to this post by Tony Mechelynck



On Jul 20, 4:13 pm, Tony Mechelynck <[hidden email]>
wrote:
>         au BufRead,BufNewFile Xmodmap setf xmodmap
I think you meant .Xmodmap

Thanks, it works.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Xmodmap syxtax highlighting

Tony Mechelynck

mapuna wrote:
>
>
> On Jul 20, 4:13 pm, Tony Mechelynck <[hidden email]>
> wrote:
>>         au BufRead,BufNewFile Xmodmap setf xmodmap
> I think you meant .Xmodmap
>
> Thanks, it works.

maybe *[xX]modmap

it would depend on how the file is named on your system.


Best regards,
Tony.
--
Certainly there are things in life that money can't buy, but it's very funny--
        Did you ever try buying them without money?
                -- Ogden Nash

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---