From d51563c8f9ccf47e7bc99863beb6ee03ca50f6dc Mon Sep 17 00:00:00 2001 From: juan Date: Wed, 18 Aug 2021 14:04:17 +0800 Subject: [PATCH] Update lf and ncmpcpp lf: added custom open method .zshrc: added fuck implementation and caching ncmpcpp: change tab behaviour --- .config/lf/lfrc | 10 ++++++++++ .config/ncmpcpp/config | 2 +- .zshrc | 22 ++++++++++++++-------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index b63ea89..d5d9ff2 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -5,11 +5,21 @@ set drawbox true set icons true set ignorecase true set info size +# set previewer ~/.config/lf/preview.sh +# set preview true map D push %rm-rf$fs map a push %mkdir map x $$f +# xdg-open +cmd open ${{ + case $(file --mime-type "$f" -bL) in + text/*|application/json) $EDITOR "$f";; + *) xdg-open "$f" ;; + esac +}} + # bulk-rename cmd bulk-rename ${{ old="$(mktemp)" diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 07f92ca..149f82e 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -366,7 +366,7 @@ space_add_mode = add_remove ## media_library, playlist_editor, tag_editor, outputs, visualizer, clock, ## lyrics, last_fm. ## -screen_switcher_mode = playlist, media_library, playlist_editor, visualizer, help +screen_switcher_mode = previous # ## ## Note: You can define startup screen by choosing screen from the list above. diff --git a/.zshrc b/.zshrc index c598fc3..aa9e14c 100644 --- a/.zshrc +++ b/.zshrc @@ -62,6 +62,20 @@ autoload edit-command-line zle -N edit-command-line bindkey '' edit-command-line +#TheFuck plugin +fuck_cache="$HOME/.cache/thefuck" +test -f $fuck_cache || thefuck --alias uwu >| "$fuck_cache" +source "$fuck_cache" +unset fuck_cache + +#source fasd_cache for 40 ms quicker start. +fasd_cache="$HOME/.cache/fasd_cache" +if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install posix-alias posix-hook >| "$fasd_cache" +fi +source "$fasd_cache" +unset fasd_cache + #use lf to change dirs. credit: luke lfcd () { tmp="$(mktemp)" @@ -111,14 +125,6 @@ export PATH="${PATH}:${HOME}/.scripts/" export USE_CCACHE=1 export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH" -#source fasd_cache for 40 ms quicker start. -fasd_cache="$HOME/.cache/fasd_cache" -if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install posix-alias posix-hook >| "$fasd_cache" -fi -source "$fasd_cache" -unset fasd_cache - alias b='bat' alias btctl='bluetoothctl' alias cp='cp -iv'