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

A File Icon

by ihodev, DeathAxe ST3 Top 25

Sublime Text File-Specific Icons for Improved Visual Grepping

Labels theme, file, icons

Details

Installs

  • Total 1.28M
  • Win 751K
  • Mac 274K
  • Linux 249K
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5
Windows 5 84 104 84 88 62 66 81 99 95 113 81 72 62 72 76 84 105 79 58 70 81 89 82 95 98 74 84 88 117 109 96 106 83 82 102 130 105 103 89 89 92 104 96 102 133
Mac 3 26 40 21 33 11 20 29 24 21 35 30 20 15 19 27 26 38 23 14 23 30 23 28 39 22 16 26 25 34 34 40 18 21 20 33 32 31 34 32 16 21 33 33 33 26
Linux 2 49 31 36 24 21 27 26 32 39 32 38 26 22 25 34 37 37 26 31 31 32 34 26 40 26 31 37 32 35 35 32 34 22 23 24 40 23 43 39 26 31 35 40 33 43

Readme

Source
raw.​githubusercontent.​com

A File Icon

Star on GitHub Join the chat at Sublime Forum

This package adds file-specific icons to Sublime Text for improved visual grepping. It's heavily inspired by Atom File Icons.

Its aims are:

  • Provide globally available file type specific icons for each UI themes, whether they provide their own file type specific icons or not.

  • Workaround a ST core bug, which causes no icons to be displayed for file types an installed but not selected/active theme provides definitions for via tmPreferences files.

  • Display file icons, even if required syntax definition is not installed.

  • Display specific icons for files, no dedicated syntax definition exists for.

If you have any problems, please search for a similar issue first, before creating a new one.

Also, check the list of known issues before doing so.

Users

Installation

Package Control

The easiest way to install is using Sublime's Package Control. It's listed as A File Icon.

  1. Open Command Palette using menu item Tools → Command Palette...
  2. Choose Package Control: Install Package
  3. Find A File Icon and hit Enter

Download

  1. Download the .zip
  2. Unzip and rename folder to A File Icon
  3. Copy folder into Packages directory, which you can find using the menu item Preferences → Browse Packages...

Note: Don't forget to restart Sublime Text after installing this package.

Customization

You can change the color, opacity level and size of the icons by modifying your user preferences file, which you can find by:

  • Preferences → Package Settings → A File Icon → Settings,
  • Choose A File Icon: Settings in Command Palette.

Wrong Icons

Sublime Text uses syntax scopes for file-specific icons. That's why icons of packages provided by the community require them to be installed.

See the list of community packages that you may need to install to see the right icon.

Themes

If your theme supports an icon customization you can choose what icons you want to use – provided by the theme (by default) or provided by the package. Otherwise this package adds its own icons only.

Troubleshooting

If something goes wrong try to:

  1. Open Command Palette using menu item Tools → Command Palette....
  2. Choose A File Icon: Revert to a Freshly Installed State.
  3. Restart Sublime Text.

Developers

Bring Support of the File Icon Customization to Your Theme

If you are a theme developer and you want to support a file icon customization, you should:

  • Remove all stuff related to the icon setup: .tmPreferences, .sublime-settings, .sublime-syntax and .tmLanguage files.
  • Rename all your existing icons to match these ones.
  • Add .supports-a-file-icon-customization file to the root of your theme (this is how we check if the theme supports customization of the file-specific icons).

How It Works

In simple terms, A File Icon does the following:

  1. Copies all the necessary files right after install or upgrade to zzz A File Icon zzz directory
  2. Searches all installed themes
  3. Checks if themes are already patched, if not
  4. Patches them by generating <theme-name>.sublime-theme files from a template
  5. For themes those support file icon customization, it provides .tmPreferences files and missing icons by default (user can override icons provided by the theme via "force_mode": true).

The real process is just a little bit more complex to minimize hard drive I/O.

Resources

Colors

Colors are bright because they should look good with most themes. However you can change color and opacity level of all icons. See customization.

Palette

Icons

This package contains icons provided by:

Source icons are provided in SVG format (Sublime Text doesn't currently support it). They are convert to @1x and @2x PNG assets before each release via python build script py build -i.

Rasterized icons can be found in icons folder.