Skip to content

Commit

Permalink
change docs structure (readd deleted under configs)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Aug 30, 2024
1 parent 8fd27ac commit 582b140
Show file tree
Hide file tree
Showing 24 changed files with 1,097 additions and 0 deletions.
215 changes: 215 additions & 0 deletions docs/docs/config/bindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
---
title: 'bindings'
language: 'en'
---

You can see the default [default key bindings](/docs/default-key-bindings)

Rio allows you to add new keybindings and overwrite any default key bindings.

Keybinds are built using the following trigger fields:

| Name | Description |
| ------------- | --------------- |
| [key](#key) | The key pressed |
| [with](#with) | Modifier keys |
| [mode](#mode) | Terminal mode |

Whom can be be combined with the following effect fields:

| Name | Description |
| ----------------- | ---------------------- |
| [action](#action) | Predefined Rio actions |
| [bytes](#bytes) | Write byte sequence |
| [text](#text) | Write text sequence |

```toml
[bindings]
keys = [
{ key = "q", with = "super", action = "Quit" },
# Bytes[27, 91, 53, 126] is equivalent to "\x1b[5~"
{ key = "home", with = "super | shift", bytes = [27, 91, 53, 126] },
# Remove existing keybind
{ key = "v", with = "control | shift", action = "none" },
]
```

### [Key](#key)

Each value in key binding will specify an identifier of the key pressed:

- `a-z`
- `0-9`
- `F1-F24`
- `tab` `esc`
- `home` `space` `delete` `insert` `pageup` `pagedown` `end` `back`
- `up` `down` `left` `right`
- `@` `colon` `.` `return` `[` `]` `;` `\\` `+` `,` `/` `=` `-` `*`
- `numpadenter` `numpadadd` `numpadcomma` `numpaddivide` `numpadequals` `numpadsubtract` `numpadmultiply`
- `numpad1` `numpad2` `numpad3` `numpad4` `numpad5` `numpad6` `numpad7` `numpad8` `numpad9` `numpad0`

### [Action](#action)

Execute a predefined action in Rio terminal.

#### [Basic Actions](#basic-actions)

| Action | Description |
| :--------------- | :---------------------------------------------------------------------------- |
| None | |
| ReceiveChar | |
| ToggleVIMode | |
| Paste | Paste command |
| Copy | |
| OpenConfigEditor | |
| ResetFontSize | |
| IncreaseFontSize | |
| DecreaseFontSize | |
| Run(string) | Example: Running command `Run(code)` or `Run(code ~/.config/rio/config.toml)` |
| PasteSelection | |
| ClearSelection | |

#### [Window Actions](#window-actions)

| Action | Description |
| :----------- | :---------- |
| CreateWindow | |
| Quit | |

#### [Pane Actions](#pane-actions)

| Action | Description |
| :---------------- | :---------- |
| SplitHorizontally | |
| SplitVertically | |
| ClosePane | |

#### [Tab Actions](#tab-actions)

| Action | Description |
| :------------------- | :------------------------------------------------------------------ |
| CreateTab | |
| CloseTab | |
| CloseUnfocusedTabs | |
| SelectPrevTab | |
| SelectNextTab | |
| SelectLastTab | |
| SelectTab(tab_index) | Example: Select first tab `SelectTab(0)`, second tab `SelectTab(1)` |

#### [Scroll Actions](#scroll-actions)

| Action | Description |
| :----------------- | :------------------------------------------------------------------------- |
| Scroll(int) | Example: Scroll up 8 lines `Scroll(8)` or scroll down 5 lines `Scroll(-5)` |
| ScrollPageUp | |
| ScrollPageDown | |
| ScrollHalfPageUp | |
| ScrollHalfPageDown | |
| ScrollToTop | |
| ScrollToBottom | |

### [Search](#search)

| Action | Description |
| :----------------- | :------------------------------------------------------------------------- |
| SearchForward | |
| SearchBackward | |
| SearchConfirm | |
| SearchClear | |
| SearchFocusNext | |
| SearchFocusPrevious | |
| SearchDeleteWord | |
| SearchHistoryNext | |
| SearchHistoryPrevious | |

### [Bytes](#bytes)

Send a byte sequence to the running application.

The `bytes` field writes the specified string to the terminal. This makes
it possible to pass escape sequences, like `PageUp` ("\x1b[5~"). Note that applications use terminfo to map escape sequences back
to keys. It is therefore required to update the terminfo when changing an escape sequence.

### [With](#with)

Key modifiers to filter binding actions

- `none`
- `control`
- `option`
- `super`
- `shift`
- `alt`

Multiple modifiers can be combined using `|` like this:

```toml
with = "control | shift"
```

<!--
- `mode`: Indicate a binding for only specific terminal reported modes
This is mainly used to send applications the correct escape sequences
when in different modes.
- AppCursor
- AppKeypad
- Alt
A `~` operator can be used before a mode to apply the binding whenever
the mode is *not* active, e.g. `~Alt`. -->

### [Mode](#mode)

There is currently four different modes:

- `vi`
- `alt` (Alt screen)
- `appcursor`
- `appkeypad`

`~` can be prefixed to disable the keybind while in that mode.

```toml
[bindings]
keys = [
# Enable VI mode on escape, when not in VI mode.
{ key = "esc", mode = "~vi", action = "ToggleVIMode" },
]
```

### [Text](#text)

`text` can be used to write specific text on key press:

```toml
[bindings]
keys = [
# Write `Rio is awesome!` on `Control + r`
{ key = "r", with = "control", text = "Rio is awesome!" },
]
```

### [Overwriting](#overwriting)

Bindings are always filled by default, but will be replaced when a new binding with the same triggers is defined. To unset a default binding, it can be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for a no-op if you do not wish to receive input characters for that binding.

The example below will disable window creation binding in the macos:

```toml
[bindings]
keys = [
{ key = "n", with = "super", action = "ReceiveChar" }
]
```

`ReceiveChar` will treat the binding as non existent and simply receive the input and put the character into the terminal.

Optionally you can ignore/disable completely a binding using `None`. In the example below, whenever you use key "n" along with "super" key nothing will happen.

```toml
[bindings]
keys = [
{ key = "n", with = "super", action = "None" }
]
```

If you are missing a key binding that you believe that should be a default in the platform that you are using, feel free to [open an issue](https://github.com/raphamorim/rio).
23 changes: 23 additions & 0 deletions docs/docs/config/colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: 'colors'
language: 'en'
---

Defining colors in the configuration file will not have any effect if you're using a theme.

The default configuration is without a theme.

Example:

```toml
[colors]
background = '#0F0D0E'
foreground = '#F9F4DA'
cursor = '#F38BA3'
tabs = '#443d40'
tabs-active = '#F38BA3'
green = '#0BA95B'
red = '#ED203D'
blue = '#12B5E5'
yellow = '#FCBA28'
```
10 changes: 10 additions & 0 deletions docs/docs/config/confirm-before-quit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 'confirm-before-quit'
language: 'en'
---

Require confirmation before quitting (Default: `true`).

```toml
confirm-before-quit = true
```
22 changes: 22 additions & 0 deletions docs/docs/config/cursor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: 'cursor'
language: 'en'
---

## Cursor

Default cursor is `Block`.

Other available options are: `_` and `|`

```toml
cursor = ''
```

## Blinking Cursor

Default is `false`

```toml
blinking-cursor = false
```
18 changes: 18 additions & 0 deletions docs/docs/config/editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: 'editor'
language: 'en'
---

Default editor is `vi`.

Whenever the key binding `OpenConfigEditor` is triggered it will use the value of the editor along with the rio configuration path.

An example, considering you have VS Code installed and you want to use it as your editor:

```toml
[editor]
program = "code"
args = []
```

Whenever `OpenConfigEditor` runs it will trigger `$ code <path-to-rio-configuration-file>`.
10 changes: 10 additions & 0 deletions docs/docs/config/env-vars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 'env-vars'
language: 'en'
---

Sets environment variables

```toml
env-vars = []
```
62 changes: 62 additions & 0 deletions docs/docs/config/fonts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: 'fonts'
language: 'en'
---

Configure fonts used by the terminal.

Note: You can set different font families but Rio terminal
will always look for regular font bounds whene

You can also set family on root to overwrite all fonts.

```toml
[fonts]
family = "cascadiacode"
```

You can also specify extra fonts to load:

```toml
[fonts]
extras = [{ family = "Microsoft JhengHei" }]
```

In case you want to specify any font feature:

```toml
[fonts]
features = ["ss02", "ss03", "ss05", "ss19"]
```

Note: Font features do not have support to live reload on configuration, so to reflect your changes, you will need to close and reopen Rio.

---

The font configuration default:

```toml
[fonts]
size = 18
features = []

[fonts.regular]
family = "cascadiacode"
style = "normal"
weight = 400

[fonts.bold]
family = "cascadiacode"
style = "normal"
weight = 800

[fonts.italic]
family = "cascadiacode"
style = "italic"
weight = 400

[fonts.bold-italic]
family = "cascadiacode"
style = "italic"
weight = 800
```
10 changes: 10 additions & 0 deletions docs/docs/config/ignore-selection-foreground-color.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 'ignore-selection-foreground-color'
language: 'en'
---

Default is `false`

```toml
ignore-selection-foreground-color = false
```
Loading

0 comments on commit 582b140

Please sign in to comment.