From e4672d66a9302f557ce26b0a418746deffe0decc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 21 Jan 2021 23:29:58 +0300 Subject: Friendship ended with ranger, again. lf it is now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Too many changes made, basically all of them related to lf. Sorry ranger. You're too slow 🦔. --- dotfiles/.config/zsh/shortcuts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'dotfiles/.config/zsh/shortcuts') diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts index 67f9652..a5c414a 100644 --- a/dotfiles/.config/zsh/shortcuts +++ b/dotfiles/.config/zsh/shortcuts @@ -10,6 +10,7 @@ alias units="units -H ''" alias trans="trans -v -pager='less -R'" alias lsdp="swaymsg -pt get_outputs | less" alias op="xdg-open" +alias drag="dragon-drag-and-drop" corona() { curl -s https://corona-stats.online/$1 ;} # It's corona time wintitle() { printf "\033]2;%s\a" "$1";} sass-watch() { @@ -32,8 +33,25 @@ alias spw="setsid $TERMINAL >/dev/null 2>&1 &" alias testinet="ping -c2 example.com" # Fuzzy finder -alias fzd='cd "$(find * -type d | fzf || echo ".")"' -alias fzv='nvim $(find * -type f | fzf)' +alias fzd='cd "$(find . -type d | fzf || echo ".")"' +alias fzv='nvim $(find . -type f | fzf)' +alias fzo='op $(find . -type f | fzf)' + +# Function for changing working dir after exiting lf +lfcd () { + tmp="$(mktemp)" + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" + if [ -d "$dir" ]; then + if [ "$dir" != "$(pwd)" ]; then + cd "$dir" + fi + fi + fi +} +bindkey -s '^o' 'lfcd\n' # Mounting drive shortcuts alias mnt="udisksctl mount -b" -- cgit v1.2.3