LF now exits into current path

This commit is contained in:
Thomas Naderer
2024-12-25 13:37:35 +01:00
parent 2dcd9c7e67
commit 4988b2b56f
2 changed files with 26 additions and 7 deletions

20
lf/lfcd.sh Normal file
View File

@@ -0,0 +1,20 @@
# Change working dir in shell to last dir in lf on exit (adapted from ranger).
#
# You need to either copy the content of this file to your shell rc file
# (e.g. ~/.bashrc) or source this file directly:
#
# LFCD="/path/to/lfcd.sh"
# if [ -f "$LFCD" ]; then
# source "$LFCD"
# fi
#
# You may also like to assign a key (Ctrl-O) to this command:
#
# bind '"\C-o":"lfcd\C-m"' # bash
# bindkey -s '^o' 'lfcd\n' # zsh
#
lfcd () {
# `command` is needed in case `lfcd` is aliased to `lf`
cd "$(command lf -print-last-dir "$@")"
}

View File

@@ -1,4 +1,3 @@
#-----------------------------------------------------------------------------#
# File: ~/.config/lf/lfrc (archlinux @ 'silent')
# Date: Thu 15 Mar 2022 12:05
# Update: Mon 08 Jul 2024 22:04
@@ -257,7 +256,7 @@ map ,
map e $ open "$PWD"
map m
map r
map ZZ quit
# escape
map <esc> :unselect;clear;