This was mentioned by Pax, and can be done in regular emacs-mode with Ctrl+ ] for forward search, and Ctrl+ Alt+ ] for backward search. If editing the previous line, you can use quick substitution: ^-option25^-newoption.cmd command, use the !string syntax: !./cmd:s/-option25/-newoption/Īny delimiter may be used in place of / in the substitution. !-2:s/-option25/-newoption/ would rerun the second-to-last command, but replace option25. Use history expansion with the s/// modifier.If you ran the command earlier, hit Ctrl+ r for a reverse history search and type option25 (in this case).Use Ctrl+ x followed by Ctrl+ e to open the current line in the editor specified by $FCEDIT or $EDITOR or emacs (tried in that order).Since this hasn't been closed yet, here are a few more options. In macOS Terminal app (and in iTerm too) you can Option-Click to move the cursor (cursor will move to clicked position). Personaly I prefer vi mode since I use vim for text editing. To switch Bash to use vi mode: $ set -o vi You can only do this if the prior command is C-y or M-y.įor Max OS X Terminal you can enable "Use option as meta key" in Settings/Keyboard for that.Īlso note, that Readline can operate in two modes: M-y Rotate the kill-ring, and yank the new top.Ctrl-y Yank the most recently killed text back into the buffer at the cursor.This is different than M- because the word boundaries differ. Ctrl-w Kill from the cursor to the previous whitespace.Word boundaries are the same as those used by M-b. M- Kill from the cursor the start of the current word, or, if between words, to the start of the previous word.Word boundaries are the same as those used by M-f. M-d Kill from the cursor to the end of the current word, or, if between words, to the end of the next word.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |