Colors

Colors are integral to developers. When your primary mode of interaction with computers is via text, colors make a lot of difference. Modern terminals can display as many as 256-colors and pls can make use of every one of them!

In most cases, pls uses the standard color of the language for source code files.

Preferences

pls does not offer any toggles for colors. Colors are on by default, as developers like it. To remove colors from your life, pipe the output through cat like so. When pls detects that it's not writing to a TTY, it turns off all formatting like colors and font styles in the output.

$ pls | cat

Configurations

pls comes with built-in configurationopen in new window for a number of languages, tools and file types.

  • Python:
    Package managers: Poetry and Pipenv
    Code quality tools: Flake8 and pre-commit

  • Ruby:
    Package managers: Bundler
    Code quality tools: Rubocop

  • JavaScript:
    Package managers: Yarn, npm and pnpm
    Code quality tools: ESLint
    Frameworks: Vue.js

  • TypeScript

  • Docker / Docker Compose

  • Make / Rake / Just

This enables a highly colorful output where a files colors correspond to the name and type of the file or directory (directories are cyan by default).

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

Unimportant files (like poetry.lock here) are dimmed.

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

Python file are colored in blue #3776ab.

   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 are yellow #f7df1e.

   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           

TypeScript and Docker files are also blue (#3178c6 and #2496ed respectively) but these blues are different from each other, and also from Python's blue #3776ab.

   colorls/         
   yaml/            
   colorls.rb       
ﲵ   tab_complete.sh  

Ruby files are red #cc342d.

Customisation

To add more color schemes, 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 color schemes for your projects (among other things).

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

Colors are set via node specs. Refer to the docs for defining node specs.