My current modus operandi involves using GNU screen for terminal multiplexing so I can juggle an editor, man pages, a terminal, etc, without going completely insane, using Vim for editing because well ok let's not get started there, and using Emacs every now and then to play Tetris. This works well, but it involves a whole lot of hotkeys, and it's not easy to remember every single one. This post is the reference I keep wishing someone would write. It covers all the commands for each of these programs relevant to the task at hand.
screen
Note also: Screen uses some possibly confusing nomenclature: the window-like areas displayed onscreen are called "regions", and the word "window" is reserved for the actual terminal sessions which a region may display. You can have no more than one window showing in any region, but you can have multiple regions showing the same window.
Action | Command |
---|---|
Begin session | screen [-S <session name>] |
End session | C-a \ |
create a horizontal split | C-a S |
create a vertical split | C-a | |
close current region | C-a X |
close all regions except current | C-a Q |
switch focus to next region | C-a <tab> |
switch window displayed in region | C-a C-a |
choose window to display from menu | C-a " |
create and display a new terminal | C-a c |
shift current region's right border | C-a :resize -h [+n|-n] |
shift current region's bottom border | C-a :resize -v [+n|-n] |
Note: -h and -v may be omitted if only horizontal or only vertical splits are in use. |
vim
Note: Vim, unlike screen, uses the completely reasonable convention of referring to regions on screen as windows, and to the things windows display as buffers. This convention is followed here.
Action | Command |
---|---|
create horizontal split | :sp |
create vertical split | :vsp |
change height of window by n | :res [+n|-n] |
change width of window by n | :vert res [+n|-n] |
move cursor to adjacent window (in normal mode) |
C-w [h|j|k|l] |
open file buffer in window | :e <file> |
select file to open from interactive menu | :E |
Emacs
Note: You want your .emacs file to contain the following line:
(setq initial-major-mode 'tetris)
(setq initial-major-mode 'tetris)
Action | Command |
---|---|
Start Tetris | emacs |
Exit Tetris | C-x C-c |
Here's hoping you find this as useful as I do! :-)
No comments:
Post a Comment