athityakumar/colorls

please a more compact long format for small terminal

Opened this issue · 2 comments

v6cc commented

Description

I thought colorls more beautify, but for small terminal, have so many space , hope can have compact long format , less space, and allow hide column 2

10-15_20:33:11

You could create functions to check terminal width first, here is from my ~/.zshrc (its ugly code):

#
# Use `colorls` when the terminal is wide enough for it to not suck
#
function laaa () {
    if [[ "$(tput cols)" -lt "100" ]] ; then
        echo "hello"
        ls -al
    else
        colorls -lA --sd --gs
    fi
}
alias la='laaa'

function llll () {
    if [[ "$(tput cols)" -lt "100" ]] ; then
        ls -l
    else
        colorls -l --sd --gs
    fi
}
alias ll='llll'

If colorls allows to configure date format, one can save some space. For exemple :
rw-rw-r-- 1 emmanuel emmanuel 2 KiB 05/04/2022  Makefile
instead of
rw-rw-r-- 1 emmanuel emmanuel 2 KiB Tue Apr 5 10:30:26 2022  Makefile