aboutsummaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-04-20 16:01:54 +0300
committereug-vs <eugene@eug-vs.xyz>2022-04-20 16:01:54 +0300
commit8cfebb1165d3d74c6e4c96d16030c1a8cd2bfbff (patch)
treef33a3f38b45a6bb2d2174282cf8ef99dee52580f /zsh
parentd04a5d5597ea01a051dec8a9c6871cae0dedd7ca (diff)
downloaddotfiles-8cfebb1165d3d74c6e4c96d16030c1a8cd2bfbff.tar.gz
feat(zsh): use vifm for CTRL-O binding
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc18
1 files changed, 8 insertions, 10 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index e98fd80..2bc552c 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -71,17 +71,15 @@ bindkey '^y' fzf-tmux-project
zle -N fzf-kill-tmux-project
bindkey '^x' fzf-kill-tmux-project
-# Use lf to switch directories and bind it to ctrl-o
-function lfcd () {
- tmp="$(mktemp)"
- lf -last-dir-path="$tmp" "$@"
- if [ -f "$tmp" ]; then
- dir="$(cat "$tmp")"
- rm -f "$tmp" >/dev/null
- [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
- fi
+# Use vifm to switch directories and bind it to ctrl-o
+function vifmcd () {
+ vifm .
+
+ if [ -f ~/.config/vifm/lastdir ]; then
+ cd $(cat ~/.config/vifm/lastdir)
+ fi
}
-bindkey -s '^o' 'lfcd\n'
+bindkey -s '^o' 'vifmcd\n'
# Syntax highlighting, must be last