about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMathis Chenuet <artdevelopp@hotmail.fr>2019-11-03 12:02:07 +0800
committerGitHub <noreply@github.com>2019-11-03 12:02:07 +0800
commit885b7a7f993bfe05011889fa5410d07ae4f77a00 (patch)
treef2fa43489fedc0c09b1443fb333a24b68f432a8b
parent3f31b4688a7a9d753d8c8a673b1870a56a81a2f7 (diff)
downloadranger-885b7a7f993bfe05011889fa5410d07ae4f77a00.tar.gz
add doc and binding
-rw-r--r--examples/fish_automatic_cd.fish10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/fish_automatic_cd.fish b/examples/fish_automatic_cd.fish
index 6c4d3536..5e859463 100644
--- a/examples/fish_automatic_cd.fish
+++ b/examples/fish_automatic_cd.fish
@@ -1,5 +1,15 @@
+# Automatically change the directory in fish after closing ranger
+#
+# This is a fish alias to automatically change the directory to the last visited
+# one after ranger quits.
+# To undo the effect of this function, you can type "cd -" to return to the
+# original directory.
+#
 # Note: funcsave save the alias in fish's config files, you do not need to copy
 # this file anywhere, just execute it once
 
 alias ranger-cd 'ranger --choosedir=$HOME/.rangerdir; set RANGERDIR (cat $HOME/.rangerdir); cd $RANGERDIR'
 funcsave ranger-cd
+
+# To bind Ctrl-O to ranger-cd, save this in `~/.config/fish/config.fish`:
+bind \co 'ranger-cd ; fish_prompt'