Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Using gvim to edit .ss files


Reply


3 Posts   1964 Views

Avatar
david_nash

Community Member, 55 Posts

24 March 2009 at 2:39pm

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 :-)

Avatar
david_nash

Community Member, 55 Posts

4 August 2009 at 6:49pm

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.

Avatar
MateuszU

Community Member, 89 Posts

28 June 2012 at 8:58am

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