![]() ![]() However, I found that 'I' and 'K' are even better - they are even closer than 'P' and 'N', and intuitive (for the same reason) as for mnemonics - as scrolling is such a common thing to do, mnemonics won't really matter as the shortcuts will soon bypass your brain and enter the muscle memory. If you just did some scrolling in Emacs, and then go to tmux, it makes sense to have those shortcuts. They are close, intuitive ('P' is above 'N' on the keyboard), and mnemonic ("previous" and "next"). 'P' and 'N' are familiar for this purpose to the Emacs users. 4 Answers Sorted by: 4 In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file /.nf My /.nf file looks (roughly) like this: new-session -d -s MYSESSIONNAME set -g status off new-window /my-startup-script. 'S' (to enter copy-mode) is: 1) close (same reason as above), 2) involves the other hand (compare: the 1-2 in boxing, or the ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling). Because that shortcut is essential in tmux, C-j is much better as it involves zero hand movement (apart from hitting the key). ![]() 'B' is seemingly a close key, but it is in the middle of the two index fingers (at 'F' and 'J', respectively). Change the prefix key so you won't have to reach one bit. To try it out, put all the code sections in ~/.nf. This is the way I made it work, and the reasons why I think it is better than the default way. You can set the key binding mode using Ctrl- b, then :set-window-option mode-keys emacs See the man page for information on prefacing a copy mode command with a repeat count. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. [ Enter copy mode to copy text or view the history. Tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key. Unshifted, the cursor moves instead of the page. In vi mode (see below), you can also scroll the page up/down line by line using Shift- k and Shift- j (if you're already in scroll mode). Press q to quit scroll mode.Īlternatively you can press Ctrl- b PgUp to go directly into copy mode and scroll one page up (which is what it sounds like you will want most of the time) Ctrl- b then [ then you can use your normal navigation keys to scroll around (eg. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |