lf/etc/lfcd.csh

15 lines
514 B
Tcsh
Raw Normal View History

2020-12-23 23:28:25 +00:00
# Change working dir in tcsh to last dir in lf on exit (adapted from ranger).
#
2020-12-23 23:28:25 +00:00
# You need to either copy the content of this file to your shell rc file (e.g.
# ~/.tcshrc) or source this file directly:
#
2020-12-23 23:28:25 +00:00
# setenv LF_HOME "${HOME}/.config/lf"
# [ -e "${LF_HOME}/lfcd.csh" ] && source "${LF_HOME}/lfcd.csh"
#
2020-12-23 23:28:25 +00:00
# You may also like to assign a key to this command:
#
2020-12-23 23:28:25 +00:00
# bindkey -c "^O" lfcd
#
2020-12-23 23:28:25 +00:00
alias lfcd 'set _=`mktemp` && lf -last-dir-path=$_ "\!*" && set _=`cat $_ && rm -f $_` && [ -d "$_" ] && cd "$_"'