diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-04-20 16:06:27 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-04-20 16:06:27 +0300 |
commit | c96bee99aa33e81303e44d9e749b0ca56986f065 (patch) | |
tree | f251f93b393d93d9669d2b89db0e87c65543abf7 | |
parent | 8cfebb1165d3d74c6e4c96d16030c1a8cd2bfbff (diff) | |
download | dotfiles-c96bee99aa33e81303e44d9e749b0ca56986f065.tar.gz |
fix(zsh): use vifm --choose-dir option
-rw-r--r-- | vifm/.config/vifm/vifmrc | 2 | ||||
-rw-r--r-- | zsh/.zshrc | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/vifm/.config/vifm/vifmrc b/vifm/.config/vifm/vifmrc index 314e2ee..329bb61 100644 --- a/vifm/.config/vifm/vifmrc +++ b/vifm/.config/vifm/vifmrc @@ -401,7 +401,7 @@ set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, " Start shell in current directory nnoremap s :shell<cr> -nnoremap q :execute '!echo %d > ~/.config/vifm/lastdir' | quit<cr> +nnoremap q :quit<cr> " Display sorting dialog nnoremap S :sort<cr> @@ -73,10 +73,11 @@ bindkey '^x' fzf-kill-tmux-project # Use vifm to switch directories and bind it to ctrl-o function vifmcd () { - vifm . + lastdir=~/.cache/vifm_lastdir + vifm . -c ":o" --choose-dir=$lastdir - if [ -f ~/.config/vifm/lastdir ]; then - cd $(cat ~/.config/vifm/lastdir) + if [ -f $lastdir ]; then + cd $(cat $lastdir) fi } bindkey -s '^o' 'vifmcd\n' |