diff --git a/.gitignore b/.gitignore index 20e2d6b..6741efe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ !kak/** !fuzzel/ !fuzzel/** +!lf/ +!lf/** diff --git a/lf/lfcd.sh b/lf/lfcd.sh new file mode 100644 index 0000000..e35199a --- /dev/null +++ b/lf/lfcd.sh @@ -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 "$@")" +} diff --git a/lf/lfrc b/lf/lfrc new file mode 100644 index 0000000..694764b --- /dev/null +++ b/lf/lfrc @@ -0,0 +1,23 @@ +# Shell für Kommandos +set shell sh +set shellopts '-eu' +set ifs "\n" + +# Anzeige +set hidden true +set drawbox true +set icons true +set ignorecase true +set scrolloff 5 +set info size + +# Mausklick aktivieren +set mouse true + +# Praktische Extras +map . set hidden! +map D delete +map reload + + +