dotfiles/.zshrc

127 lines
4.0 KiB
Bash
Raw Normal View History

2021-04-27 23:25:21 +03:00
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
2017-04-22 16:53:37 +03:00
# The following lines were added by compinstall
zstyle :compinstall filename '/home/lanxu/.zshrc'
autoload -U compinit promptinit colors
compinit
promptinit
colors
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt notify
# Ignore lines prefixed with '#'.
setopt interactivecomments
# Ignore duplicate in history.
setopt hist_ignore_dups
# Prevent record in history entry if preceding them with at least one space
setopt hist_ignore_space
# This will set the default prompt to the walters theme
#prompt grml
# You may need to manually set your language environment
export LANG=fi_FI.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='vim'
fi
# Syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zplugins
# Autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
2017-04-22 16:53:37 +03:00
alias top=htop
2021-04-27 23:25:21 +03:00
alias ll="exa -lh"
alias la="exa -a"
alias lp="keepass.sh"
alias ranger="ranger"
2022-09-10 16:13:56 +03:00
alias vim="nvim"
alias vimdiff="nvim -d"
2021-04-27 23:25:21 +03:00
#alias lf="TCELL_TRUECOLOR=on lf"
2017-12-17 15:33:10 +02:00
alias search="search.sh"
2017-04-22 16:53:37 +03:00
#alias ls="ls -N --time-style=long-iso --color=auto"
2021-04-27 23:25:21 +03:00
#alias ls="ls --time-style=long-iso --color=auto --human-readable --group-directories-first --classify"
2017-04-22 16:53:37 +03:00
alias rhc='RUBYOPT="-W0" rhc'
# Other
alias fixsteam='find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete'
alias runsteam="LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so' /usr/bin/steam"
alias steamgamesdir='cd ~/.local/share/Steam/SteamApps/common'
alias emsdksetup='source $EMSDK/emsdk_env.sh'
alias runwinesteam="MESA_GL_VERSION_OVERRIDE=3.3COMPAT PULSE_LATENCY_MSEC=60 run-desktop.py ~/.local/share/applications/wine/Programs/Steam/Steam.desktop"
2019-03-23 17:28:58 +02:00
alias rbackup="restic -r rclone:hubic:ChimeraLinux"
2019-10-30 20:41:58 +02:00
alias bat="bat --theme base16"
alias wine32="WINEPREFIX=~/.wine32 wine"
alias resetkbcolors="/usr/bin/g512-led -p /etc/g810-led/profile"
2022-09-10 16:13:56 +03:00
alias showerrors="journalctl -p 3 -xb"
alias browsephone="mount-phone | xargs -I % lf %"
# alias steam="DBUS_SESSION_BUS_ADDRESS=unix:abstract=/dev/null steam"
2017-04-22 16:53:37 +03:00
# https://github.com/chriskempson/base16-shell
# git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
2021-04-27 23:25:21 +03:00
# source $HOME/.config/base16-shell/scripts/base16-default-dark.sh
# source $HOME/.config/base16-shell/scripts/base16-solarized-light.sh
# source $HOME/.config/base16-shell/scripts/base16-solarized-dark.sh
2017-04-22 16:53:37 +03:00
# Emscripten
#source /home/lanxu/Koodit/github/emsdk/emsdk_env.sh
2019-09-01 14:40:03 +03:00
#TERM=xterm-256color
#bindkey "${terminfo[khome]}" beginning-of-line
#bindkey "${terminfo[kend]}" end-of-line
2019-06-09 17:14:30 +03:00
function auradd {
pkg=$1
2022-09-10 16:13:56 +03:00
aur sync --no-view --no-confirm --rebuild --database localrepo "$pkg" >&2 && sudo pacman -Sy "$pkg"
2019-06-09 17:14:30 +03:00
}
function aurrm {
pkg=$1
2021-08-28 20:15:49 +03:00
rm_out=$(repo-remove /var/cache/pacman/localrepo/localrepo.db.tar.gz "$pkg" 2>&1)
2019-06-09 17:14:30 +03:00
if [[ $rm_out = *"ERROR"* ]]; then
echo "not found" >&2
else
2021-08-28 20:15:49 +03:00
rm -rf /var/cache/pacman/localrepo/"$pkg"*.pkg.* || true
2019-06-09 17:14:30 +03:00
echo "$pkg removed"
fi
sudo pacman -Sy
sudo pacman -Rnc "$pkg"
}
function aurupdate {
2021-08-28 20:15:49 +03:00
aur sync --no-view --no-confirm --database localrepo -u
2019-06-09 17:14:30 +03:00
sudo pacman -Syu
}
2022-09-10 16:13:56 +03:00
function aurclear {
find ~/.cache/aurutils/sync -type d -name .git -execdir git clean -xf \;
}
2019-09-01 14:40:03 +03:00
function c {
echo "scale=2; $@" | bc
}
2019-06-09 17:14:30 +03:00
function aurls {
2021-08-28 20:15:49 +03:00
sudo pacman -Sl localrepo
2019-06-09 17:14:30 +03:00
}
2021-04-27 23:25:21 +03:00
#source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
#[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh