ranger: Update config
parent
a0d36605aa
commit
ec18117b17
|
@ -60,6 +60,7 @@ set sort natural
|
|||
set sort_reverse false
|
||||
set sort_case_insensitive true
|
||||
set sort_directories_first true
|
||||
set sort_unicode false
|
||||
|
||||
# Enable this if key combinations with the Alt Key don't work for you.
|
||||
# (Especially on xterm)
|
||||
|
@ -86,6 +87,7 @@ set vcs_backend_hg disabled
|
|||
alias e edit
|
||||
alias q quit
|
||||
alias q! quitall
|
||||
alias qa quitall
|
||||
alias qall quitall
|
||||
alias setl setlocal
|
||||
|
||||
|
|
|
@ -16,25 +16,27 @@
|
|||
# 3 | fix width | success. Don't reload when width changes
|
||||
# 4 | fix height | success. Don't reload when height changes
|
||||
# 5 | fix both | success. Don't ever reload
|
||||
# 6 | image | success. display the image $cached points to as an image preview
|
||||
|
||||
# Meaningful aliases for arguments:
|
||||
path="$1" # Full path of the selected file
|
||||
width="$2" # Width of the preview pane (number of fitting characters)
|
||||
height="$3" # Height of the preview pane (number of fitting characters)
|
||||
cached="$4" # Path that should be used to cache image previews
|
||||
|
||||
maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln
|
||||
|
||||
# Find out something about the file:
|
||||
mimetype=$(file --mime-type -Lb "$path")
|
||||
extension=${path##*.}
|
||||
extension=$(/bin/echo "${path##*.}" | tr "[:upper:]" "[:lower:]")
|
||||
|
||||
# Functions:
|
||||
# runs a command and saves its output into $output. Useful if you need
|
||||
# the return value AND want to use the output in a pipe
|
||||
try() { output=$(eval '"$@"'); }
|
||||
|
||||
# writes the output of the previouosly used "try" command
|
||||
dump() { echo "$output"; }
|
||||
# writes the output of the previously used "try" command
|
||||
dump() { /bin/echo "$output"; }
|
||||
|
||||
# a common post-processing function used after most commands
|
||||
trim() { head -n "$maxln"; }
|
||||
|
|
Loading…
Reference in New Issue