about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-09-11 20:49:05 +0200
committerhut <hut@lavabit.com>2010-09-11 20:49:05 +0200
commit547173247b8ce5dc40fa4f8b9fcf822270661c0f (patch)
treea9355dfa86f359b5482d4b48e7a6f75e939eab2d
parentb1c1e1d88bc511306e4d786dea4234f1cbc6f041 (diff)
downloadranger-547173247b8ce5dc40fa4f8b9fcf822270661c0f.tar.gz
README: added ranger starting function example
-rw-r--r--README14
1 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index babcfbbb..80331dcb 100644
--- a/README
+++ b/README
@@ -78,6 +78,20 @@ or type Q to quit.
 To customize ranger, copy the files from ranger/defaults/ to ~/.config/ranger/
 and modify them according to your wishes.
 
+The author of ranger uses this function (in ~/.bashrc) to start ranger:
+function ranger-cd {
+  before="$(pwd)"
+  python2.6 /the/path/to/ranger/ranger.py --fail-unless-cd "$@" || return 0
+  after="$(grep \^\' ~/.config/ranger/bookmarks | cut -b3-)"
+  if [[ "$before" != "$after" ]]; then
+    cd "$after"
+  fi
+}
+bind '"\C-o":"ranger-cd\C-m"'
+
+This changes the directory after you close ranger and adds the shortcut
+<CTRL-O> for starting ranger.
+
 
 Troubleshooting, Getting Help
 -----------------------------