How do I change the colour of directory listings with oh-my-fish?

后端 未结 1 1573
我寻月下人不归
我寻月下人不归 2021-02-01 16:44

I\'ve recently decided to give the fish shell a shot and also started using oh-my-fish. The problem I\'m having is that I can\'t figure out how to change the color of directory

相关标签:
1条回答
  • 2021-02-01 16:54

    You are probably seeing the result of LSCOLORS, which you can look up in the ls man page or Google.

    The reason that you see this with fish and not, say, bash, is that fish wraps ls in a function that passes the -G flag, as you can see:

    > functions ls
    function ls --description 'List contents of directory'
        command ls -G $argv
    end
    

    You can change LSCOLORS to be something else, e.g. on OS X:

    set -Ux LSCOLORS gxfxbEaEBxxEhEhBaDaCaD
    

    That makes a universal environment variable, so you just have to run it once.

    Or you can disable it entirely by overwriting the function:

    function ls ; command ls ; end
    funcsave ls
    

    This creates and saves a function ls that has priority over the bundled one.

    0 讨论(0)
提交回复
热议问题