| 📦 Turbo Python 6fc62ea k33g 10h ago | 1 | # How to move around a file |
| 2 | |
| 3 | This guide shows how to get to the piece of code you are looking for. It assumes you have a file open. |
| 4 | |
| 5 | ## Find text |
| 6 | |
| 7 | Press **Ctrl-F**, type what you are looking for, and press **Enter**. The first match is selected. |
| 8 | |
| 9 | - **F7** — next match |
| 10 | - **Shift-F7** — previous match |
| 11 | |
| 12 | The search **wraps round**: pressing F7 repeatedly cycles through every match rather than stopping at the bottom of the file. Case is ignored unless you tick `Case sensitive` in the Find box. |
| 13 | |
| 14 | ## Jump to a line number |
| 15 | |
| 16 | Press **Ctrl-G**, type the number, press **Enter**. Lines count from one, as they do in compiler messages. |
| 17 | |
| 18 | ## Jump to a declaration |
| 19 | |
| 20 | Put the cursor on a name and press **F12**. Turbo Python asks the language server where it is declared and opens that file, on that line. When there is more than one declaration, it offers the list. |
| 21 | |
| 22 | That is one of eight questions the **Code** menu puts to the server — what implements this, where is it used, what is wrong with this file. See [How to ask what the code means](ask-about-code.md). |
| 23 | |
| 24 | If the file is already open, its window comes forward instead of opening a second one. |
| 25 | |
| 26 | > This needs pylsp. See [How to enable Python completion](enable-completion.md). |
| 27 | |
| 28 | ## Select and edit whole lines |
| 29 | |
| 30 | | | | |
| 31 | | --- | --- | |
| 32 | | **Double-click a word** | Select it. Typing then replaces it; holding the button after the second click extends the selection from the start of the word. | |
| 33 | | **Ctrl-N** | Open a blank line **above** the cursor. The cursor stays on its own text, now one line lower — room made over what you are looking at. | |
| 34 | | **Ctrl-Y** | Delete the line the cursor is on. The cursor keeps its line number, so holding the key deletes a run of lines. | |
| 35 | |
| 36 | Both are Turbo C's keys. `Ctrl-Y` is why **redo is `Ctrl-R`** and no longer `Ctrl-Y`: between the editor looking like Turbo C and a habit picked up here, the first won. `Ctrl-Shift-Z` was not available to move redo to — a terminal delivers it as plain `Ctrl-Z`. |
| 37 | |
| 38 | A double-click away from a word — on a space or a bracket — moves the cursor and selects nothing. Editors disagree about what a run of punctuation means, and nothing is at least an answer you can predict. |
| 39 | |
| 40 | ## Move by word, line and file |
| 41 | |
| 42 | | | | |
| 43 | | --- | --- | |
| 44 | | **Ctrl-←** / **Ctrl-→** | Previous / next word | |
| 45 | | **Home** / **End** | Start / end of the line | |
| 46 | | **Ctrl-Home** / **Ctrl-End** | Start / end of the file | |
| 47 | | **PgUp** / **PgDn** | One screenful | |
| 48 | |
| 49 | Hold **Shift** with any of these to select as you go. |
| 50 | |
| 51 | ## Move between windows |
| 52 | |
| 53 | | | | |
| 54 | | --- | --- | |
| 55 | | **F6** | The window behind the current one | |
| 56 | | **Alt-1** … **Alt-9** | That numbered window — the number is in its top-right corner | |
| 57 | | **Alt-0** | A list of every open window | |
| 58 | |
| 59 | If the windows are on top of each other, `Window ▸ Tile` lays them out side by side and `Window ▸ Cascade` stacks them with every title visible. |
| 60 | |
| 61 | ## Variants |
| 62 | |
| 63 | **The file is not Python.** Everything above works except F12, which needs a language server. Colouring is off too: only `.py` files are coloured. |
| 64 | |
| 65 | **You want to see where you are.** The right-hand end of the status bar always shows `line:column`, counting from one. |
| 66 | |
| 67 | **You resized the terminal.** Windows follow it: one that filled the terminal still fills it, and one you had moved keeps its corner where you put it. Nothing is ever left larger than the terminal. |
| 68 | |
| 69 | **The line is longer than the window.** The view scrolls sideways to follow the cursor; the bar along the bottom of the window shows how far along you are. |
| 70 | |
| 71 | ## See also |
| 72 | |
| 73 | - Every key: [keyboard reference](../reference/keyboard.md) |
| 74 | - Every menu item: [menu reference](../reference/menus.md) |