Skip to content

Commit

Permalink
feat: use lsd instead of eza
Browse files Browse the repository at this point in the history
add install_brew
update install_arch
  • Loading branch information
seagle0128 committed Dec 27, 2023
1 parent 60c2009 commit 9d357b6
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 112 deletions.
37 changes: 8 additions & 29 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ fi
# Modern Unix commands
# See https://github.com/ibraheemdev/modern-unix
zinit wait as"null" lucid from"gh-r" for \
atload"alias ls='eza --color=auto --group-directories-first'; alias la='ls -laFh'" sbin"**/eza" if'[[ $OSTYPE != darwin* ]]' eza-community/eza \
atload"alias cat='bat -p --wrap character'" cp"**/bat.1 -> $ZPFX/share/man/man1" mv"**/autocomplete/bat.zsh -> _bat" completions sbin"**/bat" @sharkdp/bat \
cp"**/fd.1 -> $ZPFX/share/man/man1" completions sbin"**/fd" @sharkdp/fd \
cp"**/hyperfine.1 -> $ZPFX/share/man/man1" completions sbin"**/hyperfine" @sharkdp/hyperfine \
cp"**/doc/rg.1 -> $ZPFX/share/man/man1" completions sbin"**/rg" BurntSushi/ripgrep \
atload"alias ls='eza --color=auto --icons --group-directories-first'; alias la='ls -laFh'; alias tree='ls --tree'" sbin"**/eza" if'[[ $OSTYPE != darwin* ]]' eza-community/eza \
atload"alias ls='lsd --group-directories-first'; alias la='ls -laFh'; alias tree='ls --tree'" cp"**/lsd.1 -> $ZPFX/share/man/man1" completions"**/_lsd" sbin"**/lsd" lsd-rs/lsd \
atload"alias cat='bat -p --wrap character'" cp"**/bat.1 -> $ZPFX/share/man/man1" mv"**/bat.zsh -> _bat" completions sbin"**/bat" @sharkdp/bat \
atload"alias find=fd" cp"**/fd.1 -> $ZPFX/share/man/man1" completions sbin"**/fd" @sharkdp/fd \
atload"alias top=btm" completions sbin"**/btm" ClementTsang/bottom \
atload"alias grep=rg" cp"**/doc/rg.1 -> $ZPFX/share/man/man1" completions sbin"**/rg" BurntSushi/ripgrep \
atload"alias help=tldr" mv"tealdeer* -> tldr" dl'https://github.com/dbrgn/tealdeer/releases/latest/download/completions_zsh -> _tldr;' completions sbin"tldr" dbrgn/tealdeer \
atload"alias diff=delta" sbin"**/delta" dandavison/delta \
atload"alias df=duf" bpick"*(.zip|tar.gz)" sbin muesli/duf \
atload"alias du=dust" sbin"**/dust" bootandy/dust \
atload"alias sed=sd" completions"**/_sd" sbin"**/sd" chmln/sd \
atload"alias ping=gping" sbin"**/gping" orf/gping \
cp"**/hyperfine.1 -> $ZPFX/share/man/man1" completions sbin"**/hyperfine" @sharkdp/hyperfine \
bpick"*.zip" sbin"**/procs" if'(( $+commands[unzip] )) && [[ $CPUTYPE != aarch* ]]' dalance/procs

# FZF: fuzzy finderls
Expand Down Expand Up @@ -276,29 +278,6 @@ fi
alias ls='eza --color=auto --group-directories-first'; alias la='ls -laFh'
fi

# Ugrep
if (( $+commands[ugrep] )) ; then
alias uq='ug -Q' # short & quick query TUI (interactive, uses .ugrep config)
alias ux='ug -UX' # short & quick binary pattern search (uses .ugrep config)
alias uz='ug -z' # short & quick compressed files and archives search (uses .ugrep config)

alias ugit='ug -R --ignore-files' # works like git-grep & define your preferences in .ugrep config

alias grep='ugrep -G' # search with basic regular expressions (BRE)
alias egrep='ugrep -E' # search with extended regular expressions (ERE)
alias fgrep='ugrep -F' # find string(s)
alias pgrep='ugrep -P' # search with Perl regular expressions
alias xgrep='ugrep -W' # search (ERE) and output text or hex for binary

alias zgrep='ugrep -zG' # search compressed files and archives with BRE
alias zegrep='ugrep -zE' # search compressed files and archives with ERE
alias zfgrep='ugrep -zF' # find string(s) in compressed files and/or archives
alias zpgrep='ugrep -zP' # search compressed files and archives with Perl regular expressions
alias zxgrep='ugrep -zW' # search (ERE) compressed files/archives and output text or hex for binary

