2024-08-07 03:09:44 +01:00
|
|
|
function vim {
|
|
|
|
if [[ -z "$@" ]]; then
|
|
|
|
if [[ -f "./.session.vim" ]]; then
|
2024-10-05 13:09:10 +01:00
|
|
|
nvim -S .session.vim -c 'lua vim.g.savesession = true'
|
2024-08-07 03:09:44 +01:00
|
|
|
else
|
2024-10-05 13:09:10 +01:00
|
|
|
nvim -c 'lua vim.g.savesession = true'
|
2024-08-07 03:09:44 +01:00
|
|
|
fi
|
|
|
|
else
|
2024-10-05 13:09:10 +01:00
|
|
|
nvim "$@"
|
2024-08-07 03:09:44 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function sourceall(){
|
|
|
|
set -e
|
|
|
|
pids=$(pgrep zsh)
|
|
|
|
while IFS= read -r pid; do
|
|
|
|
kill -USR1 "$pid"
|
|
|
|
done <<< "$pids"
|
|
|
|
set +e
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-09-04 15:32:27 +01:00
|
|
|
function routevpn {
|
|
|
|
sudo route -n add $@ 10.8.0.1
|
2024-08-07 03:09:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
alias ls="eza --icons -l --sort type"
|
|
|
|
alias lg="lazygit"
|
|
|
|
alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav'
|
|
|
|
alias routes="netstat -rn -f inet"
|
2024-09-04 15:34:10 +01:00
|
|
|
|
|
|
|
alias lc='lazygit --work-tree="$HOME" --git-dir="$HOME/dotfiles"'
|
|
|
|
alias config='git --work-tree="$HOME" --git-dir="$HOME/dotfiles"'
|
2024-09-13 00:09:42 +01:00
|
|
|
|
|
|
|
function qmk_flash_right(){
|
|
|
|
echo "Flashing right side, waiting 5 seconds"
|
|
|
|
sleep 5
|
|
|
|
qmk flash -kb lily58 -km afonso -bl avrdude-split-right
|
|
|
|
}
|
|
|
|
|
|
|
|
function qmk_flash_left(){
|
|
|
|
echo "Flashing left side, waiting 5 seconds"
|
|
|
|
sleep 5
|
|
|
|
qmk flash -kb lily58 -km afonso -bl avrdude-split-left
|
|
|
|
}
|
2024-09-23 05:04:43 +01:00
|
|
|
|
|
|
|
alias nvim_update='nvim --headless "+Lazy! sync" +qa'
|