shell: zsh -> fish

This commit is contained in:
mequidis
2023-03-29 21:15:01 +03:00
parent 8413232281
commit 5e211629a0
21 changed files with 75 additions and 120 deletions

11
.config/fish/config.fish Normal file
View File

@ -0,0 +1,11 @@
set fish_greeting
fish_add_path $HOME/.local/bin:$PATH
fish_add_path $HOME/.local/share/cargo/bin:$PATH
fish_add_path $HOME/.local/share/go/bin:$PATH
fish_add_path $HOME/.local/share/npm/bin:$PATH
fish_add_path $HOME/tools/nvim:$PATH
fish_add_path $HOME/.config/scripts/applications:$PATH
fish_add_path $HOME/.config/scripts/util:$PATH
fish_add_path xterm # for ssh
set EDITOR nvim

View File

@ -0,0 +1,4 @@
function .... --wraps='cd ../../..' --description 'alias ....=cd ../../..'
cd ../../.. $argv
end

View File

@ -0,0 +1,4 @@
function ... --wraps='cd ../..' --description 'alias ...=cd ../..'
cd ../.. $argv
end

View File

@ -0,0 +1,4 @@
function .. --description 'alias ..=cd ..'
cd .. $argv
end

View File

@ -0,0 +1,4 @@
function c --wraps=clear --description 'alias c=clear'
clear $argv
end

View File

@ -0,0 +1,4 @@
function cl --wraps='clear && ls' --description 'alias cl=clear && ls'
clear && ls $argv
end

View File

@ -0,0 +1,4 @@
function cll --wraps='clear && ls -lah' --description 'alias cll=clear && ls -lah'
clear && ls -lah $argv
end

View File

@ -0,0 +1,4 @@
function dots --wraps='/usr/bin/git --git-dir=$HOME/docs/git/dotfiles.git --work-tree=$HOME' --description 'alias dots=/usr/bin/git --git-dir=$HOME/docs/git/dotfiles.git --work-tree=$HOME'
/usr/bin/git --git-dir=$HOME/docs/git/dotfiles.git --work-tree=$HOME $argv
end

View File

@ -0,0 +1,4 @@
function fzfcd --wraps='source ~/.config/scripts/util/cdfzf' --description 'alias fzfcd=source ~/.config/scripts/util/cdfzf'
source ~/.config/scripts/util/cdfzf $argv
end

View File

@ -0,0 +1,4 @@
function grep --description 'alias grep=grep --color=auto'
command grep --color=auto $argv
end

View File

@ -0,0 +1,4 @@
function hc --wraps=herbstclient --description 'alias hc=herbstclient'
herbstclient $argv
end

View File

@ -0,0 +1,4 @@
function ll --wraps='ls -lah' --description 'alias ll=ls -lah'
ls -lah $argv
end

View File

@ -0,0 +1,4 @@
function n --wraps=nvim --description 'alias n=nvim'
nvim $argv
end

View File

@ -0,0 +1,4 @@
function oomox-wal --wraps='oomox-cli -o wal -t ~/.local/share/themes ~/.cache/wal/colors-oomox' --description 'alias oomox-wal=oomox-cli -o wal -t ~/.local/share/themes ~/.cache/wal/colors-oomox'
oomox-cli -o wal -t ~/.local/share/themes ~/.cache/wal/colors-oomox $argv
end

View File

@ -0,0 +1,4 @@
function pm --wraps=pulsemixer --description 'alias pm=pulsemixer'
pulsemixer $argv
end

View File

@ -0,0 +1,4 @@
function py --wraps=python --description 'alias py=python'
python $argv
end

View File

@ -0,0 +1,4 @@
function yeet --wraps='pikaur -Rsn' --description 'alias yeet=pikaur -Rsn'
pikaur -Rsn $argv
end

View File

@ -1 +0,0 @@
source $ZDOTDIR/zshrc

View File

@ -1,38 +0,0 @@
#!/bin/zsh
# time savers
alias rezsh="source ~/.config/zsh/zshrc"
alias xclipboard="xclip -selection clipboard"
alias dots='/usr/bin/git --git-dir=$HOME/docs/git/dotfiles.git --work-tree=$HOME'
alias cdto='source ~/.config/scripts/util/cdto'
alias fzfcd='source ~/.config/scripts/util/cdfzf'
alias oomox-wal='oomox-cli -o wal -t ~/.local/share/themes ~/.cache/wal/colors-oomox'
mpvyt() {mpv https://youtu.be/$1}
mc() {mkdir -p $1 && cd $1}
chtsh() {curl cht.sh/$1}
# applications
alias n="nvim"
alias c="clear"
alias p="pikaur"
alias nq="nvim-qt"
alias py="python"
alias hc="herbstclient"
alias pm="pulsemixer"
# flags
# alias cp="cp -i -r"
# alias mv="mv -i"
# alias rm="rm -Ir"
alias ll="ls -lah"
alias cl="clear && ls"
alias cll="clear && ls -lah"
alias grep="grep --color=auto"
# cd ..
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
# I actually use this one
alias yeet="pikaur -Rsn"

View File

@ -1,38 +0,0 @@
# prompt
autoload -U colors && colors
PS1="%B%{$fg[cyan]%}%n%{$reset_color%}@%M %~ $%b "
# vi mode
bindkey -v
# history config
HISTFILE=$XDG_CACHE_HOME/zsh/histfile
HISTSIZE=5000
SAVEHIST=5000
setopt histignorespace
# history search
autoload -U history-search-end
autoload -Uz compinit && compinit
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
#
# paths & variables
#
export PATH=$HOME/.local/bin:$PATH
export PATH=$HOME/.local/share/cargo/bin:$PATH
export PATH=$HOME/.local/share/go/bin:$PATH
export PATH=$HOME/.local/share/npm/bin:$PATH
export PATH=$HOME/tools/nvim:$PATH
export PATH=$HOME/.config/scripts/applications:$PATH
export PATH=$HOME/.config/scripts/util:$PATH
export TERM=xterm # for ssh
export EDITOR=nvim
# sources
source $ZDOTDIR/aliases
source $XDG_DATA_HOME/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

43
.zshenv
View File

@ -1,43 +0,0 @@
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export ZDOTDIR=$XDG_CONFIG_HOME/zsh
# cleanup
export ANDROID_HOME="$XDG_DATA_HOME"/android
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
export GDBHISTFILE="$XDG_DATA_HOME"/gdb/history
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export GOPATH="$XDG_DATA_HOME"/go
export ICEAUTHORITY="$XDG_CACHE_HOME"/ICEauthority
export IPYTHONDIR="$XDG_CONFIG_HOME"/ipython
export LESSHISTFILE=-
export MYPY_CACHE_DIR="$XDG_CACHE_HOME"/mypy
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
export SQLITE_HISTORY="$XDG_CACHE_HOME"/sqlite_history
export UNCRUSTIFY_CONFIG="$XDG_CONFIG_HOME"/uncrustify/uncrustify.cfg
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
# wine prefix
export WINEPREFIX="$XDG_DATA_HOME/wine/"
# kvantum
export QT_STYLE_OVERRIDE=kvantum
# use nvim for stuff
export EDITOR=nvim
export MANPAGER=nvimpager
[ ! -d "$XDG_CACHE_HOME/zsh/" ] && mkdir -p $XDG_CACHE_HOME/zsh
[ ! -d "$XDG_DATA_HOME/zsh/" ] && mkdir -p $XDG_DATA_HOME/zsh
[ ! -d "$XDG_CONFIG_HOME/zsh/zshrc" ] && source "$XDG_CONFIG_HOME/zsh/zshrc"
if [ ! -d "$XDG_DATA_HOME/zsh/zsh-syntax-highlighting" ]; then
cd $XDG_DATA_HOME/zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
cd
fi