Vagrantfile syntax highlighting

Answered
Hi,

have you managed to use TextMate bundle support to add syntax highlighting for Vagrantfiles? If you have, how? Which particular bundle have you used and how have you configured?

I have working highlighting for Ruby-files (I used , but I've been unable to activate it for Vagrantfiles (I've tried to add "Vagrantfile" into "Files supported by TextMate bundle" and into Ruby.tmbundle's Syntaxes/Ruby.plist's FileTypes, but without any succeess.)

  • Asko
9 comments
Hi Asko! I've managed to do that following the instruction at http://stackoverflow.com/questions/16451359/is-it-possible-to-get-ruby-syntax-highlighting-in-phpstorm/16451778#16451778
and adding <string>Vargrantfile</string> to Ruby.tmbundle\Syntaxes\Ruby.plist
0
Hi Dmitry. I now tried also the Ruby.tmbundle-version from the Stackoverflow question. For Ruby files the syntax highlighting works. I can even get it work for "*.vagrantfile" and "*.Vagrantfile", but not for "Vagrantfile". Weird. (I'm on OSX 10.8 using PyCharm 2.7.2.)
0
What do you add to Syntaxes/Ruby.plist and Files supported by TextMate bundle as pattern?
0
So, with the following settings *.rb and *.vagrantfile is highlighted correctly, but Vagrantfile and Rakefile are not:

➜  Ruby.tmbundle git:(master) ✗ grep -i "Vagrant" Syntaxes/Ruby.plist -B2 -A11
    <key>fileTypes</key>
    <array>
        <string>vagrantfile</string>
        <string>Vagrantfile</string>
        <string>rb</string>
        <string>rbx</string>
        <string>Rakefile</string>
        <string>rake</string>
        <string>sake</string>
        <string>cgi</string>
        <string>fcgi</string>
        <string>gemspec</string>
        <string>irbrc</string>
        <string>capfile</string>
    </array>

➜  PyCharm20  cat options/filetypes.xml      
<?xml version="1.0" encoding="UTF-8"?>
<application>
  <component name="FileTypeManager" version="11">
    <ignoreFiles list="CVS;SCCS;RCS;rcs;.DS_Store;.svn;.pyc;.pyo;*.pyc;*.pyo;.git;*.hprof;_svn;.hg;*.lib;*~;__pycache__;.bundle;*.rbc;*$py.class;*.orig;" />
    <extensionMap>
      <mapping ext="cfg" type="BuildoutCfg" />
      <mapping ext="pt" type="HTML" />
      <mapping pattern="Vagrantfile" type="TextMate" />
      <mapping pattern="Rakefile" type="TextMate" />
      <mapping ext="rake" type="TextMate" />
      <mapping ext="fcgi" type="TextMate" />
      <mapping ext="vagrantfile" type="TextMate" />
      <mapping ext="rbx" type="TextMate" />
      <mapping ext="irbrc" type="TextMate" />
      <mapping ext="gemspec" type="TextMate" />
      <mapping ext="sake" type="TextMate" />
      <mapping ext="rb" type="TextMate" />
      <mapping ext="capfile" type="TextMate" />
      <mapping ext="robot" type="TextMate" />
      <mapping ext="zcml" type="XML" />
    </extensionMap>
  </component>
</application>
0
If I remember correctly, we've fixed the name matching in PyCharm 3, so this will start working once we begin the EAP.
0
I'm now on the just released 3.0 EAP. With the setup above, the syntax highlighting works, almost: the default background color (for all non-highlighted text) is white on Darcula theme (all text with some highlighted color has the default Darcula background color).
0

Hi, 

> the default background color (for all non-highlighted text) is white on Darcula theme (all text with some highlighted color has the default Darcula background color).

Im experiencing this exact issue. Is there some workaround that we can use, or is this planned to be fixed?

Tkx

2

Hello! I have same issue. Some users have this problem with TextMate too: https://github.com/textmate/python.tmbundle/issues/52
Is there a workaround?

Upd:
I found workaround. (I try on Ubuntu 17.10 with PhpStrom from snap package)

In file `~/.PhpStorm2017.3/config/options/textmate.xml`
To find `<entry key="[email protected]_Darcula" value="Darcula" />` similar string (with `[email protected]`). Replace for preferred theme (Darcula in my case). It's work for me.

0

Please sign in to leave a comment.