Tags
linux
Created
Sep 24, 2018 4:02 PM
warp
gitui
https://remysharp.com/2018/08/23/cli-improved
bat > cat
prettyping > ping
fzf > ctrl+r, 选择文件
htop > top // btm https://github.com/ClementTsang/bottom
diff-so-fancy/delta > diff
fd > find
exa > ls
ncdu > du
tldr > man
ack || ag > grep
jq > grep et al
export PATH="$HOME/flutter/bin:$PATH"
export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
export CARGO_UNSTABLE_SPARSE_REGISTRY=true
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.mongodb/bin:$PATH"
export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
# cli improved
# alias cat='bat'
# alias top='htop'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
alias preview="fzf --preview 'bat --color \"always\" {}'"
export FZF_CTRL_T_COMMAND='fd --type f --exclude node_modules'
export FZF_CTRL_T_OPTS="--preview 'bat --color \"always\" {}'"
# add support for ctrl+o to open selected file in VS Code
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
# proxy list
alias proxy='export all_proxy=http://127.0.0.1:8001'
alias unproxy='unset all_proxy'
alias l='ls -alhF'
alias la='ls -AFh'
# alias ll='ls -lhAF'
alias ll='exa -lhFabgHiS'
alias stat="stat -x"
alias ios-simulator="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"
alias android-simulator="emulator"
# http2 debugger
export SSLKEYLOGFILE=~/tls/sslkeylog.log
# jsvu
export PATH="${HOME}/.jsvu:${PATH}"
# v8
export PATH="$HOME/depot_tools:$PATH"
alias d8=~/v8/out.gn/x64.optdebug/d8
alias tick-processor=~/v8/tools/mac-tick-processor
export D8_PATH="~/v8/out.gn/x64.optdebug"
# Wasmer
export WASMER_DIR="/Users/mantou/.wasmer"
[ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# https://github.com/nvm-sh/nvm?tab=readme-ov-file#zsh
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc