Skip to content

Commit a9dd741

Browse files
Josverldpgeorge
authored andcommitted
docs/reference/mpremote: Document location of config file.
Signed-off-by: Jos Verlinde <[email protected]>
1 parent 64b3944 commit a9dd741

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/reference/mpremote.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The full list of supported commands are:
108108
**Note:** Instead of using the ``connect`` command, there are several
109109
:ref:`pre-defined shortcuts <mpremote_shortcuts>` for common device paths. For
110110
example the ``a0`` shortcut command is equivalent to
111-
``connect /dev/ttyACM0`` (Linux), or ``c0`` for ``COM0`` (Windows).
111+
``connect /dev/ttyACM0`` (Linux), or ``c1`` for ``COM1`` (Windows).
112112

113113
**Note:** The ``auto`` option will only detect USB serial ports, i.e. a serial
114114
port that has an associated USB VID/PID (i.e. CDC/ACM or FTDI-style
@@ -487,9 +487,16 @@ Shortcuts can be defined using the macro system. Built-in shortcuts are:
487487

488488
- ``cat``, ``edit``, ``ls``, ``cp``, ``rm``, ``mkdir``, ``rmdir``, ``touch``: Aliases for ``fs <sub-command>``
489489

490-
Additional shortcuts can be defined by in user-configuration files, which is
491-
located at ``.config/mpremote/config.py``. This file should define a
492-
dictionary named ``commands``. The keys of this dictionary are the shortcuts
490+
Additional shortcuts can be defined in the user configuration file ``mpremote/config.py``,
491+
located in the User Configuration Directory.
492+
The correct location for each OS is determined using the ``platformdirs`` module.
493+
494+
This is typically:
495+
- ``$XDG_CONFIG_HOME/mpremote/config.py``
496+
- ``$HOME/.config/mpremote/config.py``
497+
- ``$env:LOCALAPPDATA/mpremote/config.py``
498+
499+
The ``config.py``` file should define a dictionary named ``commands``. The keys of this dictionary are the shortcuts
493500
and the values are either a string or a list-of-strings:
494501

495502
.. code-block:: python3

0 commit comments

Comments
 (0)