Loading ...
Sorry, an error occurred while loading the content.

preview icon of MacVim and color style texting

Expand Messages
  • Yun Jiang
    Hi, I got my new MacAir which is installed the Mountain Lion System (Mac OSX 10.8.2). I did install the latest version of MacVim which is compatible with this
    Message 1 of 2 , Dec 5, 2012
    • 0 Attachment
      Hi,

      I got my new MacAir which is installed the Mountain Lion System (Mac OSX 10.8.2). I did install the latest version of MacVim which is compatible with this fancy operating system. Now I have two questions

      1) I do not know why some .gpl or /data files are shown in an executable file icon while others are shown in a normal text file icon. Actually all these are set to open with MacVim and Change all in the "get info" window. Could you help to figure out? I do not think files open with MacVim should be shown as an executable file icon. Very funny to me.
      See two snapshots below

      2) Some files open with Mac Vim are shown in color style, while others (for example, .gpl files) does not, which, however, can be shown in color style in the Mac OSX 10.6.8. I like the color style texting, which can make me easy to locate. Could you show me the command for this setting?

      Here are two snapshots for this issue.

      Best,

      Yun

      --
      You received this message from the "vim_mac" 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
    • Carl Jacobsen
      ... I haven t tested, but strongly suspect that the difference between the two groups of files is that the ones showing with an executable file icon have one
      Message 2 of 2 , Dec 5, 2012
      • 0 Attachment
        On Dec 5, 2012, at 12:57 AM, Yun Jiang <wing0214@...> wrote:

        > 1) I do not know why some .gpl or /data files are shown in an executable file icon while others are shown in a normal text file icon. Actually all these are set to open with MacVim and Change all in the "get info" window. Could you help to figure out? I do not think files open with MacVim should be shown as an executable file icon. Very funny to me.

        I haven't tested, but strongly suspect that the difference between the two groups of files is that the ones showing with an executable file icon have one or more of the executable permission bits set in their file permissions (mode). If, in the shell, running "ls -l" shows a correspondence between the files in question and those that have "x" anywhere in the first field, then running "chmod a-x affected-file-names" should fix the problem. This, of course, is assuming that you don't need to execute them directly (by clicking from the finder or typing their names at a prompt).

        > 2) Some files open with Mac Vim are shown in color style, while others (for example, .gpl files) does not, which, however, can be shown in color style in the Mac OSX 10.6.8. I like the color style texting, which can make me easy to locate. Could you show me the command for this setting?

        It's all a matter of what syntax files MacVim has available and what code it uses to determine which one to apply (by setting the "filetype" variable). I'm assuming that your ".gpl" files are for Gnuplot. The runtime files for current MacVim are under:

        /Applications/MacVim.app/Contents/Resources/vim/runtime/

        And MacVim has a syntax file for Gnuplot, kept in syntax/gnuplot.vim (under that directory).

        There are entries in the filetype.vim and scripts.vim files which will set the filetype variable for a given file to "gnuplot" if either a) the filename ends with ".gpi" (note not ".gpl") or b) the first line of the file starts with "#!" and contains "gnuplot" (more specifically, contains what looks like a valid path to gnuplot).

        I'm guessing either the rules have changed a bit since the last version you used (MacVim generally incorporates the latest version of Vim available), or, perhaps you used to have a custom setting to treat ".gpl" files as gnuplot. This could be accomplished by adding the line:

        au BufNewFile,BufRead *.gpl setf gnuplot

        to your ~/.vim/filetype.vim file (creating the directory and file if necessary). I suspect others here can suggest slightly cleaner/more proper methods of implementing this, but the above ought to work.

        Cheers,
        Carl

        --
        You received this message from the "vim_mac" 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
      Your message has been successfully submitted and would be delivered to recipients shortly.