diff options
-rw-r--r-- | README.md | 43 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | ted.cfg | 2 |
3 files changed, 44 insertions, 3 deletions
@@ -30,6 +30,48 @@ All the keybindings listed below are customizable! - Run any shell command (Ctrl+!) - Go to definition (Ctrl+click) - Go to line (Ctrl+G) +- Autocomplete (Ctrl+Space) + +## Getting started with ted + +After installing ted, you can just start using it like you would any other editor. The keyboard shortcuts +are mostly what you'd expect them to be (Ctrl+o for open, Ctrl+s for save, etc.). + +### Configuration + +At any time, you can check out all the keyboard shortcuts, and add your own, by opening your ted.cfg file. +To do this, press Ctrl+Shift+p +to open the command palette, and select "open-config". There are several sections to this config file: + +- `[core]` for core settings +- `[keyboard]` for keyboard shortcuts +- `[colors]` for colors +- `[extensions]` for which file extensions should be mapped to which programming languages + +Comments begin with `#`, and all other lines are of the form `key = value`. + +You need to restart ted when you make a change to ted.cfg. + +The `core` section's settings should be pretty familiar (font size, etc.) or should have comments on the previous line +explaining what they do. Keyboard shortcuts are of the form `key combo = action`, where `action` is an argument (number or string), +followed by a command. The commands match the things in the command palette (Ctrl+Shift+p), but `:` is added to the beginning to make +it clear it's a command. Colors are formatted like `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, where r, g, b, and a are red, green, +blue, and alpha (transparency/opacity). You can use a [color picker](https://www.google.com/search?q=color+picker) to help you out. +The extensions section is fairly self-explanatory. + +### IDE-like features + +If you are working in a compiled language, like C, you can press F4 to compile your code. The default is to run `make` in +the current directory or one of its parents, depending on where `Makefile` is. On Windows, if `make.bat` exists, it will be run. +If a `Cargo.toml` file exists in this directory or one of its parents, F4 will run `cargo build`. You can set the default build command +in the `[core]` section of the config file. + +Jump to definition and autocompletion both depend on [ctags](https://github.com/universal-ctags/ctags). You can press Ctrl+T +at any time to generate tags for all files in the current directory. Once you have a tags file, you can Ctrl+Click on an identifier +to go to its definition. You can also press Ctrl+D to get a searchable list of all functions/types where you can select one to go to +its definition. Press Ctrl+space to autocomplete. If there is only one possible completion from the tags file, it will be selected automatically. +Otherwise, you'll get a popup showing all possible completions. You can press tab to select a completion (or click on it), and press +Ctrl+space/Ctrl+shift+space to cycle between suggestions. ## Building from source @@ -76,6 +118,7 @@ Then run `make.bat`. <tr><td>0.5a</td> <td>Several bugfixes, go to line</td> <td>2021 Feb 23</td></tr> <tr><td>0.6</td> <td>Split-screen</td> <td>2021 Feb 28</td></tr> <tr><td>0.7</td> <td>Restore session, command selector, :shell, big bug fixes</td> <td>2021 Mar 3</td></tr> +<tr><td>0.8</td> <td>Autocomplete</td> <td>2021 Mar 4</td></tr> </table> ## License @@ -1,9 +1,7 @@ // @TODO: -// - more instructions (basic stuff + how to open config) // - update screenshot in README // - test windows 7 - #include "base.h" no_warn_start #if _WIN32 @@ -127,7 +127,7 @@ Ctrl+[ = :build-prev-error Ctrl+] = :build-next-error Ctrl+! = :shell -Ctrl+t = "ctags *.c *.h" :shell +Ctrl+t = "ctags *.*" :shell Ctrl+d = :goto-definition Ctrl+g = :goto-line |