🥛 Milked out ' ls ' command
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
milky a510a8100a
🎉 Initial fork
3 weeks ago
assets 🎉 Initial fork 3 weeks ago
internal 🎉 Initial fork 3 weeks ago
.gitignore 🎉 Initial fork 3 weeks ago
HELP.md 🎉 Initial fork 3 weeks ago
LICENSE ♻️ Minimal fork 4 weeks ago
README.md 🎉 Initial fork 3 weeks ago
go.mod 🎉 Initial fork 3 weeks ago
go.sum ⬆️ deps 4 weeks ago
main.go 🎉 Initial fork 3 weeks ago

README.md

milk-ls

Milked out fork of a modern ' ls ' command with beautiful icons and git integrations.

Why?

This was forked because U+FB12 wasn't showing within my tmux sessions, so the class nf-mdi-file_hidden was replaced with nf-oct-file_code (U+F40D). Also, not everything matched my system-wide color scheme well enough, so I did tweak a lot of the previously used colors with more vibrant hues.

Roadmap

Updated: ~Tues, July 19th 2022 at 12:40:00 MST

Milestone Summary:

Status Goal
Minimal fork
🚫 Add preview images
🚫 Reimplement gorelease
🚫 Support more glyphs

Usage

All supported flags can be found by using help flag: milk-ls --help

The same documentation has been provided within: HELP.md

Flags

Almost all flags are same as that of the classic ' ls ' command and behave similarly, meaning that the project can be used as a drop-in replacement. This project uses getopt which is a golang variant of the classic getopt utility used in ' ls ' (coreutiles). Thus any combination of flags are possible and can be used.

-1 :

List one entry per line

-a (or) --all:

Doesn't ignore hidden files or dirs (entries starting with .)

-A (or) --almost-all:

Doesn't ignore hidden files or dirs (but hides ./ and ../)

-D (or) --git-status:

Add git status to the listed files and dirs

  • Note: As much I would love to make this the default behavior of the command but showing git status the is an intensive task and is obviously just a tad slower.

-l: Shows in long listing format

  • Other similar commands are:
    • -o: Like -l, but do not list group information
    • -g: Like -l, but do not list owner
    • -G (or) --no-group: In a long listing, don't print group names

-R (or) --recursive:

Lists subdirectories recursively

-? (or) --help:

Prints the help message

  • Similar message can be found at HELP.md.

Sorting:

There are many sorting flags (default is in alphabetic order)

  • -t: Sort by modification time, newest first
  • -S: Sort by file size, largest first
  • -X: Sort alphabetically by entry extension
  • -U: Do not sort; list entries in directory order
  • -v: Natural sort of (version) numbers within text
  • -r (or) -reverse: Reverse order while sorting

-T (or) --time-style=value:

Set time/date format in long formats

  • -l, -o, -g: There are many options to chose from all are listed in HELP.md.

-i (or) --disable-icon:

Doesn't print any icons

-c (or) --disable-color:

Doesn't color icons, filenames and git status

  • Note: use a combination of -ic to print output to a file $ milk-ls -ic > t.txt

Multiple Files and Directories:

You can provide multiple files and directories as command argument (defaults to PWD) and all will be displayed accordingly.

Installation

Prerequisites

In-order to get milk-ls working properly, you need the following:

  • UTF-8: A terminal that is UTF-8 encoded (can display Unicode-Code point).
  • True Color Support: A terminal that can display color. For more info on colors in the terminal, see here.
  • Patched Nerd Font: A patched Nerd font is required to display these icons on-screen. Basically, you'll either download a pre-patched font or patch a font yourself by taking the current font and replacing the last few unicode points (approx 2,824 out of 143,859) with nerdy icons 🤓. The complete patching process is given here

Source

It's just as simple to build this tool from source. You should have Golang installed on your system.

Step 1:

Clone this repository.

$ git clone https://git.tcp.direct/milky/milk-ls.git

Step 2:

cd into the directory milk-ls. Then run go mod tidy to download the dependencies, after that run go build to build your system specific binary in the current directory.

$ cd milk-ls
$ go mod tidy
$ go build

Step 3:

Place the milk-ls executable binary in a reachable directory (within the$PATH env variable). For me, I'd choose relocate it to either $GOPATH/bin or /usr/bin.

$ sudo cp milk-ls /usr/bin

Recommendation

Personally, I have only one alias in ~/.bashrc that does the trick for me.

alias ls="milk-ls -A"