LF now exits into current path
This commit is contained in:
20
lf/lfcd.sh
Normal file
20
lf/lfcd.sh
Normal 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 "$@")"
|
||||||
|
}
|
||||||
3
lf/lfrc
3
lf/lfrc
@@ -1,4 +1,3 @@
|
|||||||
#-----------------------------------------------------------------------------#
|
|
||||||
# File: ~/.config/lf/lfrc (archlinux @ 'silent')
|
# File: ~/.config/lf/lfrc (archlinux @ 'silent')
|
||||||
# Date: Thu 15 Mar 2022 12:05
|
# Date: Thu 15 Mar 2022 12:05
|
||||||
# Update: Mon 08 Jul 2024 22:04
|
# Update: Mon 08 Jul 2024 22:04
|
||||||
@@ -257,7 +256,7 @@ map ,
|
|||||||
map e $ open "$PWD"
|
map e $ open "$PWD"
|
||||||
map m
|
map m
|
||||||
map r
|
map r
|
||||||
|
map ZZ quit
|
||||||
# escape
|
# escape
|
||||||
map <esc> :unselect;clear;
|
map <esc> :unselect;clear;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user