ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Icons - File​Icons

by braver ST4

File icons for Sublime Text

Details

Installs

  • Total 262
  • Win 107
  • Mac 64
  • Linux 91
Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15
Windows 0 7 8 4 7 1 4 5 6 0 3 3 3 3 0 6 8 19 7 3 17 11 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 2 3 1 2 3 1 2 1 2 3 4 5 2 3 6 3 16 5 3 8 10 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 3 0 0 4 1 2 2 3 0 5 4 3 5 5 10 7 10 2 6 9 19 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Icons - FileIcons

Adds specific icons for most file types for the sidebar in Sublime Text, in both color and monochrome, for any theme.

Inspired by A File Icon, and based on FileIcons, but now uses the new file icon theme mechanism.

How to use

Once you've installed the package, add the following to your user preferences:

{
    "file_icon_theme": [
        "FileIcons (mono).sublime-file-icons"
    ],
}

For the colored icons replace “mono” with “color”. For the colors to show, you might have to override the theme a little bit, info about that further on.

By default various configuration file formats are not recognized and matched to their natural file extension. For example gruntfile.js will get the icon for JavaScript rather than one specific to Grunt. To enable specific icons for this example and others like .eslintrc.mjs, package.json, etc. also add the “config” icon theme:

{
    "file_icon_theme": [
        "FileIcons (color).sublime-file-icons",
        "FileIcons config (color).sublime-file-icons"
    ],
}

If you prefer the Sublime Text 4 logo for ST-related files over the retro logo, add the “st4” icon set:

{
    "file_icon_theme": [
        "FileIcons (mono).sublime-file-icons",
        "FileIcons st4 (mono).sublime-file-icons",
    ],
}

Tweaking UI themes

To make adjustments to your current theme, just run “UI: Customize Theme” from the command palette, and read the documentation for more information.

Colors

Themes often have their own color overlays on icons, tinting them to match the theme's colors. This works well for monochrome icons. For colored icons you may want to override this behavior. Customize the theme by adding this to its rules, resetting the tint to white and restoring the image's own colors. This also applies a little opacity to differentiate hover and selected states.

{
    "class": "icon_file_type",
    "layer0.tint": [255, 255, 255],
    "layer0.opacity": 0.8,
},
{
    "class": "icon_file_type",
    "parents": [{"class": "tree_row", "attributes": ["hover"]}],
    "layer0.opacity": 0.6
},
{
    "class": "icon_file_type",
    "parents": [{"class": "tree_row", "attributes": ["selected"]}],
    "layer0.opacity": 1.0
}

Icon size

Icons are 18x16 to work well withe Sublime's default themes. To adjust dimensions on any other theme, customize (in the command palette use “UI: Customize Theme”) it by adding this to its rules:

{
    "class": "icon_file_type",
    "content_margin": [9, 8]
}

Contributing

The “build” directory contains the svg assets. Each icon is assigned a color in icons.json, available colors are listed in colors.json.

PNG icons are generated with Python (>= 3.10), rendering is done by resvg through the resvg_py wheel. make creates the virtualenv in .venv and installs the pinned requirements automatically.

To add an icon:

  • add an svg asset with the correct name
  • check that the svg matches the format of the other icons:
    • the root svg element has an explicit 18x16 viewport: width="18" height="16" preserveAspectRatio="xMinYMin meet"
    • all shapes are combined into a single path
    • the path has a style attribute applying the color
  • add an entry to build/icons.json and assign it a color
  • run make
  • commit the files
  • open a PR
  • 💃

If the Solarized Color Scheme package is installed next to this one, make also regenerates its icons, using the palette in build/solarized.json.

The color and mono branches of this repository contain the older, now considered legacy, approach to building an icon theme.

Buy me a coffee

If you enjoy this package, feel free to make a little donation towards the coffee that keeps this project running. It's much appreciated!