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 "$@")"
|
||||
}
|
||||
13
lf/lfrc
13
lf/lfrc
@@ -1,4 +1,3 @@
|
||||
#-----------------------------------------------------------------------------#
|
||||
# File: ~/.config/lf/lfrc (archlinux @ 'silent')
|
||||
# Date: Thu 15 Mar 2022 12:05
|
||||
# Update: Mon 08 Jul 2024 22:04
|
||||
@@ -252,12 +251,12 @@ cmd bulkrename $vidir
|
||||
map "'"
|
||||
map '"'
|
||||
map ,
|
||||
map c
|
||||
map d
|
||||
map e $ open "$PWD"
|
||||
map m
|
||||
map r
|
||||
|
||||
map c
|
||||
map d
|
||||
map e $ open "$PWD"
|
||||
map m
|
||||
map r
|
||||
map ZZ quit
|
||||
# escape
|
||||
map <esc> :unselect;clear;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user