Marked editor as draft
All the docs contained in this group of commits are marked as not draft, except for editor, which I will be working as I get more experience and get more precise on the various topics related to the editor and groups of functions.
This commit is contained in:
parent
e837a66b97
commit
0494574c36
9 changed files with 234 additions and 188 deletions
|
|
@ -13,11 +13,11 @@
|
|||
If you are here, maybe is because you want to make flow behave according
|
||||
to your key presses preferences or possibly you already have edited your
|
||||
own keybinds to suit your needs and are looking for some advanced
|
||||
topics to cope your use cases and make everything easier and
|
||||
topics to cope your use cases and make everything easier, faster and
|
||||
fluid when in Flow.
|
||||
|
||||
Using the command palette `Ctrl+Shift+p` and typing **Edit key
|
||||
bindings**, takes you to the json file to extend Flow configuring
|
||||
bindings**, takes you to a json file to extend Flow, configuring
|
||||
keybindings to suit your needs. According to the mode you are in, the
|
||||
corresponding file will be opened. The palette can also be reached left
|
||||
clicking on the current mode in the status bar.
|
||||
|
|
@ -26,9 +26,9 @@ clicking on the current mode in the status bar.
|
|||
## ;TLDR;
|
||||
|
||||
Once you open the corresponding json file, locate inside the imode
|
||||
(internal mode) that will accept the key or keys/combo and add an array,
|
||||
(internal mode) that will accept the key or key/combos and add an array,
|
||||
where the first element is the combination to map to the commands that
|
||||
will happen, the array accepts strings like in
|
||||
will be invoked, the array accepts strings like in
|
||||
|
||||
```js
|
||||
["ctrl+alt+shift+p", "open_command_palette"]
|
||||
|
|
@ -52,7 +52,7 @@ Keybinds are edited per mode, and other modes inherit what is defined
|
|||
in your `flow.json` keybindings. Each mode override keybindings of its
|
||||
parent mode. For example, if you are in **emacs** mode you will be
|
||||
redirected to `emacs.json` and it will override the keybindings from
|
||||
flow.
|
||||
flow, and the default ones defined for emacs mode.
|
||||
|
||||
[introducing keybindings](/devlog/2024#2024-12-05T20:55:00) showcases
|
||||
how to get to edit keybindings.
|
||||
|
|
@ -73,20 +73,20 @@ In general a keybinding json shows this hierarchy:
|
|||
|
||||
```
|
||||
Mode > Imode > press > Key and commands
|
||||
map > map > array > array(array(string,numbers),strings,numbers)
|
||||
map > map > array > array(array(string,numbers),strings,numbers)
|
||||
```
|
||||
|
||||
`Mode` is the json file that holds a map, where each entry has a map
|
||||
called `press` that is an array of arrays.
|
||||
|
||||
`project` is the main imode in `flow.json` and it can be noticed that
|
||||
`normal` imode `inherit`s from `project`, some modes have `release`,
|
||||
`normal` imode `inherits` from `project`, some modes have `release`,
|
||||
usually one will be using only `press` inside `normal` imode or the
|
||||
specific mode if inside `vim`, `helix` or `emacs` modes.
|
||||
|
||||
Looking further, it can be seen that
|
||||
[minimodes](/docs/architecture/minimode) have their keybinding mappings
|
||||
defined in a particular imode.
|
||||
[minimodes](/docs/architecture/minimode) have their own keybinding
|
||||
mappings defined in a particular imode.
|
||||
|
||||
As stated previously, there is a mode hierarchy, the main mode is flow
|
||||
and other modes inherit from it. We remind that also imodes have a
|
||||
|
|
@ -111,20 +111,24 @@ needs.
|
|||
For example, `f5` by default is used to run `zig build test` outputting
|
||||
its results to a *scratch buffer* called `test`.
|
||||
|
||||
The original definition is:
|
||||
|
||||
```js
|
||||
["f5", ["create_scratch_buffer", "*test*"], ["shell_execute_insert", "zig", "build", "test"]],
|
||||
```
|
||||
|
||||
Note that:
|
||||
|
||||
The keybind is `f5`, which maps to the `f5` keycode. is invoking
|
||||
`create_scratchbuffer`, receiving the parameter `*test*` which results
|
||||
in creating a scratch buffer if didn't exist. And then executing the
|
||||
command `shell_execute_insert` that receives the paramaters `zig`,
|
||||
`build`, `test`. This latter command is executing a shell command
|
||||
called `zig` with the parameters `build` and `test`; if you don't have
|
||||
zig installed, it will not work, and you might want to remap `f5` to a
|
||||
different shell command.
|
||||
The keybind is `f5`, which maps to the keycode generated by pressing
|
||||
the `f5` key.
|
||||
|
||||
`create_scratchbuffer` is invoked receiving the parameter `*test*`
|
||||
which results in creating a scratch buffer if didn't exist. And then
|
||||
executing the command `shell_execute_insert` that receives the
|
||||
paramaters `zig`, `build`, `test`. This latter command is executing
|
||||
a shell command called `zig` with the parameters `build` and `test`;
|
||||
if you don't have zig installed, it will not work, and you might
|
||||
want to remap `f5` to a different shell command.
|
||||
|
||||
```
|
||||
[
|
||||
|
|
@ -155,8 +159,8 @@ to submit your findings and solution.
|
|||
|
||||
Probably binding commands is good, but maybe there is a feature in other
|
||||
text editors that you miss and would love to have it at your fingertips.
|
||||
Then it's Zig time:
|
||||
[Adding commands](/docs/architecture/command) to flow.
|
||||
Then it's Zig time: [Adding commands](/docs/architecture/command) to
|
||||
flow.
|
||||
|
||||
|
||||
* Making flow even better with [tests](/docs/testing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue