Skip to content
This repository

[/!\ Traffic] Further `ls` command output improvement #782

Closed
kyrylo opened this Issue · 3 comments

2 participants

Kyrylo Silin ☈king
Kyrylo Silin
Collaborator

Table output for ls is nice, but it's still a pain to find something in a big table. Since table is alphabetically sorted, we can benefit from this quite easily. First of all, we need to change the order of output.

What we currently have.

> ls
#...
Foo.methods:
abcd     abc    ab     a
bcde     bcd    bc     b
cdef     cde    cd     c
#...

What it should look like.

> ls
#...
Foo.methods:
abcd  bc
abc   b
ab    cdef
a     cde
bcde  cd
bcd   c
#...

I think the second output is already better without reservation. But even with this approach we can improve it further!

Secondly, since instance methods are tintless, we can do this:

> ls
#...
Foo.methods:
*a*bcd  bc
abc     b
ab      *c*def
a       cde
*b*cde  cd
bcd     c
#...

It's a bit hard to spot the difference (and moreover the benefit), but believe me, it's a huge improvement. The idea is to highlight every new first letter. You can see something similar in phone books.

**a**bcd abc ab a **b**cde bcd bc b **c**def cde cd c

Methods that start with underscores or other non-letters should not highlight their first character (_, ==, %), because it's already easy to spot them.

Important note
This will work only for instance and class methods. Other enities are already coloured. That's not a big deal, because we can always change this (I have a few ideas).

☈king
Collaborator
Kyrylo Silin
Collaborator

In the end it turned out it's a bad idea. Big up to everyone who contributed their screenshots (by the by, they are clickable)! @jraregris, @ConradIrwin, @banister, @locks, @robgleeson, @rf-, @YorickPeterse and me.

The first version:

The second version:

Kyrylo Silin kyrylo closed this
Kyrylo Silin
Collaborator

The patch used for this change: https://gist.github.com/4527481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.