ease:fallschool_cpo
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ease:fallschool_cpo [2020/06/29 12:23] – cpollok | ease:fallschool_cpo [2020/07/01 13:08] (current) – cpollok | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Definitions ===== | ===== Definitions ===== | ||
| - | |||
| An Emacs buffer is the equivalent of window / tab in other editors. It can have a file associated with it that you can (or cannot depending on the privileges) edit, or it can be running a process (e.g. when you open the shell: M-x shell). The minibuffer is usually a one-line part of the screen at the bottom of the Emacs window. | An Emacs buffer is the equivalent of window / tab in other editors. It can have a file associated with it that you can (or cannot depending on the privileges) edit, or it can be running a process (e.g. when you open the shell: M-x shell). The minibuffer is usually a one-line part of the screen at the bottom of the Emacs window. | ||
| The cursor in Emacs is called the point. Dired is the directory explorer mode of Emacs. When in the following we talk about " | The cursor in Emacs is called the point. Dired is the directory explorer mode of Emacs. When in the following we talk about " | ||
| + | |||
| + | ===== Window Overview ===== | ||
| + | |||
| + | When first opening Emacs you will be welcomed by this screen: | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | There are the two tool bars (markers 1 and 2), but we will not be using them much. You can explore them if you want, but everything in them can be done with key bindings as well. | ||
| + | |||
| + | The main window currently occupies most of the screen (3). At the top of this window there' | ||
| + | |||
| + | Just below the window there is another white bar. This is the so-called " | ||
| Line 17: | Line 28: | ||
| Textual representation of Emacs key bindings has a number of conventions: | Textual representation of Emacs key bindings has a number of conventions: | ||
| - | Short way of writing Ctrl, Alt and Shift is: C, M and S respectively. | + | Short way of writing Ctrl, Alt and Shift is: **C**, **M** and **S** respectively.\\ |
| + | **RET** stands for the Enter or Return key\\ | ||
| + | **TAB** stands for the Tabulator key\\ | ||
| + | If a key is supposed to be pressed together with another key, they' | ||
| + | **C-h b** means first press Ctrl and h together and then b separately (in contrast to **C-h C-b**)\\ | ||
| + | Commands like **M-x shell** mean: press Alt and x together and then type shell into the minibuffer on the bottom of the screen. | ||
| - | RET stands for the Enter or Return key | ||
| - | If a key is supposed to be pressed together with another key, they' | + | Now some of the most important commands: |
| - | C-h b means first press Ctrl and h together and then b separately (in contrast to C-h C-b) | + | ==== Going back in history (when in the REPL buffer): ==== |
| + | * **C-Up**: Step through previously executed commands | ||
| + | * **C-Down**: Step back forward thorugh the previously executed commands | ||
| + | * **M-R**: regex-search in the previously executed commands (can step through with **C-Up** and **C-Down**) | ||
| - | Commands like M-x shell mean: press Alt and x together and then type shell into the minibuffer on the bottom of the screen. | + | ==== Handling multiple windows: ==== |
| + | * **C-x 2**: Splits the currently selected window horizontally | ||
| + | * **C-x 3**: Splits | ||
| + | * **C-x 0**: Closes | ||
| + | * **C-x 1**: Close any window other than the currently selected | ||
| - | Now some of the most important commands: | + | === Example configurations === |
| - | Going back in history (when in the REPL buffer): | + | Through this feature you can arrange windows arbitrarily |
| - | - C-Up: Step through previously executed commands in the REPL buffer | + | |
| - | - C-Down: Step back forward thorugh the previously executed commands | + | |
| - | - M-R: regex-search in the previously executed commands (can step through with C-Up and C-Down) | + | |
| - | Handling multiple buffers: | + | {{:ease:emacs:overview_3-split.png? |
| - | - C-x 2: Splits the currently selected buffer horizontally | + | {{: |
| - | - C-x 3: Splits the currently selected buffer vertically | + | |
| - | - C-x 0: Closes the currently selected buffer (the other buffer in the split is scaled back to it's full size) | + | |
| - | - C-x 1: Close any buffer other than the currently selected | + | |
| - | Opening files, switching and killing buffers: | ||
| - | - C-x f: Open a new buffer with the contents of a file (specified by its path) | ||
| - | - C-x b: Change the buffer of the current frame (specified by its name, in most cases that's the filename) | ||
| - | Note: When changing buffers, you can use C-Up and C-Down to step through the currently open buffers. | ||
| - | - C-x k: Kill the currently active buffer. (Emacs will ask you if you want to save any changes beforehand.) | ||
| - | Lisp/ | + | ==== Opening files, switching and killing buffers: ==== |
| - | - M-. (M-,): Jump in (out) of function definition | + | * **C-x f**: Open a new buffer with the contents of a file (specified by its path) |
| - | - C-c M-p: set the package from the selected lisp file as the package in the REPL | + | * **C-x b**: Change the buffer of the current frame (specified by its name, in most cases that's the filename) |
| - | - C-c C-c: Compile the code block at the point (usually a function) | + | * **C-x k**: Kill the currently active buffer. (Emacs will ask you if you want to save any changes beforehand.) |
| - | - C-c C-k: Compile the whole file (Emacs will ask you to save if there are unsaved changes) | + | |
| + | Note: When changing buffers, you can use **C-Up** and **C-Down** to step through the currently open buffers. | ||
| + | |||
| + | ==== Lisp/ | ||
| + | * **M-.** (**M-,**): Jump in (out) of function definition | ||
| + | * **C-c M-p**: set the package from the selected lisp file as the package in the REPL | ||
| + | * **C-c C-c**: Compile the code block at the point (usually a function) | ||
| + | * **C-c C-k**: Compile the whole file (Emacs will ask you to save if there are unsaved changes) | ||
| + | |||
| + | ==== In REPL: ==== | ||
| + | * **C-RET**: close all unmatched parenthesis and evaluate | ||
| + | * **C-c C-c**: interrupt evaluation | ||
| + | * **M-r** (**M-s**): Regexp search backwards (forward) through history | ||
| + | * **,** : Opens mini-buffer to use shortcuts (see **,help**), one important example is **, | ||
| + | |||
| + | ==== In mini-buffer: | ||
| + | * **C-g**: cancel current command input | ||
| + | |||
| + | > The following commands all need to be written out and executed by hitting the Return key. Except for TAB, which means hititng the tabulator key for auto-completion. | ||
| + | |||
| + | * **ros-load-system**: | ||
| + | |||
| + | > Example: | ||
| + | |||
| + | > Press **,** on an empty prompt in the REPL to start a command in the mini-buffer. | ||
| + | |||
| + | > {{ : | ||
| + | |||
| + | > Enter **r-l-s TAB** so it tab-completes to ros-load-system. | ||
| + | |||
| + | > {{ : | ||
| + | |||
| + | > {{ : | ||
| + | |||
| + | |||
| + | > Enter **cram-mobile-pick-place-plans** for the ROS package (note the udnerscores). (You can use tab-completion here as well.) | ||
| + | |||
| + | > {{ : | ||
| + | |||
| + | > Enter **cram-mobile-pick-place-plans** for the LISP system (note the dashes). You have also just pressed **TAB** to choose the default system (as indicated in the prompt text). | ||
| + | |||
| + | > {{ : | ||
| + | |||
| + | > After entering the system, Emacs will load the package and after it has completed loading, it will say so in the mini-buffer as well. | ||
| - | In REPL: | ||
| - | - C-RET: close all unmatched parenthesis and evaluate | ||
| - | - C-c C-c: interrupt evaluation | ||
| - | - M-r (M-s): Regexp search backwards (forward) through history | ||
| - | - , : Opens mini-buffer to use shortcuts (see ,help), one important example is , | ||
| Line 63: | Line 112: | ||
| - | When starting out with using Emacs, it can be useful to have a fixed window configuration to not get overwhelmed with having to constantly open and close new buffer windows. When opening Emacs, use the C-x 2 command to split the window in two and just leave the bottom one as the REPL and use the top one for viewing files (C-x f and C-x b). | + | When starting out with using Emacs, it can be useful to have a fixed window configuration to not get overwhelmed with having to constantly open and close new buffer windows. When opening Emacs, use the **C-x 2** command to split the window in two and just leave the bottom one as the REPL and use the top one for viewing files (**C-x f** and **C-x b**). Like so: |
| + | |||
| + | {{ : | ||
ease/fallschool_cpo.1593433434.txt.gz · Last modified: 2020/06/29 12:23 by cpollok
