Icons

pls can show Nerd Font icons or emoji next to files and directories making it easier to read the output. In effect, pls enables you to annotate your files and directories with the full set of 3693 Nerd Font icons and 3633 emojis!

The icons are meticulously chosen and intelligently mapped to nodes using specs which consider many aspects of the node rather than just the extension.

Notice how directories and files have these very pretty icons to their left? These are Nerd Font icons.

Preferences

CLI flags: --icon/-i
Config YAML: icon

This is an enum field with the following choices:

  • nerd: show Nerd Font icons (default)

    $ pls # default
    $ pls -i nerd
    
    prefs:
      icon: nerd
    
   dist/                   
   readme_assets/          
   src/                    
   tests/.flake8                  
  .gitignore               
ﰌ   justfile                
   LICENSE                 
  .pls.yml                 
   poetry.lock.pre-commit-config.yaml  
   pyproject.toml          
   README.md               
  • emoji: show emojis

    $ pls -i emoji
    
    prefs:
      icon: emoji
    
🎁  dist/                   
📁  readme_assets/          
💻  src/                    
🧪  tests/                  
🧹 .flake8                  
⏪ .gitignore               
🏃  justfile                
⚖️   LICENSE                 
⚪️ .pls.yml                 
🔒  poetry.lock             
🧹 .pre-commit-config.yaml  
📦  pyproject.toml          
📄  README.md               
  • none: turn off icons

    $ pls -i none
    
    prefs:
      icon: none
    
 dist/                   
 readme_assets/          
 src/                    
 tests/                  
.flake8                  
.gitignore               
 justfile                
 LICENSE                 
.pls.yml                 
 poetry.lock             
.pre-commit-config.yaml  
 pyproject.toml          
 README.md               

Configuration

Out of the box, pls includes Nerd Font iconsopen in new window and emojisopen in new window for a large number of file types.

   dist/
   readme_assets/
   src/
   tests/.flake8
  .gitignore
ﰌ   justfile
   LICENSE
  .pls.yml
   poetry.lock.pre-commit-config.yaml
   pyproject.toml
   README.md

Here you can see how files and directories map precisely to very topical icons. It should be noted how icons map to file names as well and are not just based on the extension. Notice the icons for .gitignore, justfile for the task runner Justopen in new window and LICENSE.

Files for code quality tools like .pre-commit-config.yaml and .flake8 have the broom. Package files have a box and the lock files have a lock.

   data/          
   enums/         
   fs/            
   models/        
   __init__.py    
   args.py        
   exceptions.py  
   main.py        
   state.py       
   table.py       

Python source code files have the Python logo on them.

   api/                   
   dist/                  
   node_modules/          
   public/                
   src/                   
   babel.config.js        
   capacitor.config.json  
  .eslintrc.js.gitignore              
   ionic.config.json      
   package-lock.json      
   package.json           
   postcss.config.js      
   README.md              
   tailwind.config.js     
   tsconfig.json          
   vue.config.js          

JavaScript files say JS. Notice how package.json and capacitor.config.json have the same extension but different icons.

   assets/                   
   components/               
   compositions/             
   models/                   
   pages/                    
   router/                   
   store/                    
   style/                    
   support/                  
   tokens/                   
   views/                    
   App.vue                   
   Dockerfile                
   main.ts                   
   registerServiceWorker.ts  
   shims-png.d.ts            
   shims-svg.d.ts            
   shims-vue.d.ts            
   shims-vuex.d.ts           

Docker files have the whale. TypeScript files say TS. Vue.js SFC files have the logo of the Vue.js framework.

   colorls/         
   yaml/            
   colorls.rb       
ﲵ   tab_complete.sh  

Ruby files have the red ruby. Shell files have the icon for a CLI shell.

Customisation

To add more icons, you can do either of the following.

  • Extend the configuration locally using a local .pls.yml file.
    For the majority of use cases, this is the preferred option. Using pls's powerful extensibility, you can define new icons and override existing ones for your projects (among other things).

    In the examples above, the icons for src/ and tests/ were defined by the local config file.

  • Make a pull-request to pls.
    This only applies if the file type is fairly common and the inclusion of the config adds value for a lot of developers. The pls OOBE is intentionally minimal.

Refer to the docs for configuring icons.

Requirements