Git Product home page Git Product logo

atom's Introduction

File Icons

Build status: TravisCI Latest package version

File-specific icons in Atom for improved visual grepping.

Icon previews

Supports the following core packages:

An API is offered for packages not listed above. See the integration steps for more info.

Installation

Open Settings β†’ Install and search for file-icons.

Alternatively, install through command-line:

apm install --production file-icons

Customisation

Everything is handled using CSS classes. Use your stylesheet to change or tweak icons.

Consult the package stylesheets to see what classes are used:

Icon reference

Examples

Resize an icon

.html5-icon:before{
	font-size: 18px;
}

// Resize in tab-pane only:
.tab > .html5-icon:before{
	font-size: 18px;
	top: 3px;
}

Choose your own shades of orange

.dark-orange   { color: #6a1e05; }
.medium-orange { color: #b8743d; }
.light-orange  { color: #cf9b67; }

Bring back PHP's blue-shield icon

.php-icon:before{
	font-family: MFizz;
	content: "\f147";
}

Assign icons by file extension

The following examples use attribute selectors to target specific pathnames:

.icon[data-name$=".js"]:before{
	font-family: Devicons;
	content: "\E64E";
}

Assign icons to directories

.directory > .header > .icon{
	&[data-path$=".atom/packages"]:before{
		font-family: "Octicons Regular";
		content: "\f0c4";
	}
}

Troubleshooting

I see this error after installing:

"Cannot read property 'onDidChangeIcon' of undefined"

A restart is needed to complete installation. Reload the window, or restart Atom.

If this doesn't help, please file an issue.

Installation halts with an npm error:

npm ERR! cb() never called!

There might be a corrupted download in your local cache. Delete ~/.atom/.apm, then try again:

rm -rf ~/.atom/.apm
apm install --production file-icons

An icon has stopped updating:

It's probably a caching issue. Do the following:

  1. Open the command palette: Cmd/Ctrl + Shift + P
  2. Run file-icons:clear-cache
  3. Reload the window, or restart Atom

Ruby files are showing the wrong font:

If language-ethereum is installed, remove it. This is a known issue with the package, which is no longer maintained. For Solidity support, use linter-solidity or language-solidity instead.

If language-ethereum isn't installed, please follow these steps and file an issue.

The tree-view's files are borked and look like this:

If you haven't restarted Atom since upgrading to File-Icons v2, do so now.

If restarting doesn't help, your stylesheet probably needs updating. See below.

My stylesheet has errors since updating:

As of v2.0, classes are used for displaying icons instead of mixins. Delete lines like these from your stylesheet:

-@import "packages/file-icons/styles/icons";
-@import "packages/file-icons/styles/items";
-@{pane-tab-selector},
.icon-file-directory {
	&[data-name=".git"]:before {
-		.git-icon;
+		font-family: Devicons;
+		content: "\E602";
	}
}

Instead of @pane-tab… variables, use .tab > .icon[data-path]:

-@pane-tab-selector,
-@pane-tab-temp-selector,
-@pane-tab-override {
+.tab > .icon {
 	&[data-path$=".to.file"] {
 		
 	}
}

These CSS classes are no longer used, so delete them:

-.file-icons-force-show-icons,
-.file-icons-tab-pane-icon,
-.file-icons-on-changes

It's something else.

Please file an issue. Include screenshots if necessary.

Integration with other packages

If you're a package author, you can integrate File-Icons using Atom's services API.

First, add this to your package.json file:

"consumedServices": {
	"file-icons.element-icons": {
		"versions": {
			"1.0.0": "consumeElementIcons"
		}
	}
}

Secondly, add a function named consumeElementIcons (or whatever you named it) to your package's main export:

let addIconToElement;
module.exports.consumeElementIcons = function(func){
	addIconToElement = func;
};

Then call the function it gets passed to display icons in the DOM:

let fileIcon = document.querySelector("li.file-entry > span.icon");
addIconToElement(fileIcon, "/path/to/file.txt");

The returned value is a Disposable which clears the icon from memory once it's no longer needed:

const disposable = addIconToElement(fileIcon, "/path/to/file.txt");
fileIcon.onDestroy(() => disposable.dispose());

NOTE: Remember to remove any default icon-classes before calling the service handler!

 let fileIcon = document.querySelector("li.file-entry > span.icon");
+fileIcon.classList.remove("icon-file-text");
 const disposable = addIconToElement(fileIcon, "/path/to/file.txt");

Sponsors

Huge thanks to the following backers who generously sponsored this project in the past:

Justin Ireland Tipe Triplebyte TakeShape Targeted Web Traffic

Acknowledgements

v1 was originally based on sommerper/filetype-color. v2 was completely rewritten. Both versions owe their success to innumerable contributions from the Atom community.

atom's People

Contributors

a-b-r-o-w-n avatar alhadis avatar avanderhoorn avatar ckross01 avatar daltones avatar dan-c-underwood avatar danbrooker avatar digitaldesigndj avatar ericcornelissen avatar forcegroup avatar fusion809 avatar gontadu avatar hansonw avatar hggeorg avatar itiut avatar jamieconnolly avatar jeremy-engel avatar johngeorgewright avatar jtarasovic avatar k4nar avatar lopezjurip avatar luke5542 avatar nicolab avatar roman01la avatar rowinbot avatar schmty avatar spenserblack avatar suranyami avatar tomasstankovic avatar williamd1k0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom's Issues

Icon classes continuouly added on tree view items

See the screenshots below:

file icons classes

As you can see the file-icon-json class is added continuously on the item. Not that it affect the package much, but it means the DOM is updated quite frequently without any actual display changes and debugging item styles is quite painful as new rules pop in the inspector when you inspect it.

Julia support

Hi, I'm was using Atom and this extension to program in Julia, and I noticed that Julia files .jl are not supported. Would be nice to add a icon just like this one (if possible):

Julia Logo

Since the official logo is:

Julia full logo

What do you think?

centering icons

image

If you look at the Gemfile icon and the Readme icon, they are slightly off-center, which looks a little odd.

PS: I really love the work that you did on the latest update - the git and coffeescript icons look fantastic.

coffee icon looks broken

image

With the font-size used in the atom file-tree, the devicons coffee icon looks really broken. That icon should be reverted to whatever is pictured in the readme.

Option for colourless icons

While I do like the use of colours, I find a but distracting and conflicting with the CVS state colours. Because of that I would prefer to have the icons respect the file state color. Would this be possible in the future?

React jsx icon

Now that React.js is taking over the JS world it's time to get a dedicated icon for it!

.js.coffee.erb file showing wrong icon

My coffeescript file with embedded ruby is showing as html 😞 I'd expect it to show it as coffeescript or javascript at least, Is there something I'm missing?
screen shot 2014-09-24 at 11 34 41 am

Changing Mfizz Icons Broken

I wanted to change JS and CSS icons to use different Mfizz Icons.

.js-icon { .mf; content: "\f148"; left: 1px; }
Ends up with a Postgress icon instead of nodejs icon like it should be.

.css3-icon { .mf; content: "\f13d"; }
Ends up with an Oracle icon instead of a CSS icon like it should be.

Seems to content codes don't match the Mfizz site.

Inconsistency between Tree View icons and Tab icons

Here are the inconsistencies I see:

  • LICENSE: Shows proper icon in TreeView but no icon in Tab
  • README.md: Shows proper icon in TreeView but shows the markdown icon in Tab

I've not tried all different file options but the one project I've opened since installing the package brought these up.

Match per grammar rather than per extension

Great package, thanks for building it!

Just a feature suggestion: atom already sets the grammar for files via grammar-selector, so it would be cool to show icons based on this. the benefit being that files without extensions (or even miss-matched) could still show appropriate icons for the grammar you've told atom to use.

I'd like to give .bashrc, Vagrantfile, Dockerfile, etc some icon love :)

Support .yaml Extension

I generally opt for the .yaml extension rather than .yml though I have noticed .yaml does not display the yaml icon. It would be nice if .yaml displayed the same icon as .yml.

No longer shows icons on tabs

The readme describes this as adding icons to both the tree view and tabs. However, tabs do not show anything but the default, theme icon. Inspecting tabs shows that there is no data-name attr being assigned.

User customisation not working

I am trying to add custom icons for spec directories (add ruby icon) and a custom for .pp (puppet) files but have not been able to get the customisations working from the main page.

For the directory changes I am adding the following to my ~/.atom/styles.less (I have tried at the top level and in the .editor and .tree-view sections

.icon-file-directory[data-name="spec"]:before { .ruby-icon; }

On startup I get the following error

.ruby-icon is undefined", source: /usr/local/share/atom/resources/app/src/theme-manager.js (279)

Similarly I am using the following to add a custom icon from FontAwesome for puppet files (again in ~/.atom/styles.less)

// Puppet
.puppet-icon { .fa; content: "\f0c3"; }
.icon-file-text[data-name$=".pp"]:before { .puppet-icon; .medium-purple }

This time I get the following error

.fa is undefined", source: /usr/local/share/atom/resources/app/src/theme-manager.js (279)

I am running atom 0.104.0 on 64bit Linux (kubuntu) built following the main build instructions

Gruntfile.coffee Icon Colour

I propose that a CoffeeScript Gruntfile be the same colour as other CoffeeScript files, ``, though retain the Gruntfile icon.

.JPG vs .jpg

Hi Dan, I love this package!
I have a question tho... I have noticed that a file named e.g. image.jpg would get the icon meant for jpg files, while image.JPG would get a 'text' icon. I am not sure whether this is only on my specific Atom package mix, planned feature, or do you see it too?

js icon does not fit?

1

on windows
tried deleting everything and just installing file-icons and still happens
idk
thanks

Fuzzy Finder support

It would be awesome if we could optionally show the icons in the Fuzzy Finder.

Performance improvements

The package seems to be quite slow compared to other Atom packages. Is there anything that can be done about performance?

This package added 243ms to startup time.

composer.json icon

What about create an icon for composer.json file.
Maybe like this image :
composer

Shebang/modeline recognition

Hey, some scripts of mine, I like to leave off the extension so I can run them more naturally as executables. So it would be really cool if you could recognize the shebang's for the filetype!

Icomoon icons a bit small

I figured I'd just open an issue for this. The Icomoon icons might appear a bit on the small side, maybe font-family: x-large; will make it look a bit better?

Some icon colors too light with Atom Light theme

It would be great if there was a setting (or auto-detection) for the Atom Light theme to use slightly darker versions of some of the file icon colors. As you can see, JS and JSON files, in particular, are hard to see.

screen shot 2014-09-26 at 11 01 31 am

Console error when opening a project in dev mode

More of an annoyance than anything. Any idea what's going on here?

Error: /Users/brian/.atom/packages/file-icons/stylesheets/fonts is a directory
  at new File (/Applications/Atom.app/Contents/Resources/app/node_modules/pathwatcher/lib/file.js:32:15)
  at PackageWatcher.module.exports.Watcher.watchFile (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/watcher.js:75:16)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/package-watcher.js:39:19
  at PackageWatcher.module.exports.PackageWatcher.watch (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/package-watcher.js:64:9)
  at new PackageWatcher (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/package-watcher.js:30:12)
  at UIWatcher.module.exports.UIWatcher.createWatcher (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/ui-watcher.js:80:17)
  at UIWatcher.module.exports.UIWatcher.watchPackage (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/ui-watcher.js:74:55)
  at UIWatcher.module.exports.UIWatcher.watchPackages (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/ui-watcher.js:31:14)
  at new UIWatcher (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/ui-watcher.js:16:12)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/lib/dev-live-reload.js:15:21
  at /Applications/Atom.app/Contents/Resources/app/node_modules/emissary/lib/emitter.js:85:24
  at /Applications/Atom.app/Contents/Resources/app/node_modules/emissary/lib/emitter.js:133:30
  at Array.forEach (native)
  at PackageManager.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/emissary/lib/emitter.js:132:47)
  at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:87:19)
  at Atom.module.exports.Atom.startEditorWindow (/Applications/Atom.app/Contents/Resources/app/src/atom.js:349:21)
  at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:14:8)
  at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:20:4)
  at Module._compile (module.js:455:26)
  at Object.Module._extensions..js (module.js:473:10)
  at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:311:12)
  at Module.require (module.js:363:17)
  at require (module.js:379:17)
  at window.onload (file:///Applications/Atom.app/Contents/Resources/app/static/index.js:20:5)

Dockerfile

a little docker whale would be pretty cool

Sublime Tabs support

I know its already mentioned in the README but it would be great if the file icons also worked with the package sublime tabs.

With Sublime Tabs enabled, I see the icons in the tree view but not in the tabs:

atom

Maybe @ddavison can comment if this is a possibility, Thanks!

ASP VB.net Icon

Could someone please make a ASP VB.net icon for File-icons?

Yosemite Theme

Any reason this doesn't seem to work with the yosemite-unity-ui theme?

screen shot 2014-07-25 at 6 57 18 pm

Icomoon tool icons

I that another theme creator used icomoon for gulp, bower, grunt, npm, procfile, and possibly many more tools that have project files. It would be nice to add support, I don't have time to do it at the current moment, but I might look into doing it later.

https://github.com/jesseweed/seti-ui is the theme that has these icons as a font already.

Sourcepawn icon

Sourcepawn (.sp, .inc) is very similar to C++ and Java (and is based off of Pawn). It is obscure, but Github does support it.

LaTeX Icon

Love the icons but I'm missing one, a TeX file icon. In a perfect world, I'd love it if I had one for beamer/presentations, articles, and other common doc types from TeX, but since they're all .tex that may be more than the current possibility :P

I am looking to see if I can find anything appropriate/good enough, I'm horrible at graphics though so I can't say I can guarantee my own success in providing one.

I found some at IconFinder and at some made by Yusuke in the Fugue collection... but like I said I don't know that they fit the design (or the darkness).

If I find one I'll throw up a pull request...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.