Hacker News new | ask | show | jobs
by devnullbrain 1022 days ago
There's a hint of a belief in this thread - common also in threads about alternative shells and Vim setups - that someone who uses a tool like this will irrevocably lose the knowledge of how to use ls.

Am I perhaps a genius or is it just not that difficult to know two tools?

4 comments

Most people don't type `ls` directly either. Aliases like `l`, `ll` and `la` are very common, in which case it really doesn't matter which tool you're using.

I've been using `exa` for years, and my aliases work regardless if it's installed or not. I just get a better UX if it is.

> Most people don't type `ls` directly either. Aliases like `l`, `ll` and `la` are very common, in which case it really doesn't matter which tool you're using.

Huh. I always use plain ls with flags and deliberately unset aliases like ll.

I guess I'm weird.

You're not alone, is saving one character worth losing the muscle-memory?
It's hardly one character. I never need the plain output of `ls` in interactive sessions.

Here are my aliases:

    if type exa >/dev/null 2>&1; then
        alias l='exa -alg --color=always --group-directories-first --git'
        alias ll='exa -aliSgh --color=always --group-directories-first --git'
        alias lt='exa -@alT --color=always --git'
        alias lr='exa -alg --sort=modified --color=always --group-directories-first --git'
    else
        alias l='ls -alh --group-directories-first'
        alias ll='ls -al --group-directories-first'
        alias lr='ls -ltrh --group-directories-first'
    fi
I still retain `ls -ltrh` in my muscle memory, but after years of typing it, `lr` has saved me a lot of time and effort.

Aliases are not just a way to type less. They also serve as a way to define configuration. If I ever need to tweak the output for all my usage of `ls`, I can just add it to all aliases, as I've done for `--group-directories-first`.

I like ll a lot for ls -ahlF, but I do run into its absence a lot on a remote machine. At that point, I'll just set the alias though.
I had the same thought.

The “inertial hump,” the learning curve, is going to be like 30 minutes, if you take 15 of those minutes to eat a sandwich.

If you want to reduce it even more, do this:

1. Install new tool.

2. In your .bashrc define some flag combinations that make it even more like your use of old tool, with similar-sounding aliases or even ones commonly used for old tool.

3. Now in the unlikely scenario that new tool goes away, you’ll still be current w old tool from those lookalike commands.

The problem is not ls. You use hundreds, thousands of commands, tools, programs, libraries every day, today is exa, tomorrow could be a different one, and then a different one. In 5 years you update your linux distribution and exa stop working, but it is not maintained anymore so there will be no fix, and then you curse yourself for building all your scripts using exa and having to update then. The probability for each individual tool in negligible, but it is multiplied by every new one you use.
Flipping tools has a cost because we have to think more about it. I don't know if you've tried flipping between the windows commandline and bash several times a day but it can be quite annoying just with things like "\" compared to "/" where the automatic part of your brain cannot take over for you and you have to do everything consciously.
I switch between WSL/Powershell, US/UK keyboard layouts and Ubuntu/Windows/Mac shortcuts frequently. It only usually takes one mistake to context switch. It usually harder for me to switch to things I use infrequently - but they also matter less.

> "\" compared to "/"

Powershell :)