From 18ca34744d6d35993550c2f0887de8cdcedfa6e9 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Thu, 14 Nov 2019 16:09:31 -0800 Subject: [PATCH] zsh: Split ls colors by OS --- darwin.conf.yaml | 3 +++ linux.conf.yaml | 2 ++ zsh/.gitignore | 1 + zsh/.zshrc | 9 ++++++--- zsh/aliases | 1 - zsh/darwin.zshrc | 4 ++++ zsh/linux.zshrc | 1 + 7 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 linux.conf.yaml create mode 100644 zsh/darwin.zshrc diff --git a/darwin.conf.yaml b/darwin.conf.yaml index d460f91..b30156d 100644 --- a/darwin.conf.yaml +++ b/darwin.conf.yaml @@ -1,3 +1,6 @@ - shell: - comm -13 <(brew list) brew/formulae | xargs brew install - comm -13 <(brew cask list) brew/casks | xargs brew cask install + +- link: + ~/.config/zsh/os.zshrc: zsh/darwin.zshrc diff --git a/linux.conf.yaml b/linux.conf.yaml new file mode 100644 index 0000000..3e5c801 --- /dev/null +++ b/linux.conf.yaml @@ -0,0 +1,2 @@ +- link: + ~/.config/zsh/os.zshrc: zsh/linux.zshrc diff --git a/zsh/.gitignore b/zsh/.gitignore index b9fd690..347e95a 100644 --- a/zsh/.gitignore +++ b/zsh/.gitignore @@ -1 +1,2 @@ histfile +os.zshrc diff --git a/zsh/.zshrc b/zsh/.zshrc index fb86d1a..a362d13 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Lines configured by zsh-newuser-install HISTFILE=~/.config/zsh/histfile HISTSIZE=1000000 @@ -85,12 +87,13 @@ function precmd () { source $HOME/.config/zsh/j.sh -# ls colors -eval $(dircolors $HOME/.config/zsh/dircolors.256dark) - autoload -U select-word-style select-word-style bash which direnv > /dev/null && eval "$(direnv hook zsh)" || true setopt interactivecomments + +if [ -f "$HOME/.config/zsh/os.zshrc" ]; then + source "$HOME/.config/zsh/os.zshrc" +fi diff --git a/zsh/aliases b/zsh/aliases index 8a56843..b59cc05 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -2,7 +2,6 @@ alias startx='ssh-agent startx; vlock' -alias ls='ls --color=auto' alias l='ls' alias la='ls -A' alias ll='ls -l' diff --git a/zsh/darwin.zshrc b/zsh/darwin.zshrc new file mode 100644 index 0000000..42a46f8 --- /dev/null +++ b/zsh/darwin.zshrc @@ -0,0 +1,4 @@ +#!/usr/bin/env zsh + +alias ls='ls -G' +export LSCOLORS='Exgxbxdxcxegedabagacad' diff --git a/zsh/linux.zshrc b/zsh/linux.zshrc index 2a01130..1cafecd 100644 --- a/zsh/linux.zshrc +++ b/zsh/linux.zshrc @@ -1,3 +1,4 @@ #!/usr/bin/env zsh +alias ls='ls --color=auto' export LS_COLORS='no=38;5;244:rs=0:di=38;5;33:ln=38;5;37:mh=00:pi=48;5;230;38;5;136;01:so=48;5;230;38;5;136;01:do=48;5;230;38;5;136;01:bd=48;5;230;38;5;244;01:cd=48;5;230;38;5;244;01:or=48;5;235;38;5;160:su=48;5;160;38;5;230:sg=48;5;136;38;5;230:ca=30;41:tw=48;5;64;38;5;230:ow=48;5;235;38;5;33:st=48;5;33;38;5;230:ex=38;5;64:*.tar=38;5;61:*.tgz=38;5;61:*.arj=38;5;61:*.taz=38;5;61:*.lzh=38;5;61:*.lzma=38;5;61:*.tlz=38;5;61:*.txz=38;5;61:*.zip=38;5;61:*.z=38;5;61:*.Z=38;5;61:*.dz=38;5;61:*.gz=38;5;61:*.lz=38;5;61:*.xz=38;5;61:*.bz2=38;5;61:*.bz=38;5;61:*.tbz=38;5;61:*.tbz2=38;5;61:*.tz=38;5;61:*.deb=38;5;61:*.rpm=38;5;61:*.jar=38;5;61:*.rar=38;5;61:*.ace=38;5;61:*.zoo=38;5;61:*.cpio=38;5;61:*.7z=38;5;61:*.rz=38;5;61:*.apk=38;5;61:*.gem=38;5;61:*.jpg=38;5;136:*.JPG=38;5;136:*.jpeg=38;5;136:*.gif=38;5;136:*.bmp=38;5;136:*.pbm=38;5;136:*.pgm=38;5;136:*.ppm=38;5;136:*.tga=38;5;136:*.xbm=38;5;136:*.xpm=38;5;136:*.tif=38;5;136:*.tiff=38;5;136:*.png=38;5;136:*.svg=38;5;136:*.svgz=38;5;136:*.mng=38;5;136:*.pcx=38;5;136:*.dl=38;5;136:*.xcf=38;5;136:*.xwd=38;5;136:*.yuv=38;5;136:*.cgm=38;5;136:*.emf=38;5;136:*.eps=38;5;136:*.CR2=38;5;136:*.ico=38;5;136:*.tex=38;5;245:*.rdf=38;5;245:*.owl=38;5;245:*.n3=38;5;245:*.ttl=38;5;245:*.nt=38;5;245:*.torrent=38;5;245:*.xml=38;5;245:*Makefile=38;5;245:*Rakefile=38;5;245:*build.xml=38;5;245:*rc=38;5;245:*1=38;5;245:*.nfo=38;5;245:*README=38;5;245:*README.txt=38;5;245:*readme.txt=38;5;245:*.md=38;5;245:*README.markdown=38;5;245:*.ini=38;5;245:*.yml=38;5;245:*.cfg=38;5;245:*.conf=38;5;245:*.c=38;5;245:*.cpp=38;5;245:*.cc=38;5;245:*.log=38;5;240:*.bak=38;5;240:*.aux=38;5;240:*.lof=38;5;240:*.lol=38;5;240:*.lot=38;5;240:*.out=38;5;240:*.toc=38;5;240:*.bbl=38;5;240:*.blg=38;5;240:*~=38;5;240:*#=38;5;240:*.part=38;5;240:*.incomplete=38;5;240:*.swp=38;5;240:*.tmp=38;5;240:*.temp=38;5;240:*.o=38;5;240:*.pyc=38;5;240:*.class=38;5;240:*.cache=38;5;240:*.aac=38;5;166:*.au=38;5;166:*.flac=38;5;166:*.mid=38;5;166:*.midi=38;5;166:*.mka=38;5;166:*.mp3=38;5;166:*.mpc=38;5;166:*.ogg=38;5;166:*.ra=38;5;166:*.wav=38;5;166:*.m4a=38;5;166:*.axa=38;5;166:*.oga=38;5;166:*.spx=38;5;166:*.xspf=38;5;166:*.mov=38;5;166:*.mpg=38;5;166:*.mpeg=38;5;166:*.m2v=38;5;166:*.mkv=38;5;166:*.ogm=38;5;166:*.mp4=38;5;166:*.m4v=38;5;166:*.mp4v=38;5;166:*.vob=38;5;166:*.qt=38;5;166:*.nuv=38;5;166:*.wmv=38;5;166:*.asf=38;5;166:*.rm=38;5;166:*.rmvb=38;5;166:*.flc=38;5;166:*.avi=38;5;166:*.fli=38;5;166:*.flv=38;5;166:*.gl=38;5;166:*.m2ts=38;5;166:*.divx=38;5;166:*.webm=38;5;166:*.axv=38;5;166:*.anx=38;5;166:*.ogv=38;5;166:*.ogx=38;5;166:'