Giter Club home page Giter Club logo

izer's Introduction

izer

Build Status codecov

izer is a command-line tool for adding icons to filenames.

izer is heavily inspired by VimDevIcons.

Pros

  • Portable, no dependencies
  • Fast
  • Icon sets for different fonts
  • Colored icons
  • Deiconize feature for removing icons from filenames
  • Smooth integration with fzf

Benchmark

BenchmarkDeiconize-8                          10        1118691512 ns/op
--- BENCH: BenchmarkDeiconize-8
    deiconize_bench_test.go:28: Input size: 44148 KB - 1356000 lines
BenchmarkIconize/Nerd-8                       10        1301644333 ns/op
BenchmarkIconize/NerdColor-8                  10        1567274214 ns/op
BenchmarkIconize/NerdDir-8                    10        1829822057 ns/op
BenchmarkIconize/NerdDirColor-8               10        2202257278 ns/op
--- BENCH: BenchmarkIconize
    iconize_bench_test.go:32: Input size: 19472 KB - 1356000 lines

Installation

From binaries

The release page includes precompiled binaries for Linux, FreeBSD, macOS and Windows.

Using Go

go get -u github.com/NightWolf007/izer

Usage

Iconize

iconize command adds icons to filenames. You can pass filenames to command through stdin or as arguments.

Command-line options

Usage:
  izer iconize [flags]

Flags:
  -c, --color         Enable colorful output
  -d, --dir           Enable icons for directories (Slows down the process due checking files)
  -f, --font string   Font to be used. See: izer fonts
  -h, --help          help for iconize

Simple usage

# Using arguments
izer iconize -f=nerd somefile.go somefile2.py

# Using stdin
find . | izer iconize -f=nerd

Directory icons

Checking that filename is directory or not slows down the iconization process. Thus, by default izer handles directories as a simple files.

To enable directory icons use -d opton.

# Using arguments
izer iconize -f=nerd -d somedir somefile.go

# Using stdin
find . | izer iconize -f=nerd -d

Colored icons

-c option prints icons in ANSI colors

# Using arguments
izer iconize -f=nerd -c somefile.go somefile2.py

# Using stdin
find . | izer iconize -f=nerd -c

Deiconize

deiconize command removes icons from filenames (undoing iconize command). You can pass filenames to command through stdin or as arguments.

# Using arguments
izer deiconize " somefile.go" " somefile.py"

# Using stdin
find . | izer iconize -f=nerd | izer deiconize

Supported fonts

To show list of all supported fonts use fonts command.

izer fonts

Using izer with fzf

You can use izer to iconize files in fzf.

# Set default preview command
export FZF_DEFAULT_PREVIEW="fd --type file | izer iconize -f=nerd -c"

# Run fzf
fzf | izer deiconize

# Run fzf with preview
fzf --preview 'bat $(izer deiconize {})' | izer deiconize

More info about fzf usage here.

Development

Prerequisites

Building

# Build izer binary
make

# Generate font files and test inputs from mappings
make generate

Linting

# Using make
make lint

# Alternatively, you can run golangci-lint directly
golangci-lint run

Testing

# Run all tests
make test

# Run integration tests
make itest

# Update test golden files
make goldens

Benchmarking

# Run integration benchmarks
make bench

# Also, you can pass benchtime through variable
BENCHTIME=10x make bench

izer's People

Contributors

nitwof avatar richiware avatar

Stargazers

Tuan Duc Tran avatar 空格不在 avatar  avatar Harry Gallagher avatar Ferhat Erata avatar Adam Wagner avatar Lucy Crockett avatar

Watchers

 avatar

Forkers

richiware

izer's Issues

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.