aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/zsh
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-01-21 23:29:58 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-01-21 23:29:58 +0300
commite4672d66a9302f557ce26b0a418746deffe0decc (patch)
treefe1e226c629061411c9fe8de7d16e861deaff223 /dotfiles/.config/zsh
parent64d645f2bd1d18aeefdde07621a1a4d1e07cb1cd (diff)
downloadswayrice-e4672d66a9302f557ce26b0a418746deffe0decc.tar.gz
swayrice-e4672d66a9302f557ce26b0a418746deffe0decc.zip
Friendship ended with ranger, again. lf it is now
Too many changes made, basically all of them related to lf. Sorry ranger. You're too slow 🦔.
Diffstat (limited to 'dotfiles/.config/zsh')
-rw-r--r--dotfiles/.config/zsh/shortcuts22
1 files changed, 20 insertions, 2 deletions
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"