add readline commands
authorjim <jim@web>
Sat, 4 Apr 2015 23:50:39 +0000 (19:50 -0400)
committerLinux User <ikiwiki@localhost.members.linode.com>
Sat, 4 Apr 2015 23:50:39 +0000 (19:50 -0400)
juli8.mdwn

index 42d0232..f06ff2d 100644 (file)
@@ -48,9 +48,25 @@ Below, we'll give instructions on how to install Juli8 into your existing OCaml
 
     Some keycommands you can now use are:
 
-    * TODO
-
-    If you want to customize `rlwrap` or these keycommands, you can read the documentation at `man rlwrap` and `man readline`, and also look into the Preferences of your Terminal program. (On the Mac, look under Terminal menu/Preferences/Keyboard tab.) This gets complicated quickly, but those are the places to start looking if you want to experiment. You should of course also read around on the web, rather than just changing these blindly.
+    * `^H` (that is, Control+`H`) will delete one char to the left of the cursor position (also `backspace`)
+    * `^D` will delete one char to the right of the cursor position
+    * `^W` will delete one word to the left of the cursor position (also `esc` followed by `backspace`, after releasing `esc`)
+    * `esc` + `D` will delete one word to the right of the cursor position
+    * `^U` will delete from the cursor position leftwards all the way to the start of the line
+    * `^K` will delete from the cursor position rightwards all the way to the end of the line
+    * `^A` moves the cursor to the start of the line
+    * `^E` moves the cursor to the end of the line
+    * `^B` and `^F` work like left and right arrows
+    * `esc` + `B` and `esc` + `F` move left and right a whole word at a time (on the Mac, Option-`left` and Option-`right` do the same)
+    * `^L` clears the screen
+    * `up`/`down` arrows let you scroll through previous lines you typed (also `^P` / `^N`)
+    * `^R` lets you search through previous lines you typed for a matching substring; to refine the search keep making the substring longer, or type `^R` again to find an earlier match. Type `esc` to exit the search and edit the currently showing command line.
+
+    If you create a file named `$HOME/.inputrc` with the contents:
+
+        set blink-matching-paren on
+
+    then you will get the further nice feature that when you type a close parenthesis, rlwrap will temporarily make the cursor jump to the matching open parenthesis, so that you can see how many close parentheses you need to type. If you want to further customize `rlwrap` or the above keycommands, you can read the documentation at `man rlwrap` and `man readline`, and also look into the Preferences of your Terminal program. (On the Mac, look under Terminal menu/Preferences/Keyboard tab.) This gets complicated quickly, but those are the places to start looking if you want to experiment. You should of course also read around on the web, rather than just changing these blindly.
 
 3. Whether you use `utop` or `rlwrap ocaml` or just plain `ocaml`, you will need to set up some initialization commands in order to use the Juli8 libraries. You'll want to edit or create an file called `.ocamlinit` in your `$HOME` directory. The file may already be there and have some commands in it if you used OPAM.
 
@@ -79,6 +95,7 @@ Below, we'll give instructions on how to install Juli8 into your existing OCaml
 
 Will add here some guidance on using the non-monadic parts of the Juli8 library. For the monadic part, [[see here|/topics/week9_using_the_monad_library]].
 
+TODO
 
 
 ## Setting up Haskell for use with Juli8 ##