Compare commits
No commits in common. "bd3fbd2566948e5c9cb31583b3d9e59c41fc3f65" and "b276a54f9f60ddc7eeca758ab2ba9aa9528b9faf" have entirely different histories.
bd3fbd2566
...
b276a54f9f
|
@ -111,13 +111,35 @@ function zvm_after_init() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -f $FZY_CACHE ]; then
|
if [ ! -f $FZY_CACHE ]; then
|
||||||
PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})"
|
PATHS=""
|
||||||
search_dirs=( \
|
search_dirs=(~/.config/waybar/ \
|
||||||
|
~/.config/xmodmap/ \
|
||||||
|
~/.config/zsh/ \
|
||||||
|
~/.config/tmux/ \
|
||||||
|
~/.config/vim/ \
|
||||||
|
~/.config/qtile/ \
|
||||||
|
~/.config/rofi/ \
|
||||||
|
~/.config/scripts/ \
|
||||||
|
~/.config/nvim/ \
|
||||||
|
~/.config/picom/ \
|
||||||
|
~/.config/polybar/ \
|
||||||
|
~/.config/awesome/ \
|
||||||
|
~/.config/dunst/ \
|
||||||
|
~/.config/firefox/ \
|
||||||
|
~/.config/git/ \
|
||||||
|
~/.config/gitui/ \
|
||||||
|
~/.config/helix/ \
|
||||||
|
~/.config/hypr/ \
|
||||||
|
~/.config/i3/ \
|
||||||
|
~/.config/kitty/ \
|
||||||
|
~/.config/mpv/ \
|
||||||
|
~/.config/alacritty/ \
|
||||||
~/Workspace/ \
|
~/Workspace/ \
|
||||||
~/Containers/ \
|
~/Containers/ \
|
||||||
/home/server/Storage/Shared/ \
|
~/Storage/Shared/ \
|
||||||
/home/server/Storage/Thomas/ \
|
~/Storage/Thomas/ \
|
||||||
)
|
)
|
||||||
|
|
||||||
for i in $search_dirs ; do
|
for i in $search_dirs ; do
|
||||||
if [ -d $i ]; then
|
if [ -d $i ]; then
|
||||||
PATHS="$PATHS\n$i"
|
PATHS="$PATHS\n$i"
|
||||||
|
@ -134,50 +156,8 @@ function zvm_after_init() {
|
||||||
cd_to "$(fd . -t d | fzy -l 20)"
|
cd_to "$(fd . -t d | fzy -l 20)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_local_files() {
|
|
||||||
zle -I
|
|
||||||
file=$(fd . -t f | fzy -l 20)
|
|
||||||
if [ -z "$file" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
nvim "$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
function edit_global_files() {
|
|
||||||
zle -I
|
|
||||||
FZY_CACHE=~/.cache/fzy_file_paths
|
|
||||||
if [ -f $FZY_CACHE ]; then
|
|
||||||
# Check if cache is older than 1 day
|
|
||||||
if [ $(($(date +%s) - $(date -r $FZY_CACHE +%s))) -gt 86400 ]; then
|
|
||||||
rm $FZY_CACHE
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ ! -f $FZY_CACHE ]; then
|
|
||||||
PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | parallel echo ~/{})"
|
|
||||||
search_dirs=( \
|
|
||||||
~/Workspace/ \
|
|
||||||
~/Containers/ \
|
|
||||||
)
|
|
||||||
for i in $search_dirs ; do
|
|
||||||
if [ -d $i ]; then
|
|
||||||
PATHS="$PATHS\n$(fd . $i -t f)"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo -e $PATHS > $FZY_CACHE
|
|
||||||
fi
|
|
||||||
file=$(cat $FZY_CACHE | fzy -l 20)
|
|
||||||
if [ -z "$file" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
cd_to "$(dirname $file)"
|
|
||||||
nvim "$file"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
zle -N find_global_files
|
zle -N find_global_files
|
||||||
zle -N find_local_files
|
zle -N find_local_files
|
||||||
zle -N edit_global_files
|
|
||||||
zle -N edit_local_files
|
|
||||||
|
|
||||||
bindkey "^T" find_global_files
|
bindkey "^T" find_global_files
|
||||||
bindkey -M emacs "^T" find_global_files
|
bindkey -M emacs "^T" find_global_files
|
||||||
|
@ -189,16 +169,6 @@ function zvm_after_init() {
|
||||||
bindkey -M vicmd "^Y" find_local_files
|
bindkey -M vicmd "^Y" find_local_files
|
||||||
bindkey -M viins "^Y" find_local_files
|
bindkey -M viins "^Y" find_local_files
|
||||||
|
|
||||||
bindkey "^E" edit_global_files
|
|
||||||
bindkey -M emacs "^E" edit_global_files
|
|
||||||
bindkey -M vicmd "^E" edit_global_files
|
|
||||||
bindkey -M viins "^E" edit_global_files
|
|
||||||
|
|
||||||
bindkey "^W" edit_global_files
|
|
||||||
bindkey -M emacs "^W" edit_local_files
|
|
||||||
bindkey -M vicmd "^W" edit_local_files
|
|
||||||
bindkey -M viins "^W" edit_local_files
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$SSH_SESSION_ID" != "" ]; then
|
if [ "$SSH_SESSION_ID" != "" ]; then
|
||||||
mkdir -p /tmp/ssh_sessions
|
mkdir -p /tmp/ssh_sessions
|
||||||
|
@ -319,7 +289,7 @@ alias vim="nvim"
|
||||||
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"'
|
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"'
|
||||||
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
|
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
|
||||||
alias python=python3
|
alias python=python3
|
||||||
alias lf="cd \"\$(/usr/bin/lf -print-selection -print-last-dir)\""
|
alias r="cd \"\$(lf -print-selection -print-last-dir)\""
|
||||||
alias v="nvim -c ':lua require(\"oil\").open()' && cd \"\$(cat /tmp/oil_dir 2> /dev/null || pwd)\""
|
alias v="nvim -c ':lua require(\"oil\").open()' && cd \"\$(cat /tmp/oil_dir 2> /dev/null || pwd)\""
|
||||||
alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1"
|
alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1"
|
||||||
alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files"
|
alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files"
|
||||||
|
|
Loading…
Reference in New Issue