ghcitui/MANUAL.rst

135 lines
4.0 KiB
ReStructuredText
Raw Normal View History

2023-12-10 05:11:02 +03:00
==============
GHCiTUI MANUAL
==============
2023-10-28 11:09:52 +03:00
------------
2023-12-10 05:11:02 +03:00
CLI Synopsis
2023-10-28 11:09:52 +03:00
------------
2023-12-10 05:11:02 +03:00
.. code-block::
Usage: ghcitui [-d|--debug-console] [-c|--cmd CMD] [-C|--workdir DIR] [TARGET]
ghcitui: A TUI interface for GHCi
Available options:
-h,--help Show this help text
-d,--debug-console Display the debug console
-c,--cmd CMD Command to start the internal interpreter
-C,--workdir DIR Set working dir
---------------------
Starting and Stopping
---------------------
********
Starting
********
GHCiTUI runs a REPL in the current directory by default. By default, it
launches ``cabal repl``.
.. code-block:: bash
$ cd your/cabal/project/root/directory
$ ghcitui
You can specify another starting directory with the ``-C <DIR>`` flag.
.. code-block:: bash
$ ghcitui -C some/other/directory
********
Stopping
********
To quit, press ``<ESC>`` or ``q`` while in the code viewport panel to quit.
While not in the code viewport panel, you may press ``<ESC>`` to get to the
viewport panel.
------
Layout
------
2023-10-28 11:09:52 +03:00
GHCiTUI is an in-terminal viewer for GHCi. The TUI is broken up into three
primary panels, with some additional auxiliary panels for special use cases:
::
┌──────────────────┬──────┐
│ │ Info │
│ │ │
│ Source Viewer │ │
│ │ │
│ │ │
├──────────────────┤ │
│ │ │
│ Live Interpreter │ │
│ │ │
└──────────────────┴──────┘
**Source Viewer:** This panel shows source code. You can step, continue,
and toggle breakpoints among other operations in this panel.
**Live Interpreter:** This panel shows the GHCi/REPL passthrough. You can
2023-12-10 05:11:02 +03:00
enter expressions and GHCi commands here like you would normally, with some
additional keybindings.
2023-10-28 11:09:52 +03:00
**Info:** This panel displays miscellaneous info about whatever is
2023-12-10 05:11:02 +03:00
currently running. For example, it can display the current bindings, loaded
modules, and the current program trace.
2023-10-28 11:09:52 +03:00
----------
Navigation
----------
At any point in time, you can revert back to the Source Viewer panel with the
``<Esc>`` key, and you can always quit by hitting ``<Esc>`` in the Source Viewer
panel.
2023-12-10 05:11:02 +03:00
-----------
Keybindings
-----------
2023-10-28 11:09:52 +03:00
2023-12-10 05:11:02 +03:00
At this time, keybindings are hardcoded. This will hopefully change in the
future with a keybinding configuration file.
2023-10-28 11:09:52 +03:00
*************
Source Viewer
*************
2023-12-10 05:11:02 +03:00
- ``Ctrl+x``: Toggle between the Source Viewer and the Live Interpreter
2023-10-28 11:09:52 +03:00
panels.
- ``<Esc>``, ``q``: Quit.
2023-12-10 05:11:02 +03:00
- ``Up``, ``k``: Move the cursor up. (``j`` and ``k`` from Vim keybinds)
- ``Down``, ``j``: Move the cursor down. (``j`` and ``k`` from Vim keybinds).
2023-10-28 11:09:52 +03:00
- ``PgUp``: Move the source viewer one page up.
- ``PgDown``: Move the source viewer one page down.
- ``+``, ``-``: Increase/decrease the Info panel size.
2023-10-28 11:09:52 +03:00
- ``b``: Toggle breakpoint at current line. Not every line in a source file can
have a breakpoint placed on it.
- ``s``: Advance execution by one step. Same as the ``:step`` in GHCi.
- ``c``: Advance execution until next breakpoint. Same as ``:continue`` in
GHCi.
2023-12-10 05:11:02 +03:00
- ``t``: Advance execution until next breakpoint under tracing. Same as
``:trace`` in GHCi.
2023-10-28 11:09:52 +03:00
***********************
Live Interpreter (REPL)
***********************
2023-12-10 05:11:02 +03:00
- ``Ctrl+x``: Toggle between the Source Viewer and the Live Interpreter
panels.
- ``<Esc>``: Switch to Source Viewer.
- ``Up``: Scroll back in time through the REPL command history.
- ``Down``: Scroll forward in time through the REPL command history.
- ``PgUp``: Scroll the Live Interpreter window one page up.
- ``PgDown``: Scroll the Live Interpreter window one page down.
- ``Ctrl+n``: Toggle scrolling mode.
- ``+``, ``-`` while in scrolling mode: Increase/decrease the live
panel size.
2023-12-10 05:11:02 +03:00
- ``<Enter>``: Enter a command to the REPL.