Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Using gvim to edit .ss files

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1951 Views
  • david_nash
    Avatar
    Community Member
    55 Posts

    Using gvim to edit .ss files Link to this post

    This really annoyed me and I fixed it, so I thought I'd share.

    I use gvim under Ubuntu to do all my coding. gvim associates *.ss with some other file type, so the syntax highlighting wasn't correct and it wasn't auto-indenting at all.

    I edited /usr/share/vim/vim71/filetypes.vim - do a text search for "Scheme" and you should see this:

    au BufNewFile,BufRead *.scm,*.ss      setf scheme

    For me it was on line 1670.

    Comment it out with a double-quotation (") and load a .ss file - it'll now use the xhtml file type for syntax and indentation instead.

    There's probably a better way to do this... but I've got work to do!

    I hope this helps someone

  • david_nash
    Avatar
    Community Member
    55 Posts

    Re: Using gvim to edit .ss files Link to this post

    I think I found a better way to do this.

    In ~/.vim/filetype.vim (you might need to create it) put:

    au BufNewFile,BufRead *.ss setf xhtml


    and now when you open Silverstripe template files it'll give you html syntax highlighting.

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: Using gvim to edit .ss files Link to this post

    Nice! It works and it is better way of doing this. Did you figure out how to format suntax automatically (=) for ss files so at least it puts the <% %> tags as nested?

    mateusz

    1951 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.