fix zshrc a little

This commit is contained in:
Piotr Domański 2024-07-15 20:58:29 +02:00
parent ce236b9262
commit 549f15f7d8
6 changed files with 13 additions and 21 deletions

View file

@ -1,5 +1,5 @@
# docker # docker
if [ -x "$(which docker)" ]; then if type docker &>/dev/null; then
alias dc='docker compose' alias dc='docker compose'
alias killdocker='docker kill $(docker ps -q)' alias killdocker='docker kill $(docker ps -q)'

View file

@ -1,5 +1,5 @@
# pacman and yay # pacman and yay
if [ -x "$(which pacman)" ]; then if type pacman &>/dev/null; then
alias spa='sudo pacman -S' alias spa='sudo pacman -S'
alias spaa='sudo pacman -S --overwrite="*"' alias spaa='sudo pacman -S --overwrite="*"'
alias spu='sudo pacman -Syyuu' alias spu='sudo pacman -Syyuu'
@ -7,7 +7,7 @@ if [ -x "$(which pacman)" ]; then
alias spr='sudo pacman -R' alias spr='sudo pacman -R'
fi fi
if [ -x "$(which yay)" ]; then if type yay &>/dev/null; then
alias ys='yay -S' alias ys='yay -S'
alias yss='yay -S --overwrite="*"' alias yss='yay -S --overwrite="*"'
alias yr='yay -R' alias yr='yay -R'
@ -15,7 +15,7 @@ if [ -x "$(which yay)" ]; then
fi fi
# brew # brew
if [ -x "$(which pacman)" ]; then if type brew &>/dev/null; then
alias bu='brew update && brew update --cask' alias bu='brew update && brew update --cask'
alias bup='brew upgrade && brew upgrade --cask' alias bup='brew upgrade && brew upgrade --cask'
alias bd='brew doctor' alias bd='brew doctor'

View file

@ -11,7 +11,7 @@ alias e='exit'
alias grep='grep --color=auto' alias grep='grep --color=auto'
# ls # ls
if [ -x "$(which exa)" ]; then if type exa &>/dev/null; then
alias ls='exa --icons -g' alias ls='exa --icons -g'
lst() { exa --no-icons --sort=time | head --lines=1; } lst() { exa --no-icons --sort=time | head --lines=1; }
fi fi
@ -29,7 +29,7 @@ alias pip='python3 -m pip'
alias ipy='ipython --TerminalInteractiveShell.editing_mode=vi --TerminalInteractiveShell.timeoutlen=0.2' alias ipy='ipython --TerminalInteractiveShell.editing_mode=vi --TerminalInteractiveShell.timeoutlen=0.2'
# vim # vim
if [ -x "$(which nvim)" ]; then if type nvim &>/dev/null; then
alias vim='nvim' alias vim='nvim'
fi fi
alias v='vim' alias v='vim'

View file

@ -1,5 +1,5 @@
# fzf settings # fzf settings
if [ ! -z "$(which fzf 2>/dev/null)" ]; then if type fzf &>/dev/null; then
export FZF_DEFAULT_OPTS="--reverse --bind change:first --bind ctrl-j:down,ctrl-k:up -i --cycle --header-first --border rounded" export FZF_DEFAULT_OPTS="--reverse --bind change:first --bind ctrl-j:down,ctrl-k:up -i --cycle --header-first --border rounded"
source <(fzf --zsh) source <(fzf --zsh)
fi fi

View file

@ -1,5 +1,5 @@
# run neofetch or tmux if available # run neofetch or tmux if available
if [ ! -z "$(which tmux 2>/dev/null)" ]; then if type tmux &>/dev/null; then
if [ ! -n "$TMUX" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then if [ ! -n "$TMUX" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
exec tmux exec tmux
fi fi

18
.zshrc
View file

@ -70,9 +70,10 @@ setopt HIST_IGNORE_ALL_DUPS
setopt INC_APPEND_HISTORY setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY setopt SHARE_HISTORY
# Basic auto/tab complete: # load brew specific thinys
if type brew &>/dev/null; then if type brew &>/dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi fi
autoload -Uz compinit autoload -Uz compinit
@ -192,8 +193,8 @@ bindkey '^R' history-incremental-search-backward
bindkey '\eOH' beginning-of-line bindkey '\eOH' beginning-of-line
bindkey '\eOF' end-of-line bindkey '\eOF' end-of-line
# IMPORTA # editor
if [ ! -z "$(which nvim 2>/dev/null)" ]; then if type nvim &>/dev/null; then
export EDITOR=nvim export EDITOR=nvim
else else
export EDITOR=vim export EDITOR=vim
@ -208,16 +209,7 @@ bindkey '^ ' autosuggest-accept
bindkey '^l' autosuggest-accept bindkey '^l' autosuggest-accept
# exports - local bin, python, brew # exports - local bin, python, brew
export PATH="$HOME/.local/bin:$HOME/.bin:/Users/$USER/Library/Python/3.9/bin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/opt/homebrew/sbin:$HOME/.cargo/bin:$PATH" export PATH="$HOME/.local/bin:$HOME/.bin:$HOME/.cargo/bin:${HOME}/go/bin/:/opt/homebrew/bin:$PATH:$PATH"
# mysql client on macos
export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"
export PATH="/opt/homebrew/opt/dotnet@6/bin:$PATH"
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
export PATH="${HOME}/go/bin/:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
# Load aliases and shortcuts if existent. # Load aliases and shortcuts if existent.
if [ -d "$HOME/.config/aliasrc" ]; then if [ -d "$HOME/.config/aliasrc" ]; then