Home Download Buy Blog Forum Support

Sidebar icons in themes

Re: Sidebar icons in themes

Postby Mellowfellow on Sun Jun 15, 2014 8:16 pm

Orlmente wrote:
Mellowfellow wrote:How can I target .erb files so I can add a icon too them ? I tried "source.rails", "text.html.rails" but it's not working.

If you want to add specif icons for specific filetypes you need to:
1) add the respective file_type_%desired file type here%.png and file_type_%desired file type%@2x.png (for retina) it in /package/Theme - %current theme name here%/icons/ folder (if Theme - themename folder does not exist create it yourself)
2) create a new "Icon (%new file type here%).tmPreference" file and put it in either /package/user/ or /package/Theme - %current theme name here%/ forlder.
3) in the newly created "Icon (%new file type here%)" file insert the following:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <string>%right scope for file type here%</string>
        <string>file_type_%new file type here%</string>

For the scope of .erb fyles, it should be html.body.ruby, but you can find it both by:
1) looking in the color scheme or language definition files to see which scopes are used for highlight
2) add
Code: Select all
{ "keys": ["ctrl+alt+shift+o"], "command": "show_scope_name" }
to you user's keybindings, create a new .erb fyle and trigger the command to display current scope in the bottom statusbar

hope it helps

Thanks man, i added the scope too my ruby icon file string <string>text.haml,source.rails,source.ruby,text.html.ruby</string>

Worked like a boss!
Posts: 4
Joined: Thu May 15, 2014 3:53 pm

Re: Sidebar icons in themes

Postby ctf0 on Thu Jun 19, 2014 6:57 am

to apply the new side bar icons i found 2 easy ways to do so

1-go to (Packages folder) make a folder call (Theme - Default) "you can name that folder to anything as ST use the empty sublime-theme file as a reference not the folder that contains it" ,drop your icons folder in there ,then create an empty file with the name of your currently applied theme.

Code: Select all
   |Theme - Default

*now everytime you apply a new theme just change the (???) to the theme name.

2-drop the icons folder in your theme folder ,right next to your (???.sublime-theme) file and the icons will be applied automatically.

.in both ways i found that i don't need to change or add any lines to the theme files.
.if you want to use the default icons that came with the latest rev ,do the same as the first step & delete or rename the icons folder to something else.

.for specific type of language (css , less ,etc..) use the instructions made by facelessuser in p.2 ,and put the (???).tmPreferences file right next to the icons folder.
Posts: 11
Joined: Thu May 15, 2014 7:49 pm

Re: Sidebar icons in themes

Postby brownoctober on Tue Jul 08, 2014 9:40 pm

I'm using ST3 and can't get this to work with the Default theme, or the Nexus theme. My user folder looks like this:

Code: Select all
    |- Theme - Default
        |- icons (contains a py.png icon)
        |- py.tmPreferences (as described by facelessuser)
        |- Nexus.sublime-theme (blank)

Is this only workable for ST2 or am I missing something?

Edit: Ignore me, I see this is for dev builds!
Posts: 1
Joined: Tue Jul 08, 2014 9:36 pm

Re: Sidebar icons in themes

Postby zeplin on Wed Jul 09, 2014 6:48 pm

This is so cool, I had no idea that we could do this for our rails application. Thanks!
Posts: 1
Joined: Wed Jul 09, 2014 6:32 pm

Re: Sidebar icons in themes

Postby billdami on Fri Aug 29, 2014 8:13 pm

Does anyone have a recommendation of an file icon pack that will work well with a dark theme (e.g. Soda Dark)? Something similar to Atom's icons would be great.
Posts: 5
Joined: Fri Aug 29, 2014 2:55 pm

Re: Sidebar icons in themes

Postby Lu Nelson on Wed Sep 03, 2014 8:39 am

For icons for Soda Dark, I recommend the ones in PreDawn https://github.com/jamiewilson/predawn, but watch out for how the transparency is handled. I'm not sure about Soda Dark but Predawn keeps them all at a reduced opacity until you select them, which acts as a nice highlighting effect
Lu Nelson
Posts: 3
Joined: Thu Sep 06, 2012 1:41 pm


Return to General Discussion

Who is online

Users browsing this forum: alkuzad, Exabot [Bot], Google [Bot] and 35 guests