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