alias xdump='ugrep -X ""' # hexdump files without searching
fi

# Git
alias gtr='git tag -d $(git tag) && git fetch --tags' # Refresh local tags from remote

Expand All @@ -316,7 +295,7 @@ fi
alias upgrade_dotfiles='cd $DOTFILES && upgrade_repo; cd - >/dev/null'
alias upgrade_emacs='emacs -Q --batch -L "$EMACSD/lisp/" -l "init-package.el" --eval "(progn (package-initialize) (update-config-and-packages t t))"'
alias upgrade_omt='cd $HOME/.tmux && upgrade_repo; cd - >/dev/null'
alias upgrade_zinit='zinit self-update && zinit update -a -p'
alias upgrade_zinit='zinit self-update && zinit update -a -p && zinit compinit'
alias upgrade_env='upgrade_dotfiles; sh $DOTFILES/install.sh'

(( $+commands[cargo] )) && alias upgrade_cargo='cargo install-update -a' # cargo install cargo-update
Expand Down
3 changes: 2 additions & 1 deletion Microsoft.PowerShell_profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ Set-Alias -Name te -Value Open-Terminal-Emacs
Remove-Alias diff -Force
Set-Alias -Name cat -Value bat # Use the latest less or --paging=never
Set-Alias -Name du -Value dust
Set-Alias -Name ls -Value lsd
Set-Alias -Name ping -Value gping
Set-Alias -Name top -Value btop

# Git
Import-Module git-aliases -DisableNameChecking

# Icons
Import-Module -Name Terminal-Icons
# Import-Module -Name Terminal-Icons

# Starship
Invoke-Expression (&starship init powershell)
Expand Down
35 changes: 22 additions & 13 deletions install_arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,36 @@

# Packages
packages=(
# git
# zsh
emacs
neofetch # screenfetch
#prerequisite
git
zsh
unzip

# modern tools
bat
bottom
btop
delta
duf
dust
fd
fzf
gitui
gping
hyperfine
neofetch
procs
ripgrep
# shadowsocks-qt5
sd
tealdeer
zoxide

npm
python-pip
rubygems
rubyrdoc
emacs
# npm
# python-pip

# Fonts
adobe-source-code-pro-fonts
powerline-fonts
wqy-bitmapfont
wqy-microhei
wqy-microhei-lite
wqy-zenhei
)

Expand Down
89 changes: 89 additions & 0 deletions install_brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash
#############################################################
# Install macOS via brew cask
# Author: Vincent Zhang <[email protected]>
# URL: https://github.com/seagle0128/dotfiles
#############################################################

# Cask applications
packages=(
# prerequisite
git
zsh
unzip

# modern tools
bat
bottom
btop
delta
duf
dust
fd
fzf
gitui
gping
hyperfine
neofetch
procs
ripgrep
sd
tealdeer
zoxide
)

# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if command -v tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi

function check {
# Check OS
if [[ $OSTYPE != darwin* ]]; then
echo "${RED}Error: only install software via brew on macOS.${NORMAL}" >&2
exit 1
fi

# Check brew
if ! command -v brew >/dev/null 2>&1; then
printf "${BLUE} ➜ Installing Homebrew...${NORMAL}\n"

xcode-select --install
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"
fi
}

function install () {
for app in ${packages[@]}; do
printf "${BLUE} ➜ Installing ${app}...${NORMAL}\n"
brew install ${app}
done
}

function cleanup {
brew cleanup
}

function main {
check
install
cleanup
}

main
66 changes: 0 additions & 66 deletions install_choco.ps1

This file was deleted.

5 changes: 3 additions & 2 deletions install_scoop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ $packages = (
"7zip", "everything", "totalcommander",
# "aspell", "clipx", "putty", "ccleaner", "fork",
"git", "gitui", "gow", "gsudo", "less",
"bat", "fzf", "fd", "ripgrep", "ugrep",
"btop", "dust", "eza", "gping", "tealdeer",
"bat", "fzf", "fd", "ripgrep",
"btop", "duf", "dust", "eza", "lsd",
"gping", "tealdeer",

# Editor
"emacs", "vscode",
Expand Down
3 changes: 2 additions & 1 deletion install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

# Packages
packages=(
# prerequisite
build-essential
git
zsh
unzip

# sudo add-apt-repository -y ppa:kelleyk/emacs
emacs # emacs-snapshot
# emacs # emacs-snapshot

aspell # hunspell
parcellite # clipit
Expand Down

0 comments on commit 9d357b6

Please sign in to comment.