March 12th Update

This commit is contained in:
Augusto Gunsch
2022-03-12 14:49:08 -03:00
parent af39225ac2
commit 15bfd14bf7
9 changed files with 96 additions and 59 deletions

View File

@@ -34,6 +34,11 @@ alias venv="source venv/bin/activate"
# search functions
alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules"
# pipe yd-dlp to mpv
ytmpv() {
yt-dlp -q -o - "$1" | mpv -
}
goto() {
open="$(grepa "$@" | fzf --ansi -1)"
if [ ! -z "$open" ]; then
@@ -47,5 +52,3 @@ goto() {
# NVM - Dynamic loading trick
alias nvm="unalias nvm && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; nvm"
alias node="unalias node && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; node"
source "$HOME/.swallow"

View File

@@ -1,22 +0,0 @@
#!/bin/sh
MPV=/usr/bin/mpv
mpv() {
EXT=${*##*.}
case "$*" in
*--no-video*)
$MPV $*
;;
*)
case "$EXT" in
ogg|opus|mp3)
$MPV $*
;;
*)
swallow $MPV $*
;;
esac
;;
esac
}

View File

@@ -18,6 +18,8 @@ bindkey -v
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[OA" history-beginning-search-backward-end
bindkey "^[OB" history-beginning-search-forward-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end