ghcitui/MANUAL.rst

172 lines
5.6 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 [--version] [--debug-console] [-v] [--daemon-log LOGFILE]
[-c|--cmd CMD] [-C|--workdir DIR] [TARGET]
2023-12-10 05:11:02 +03:00
ghcitui: A TUI interface for GHCi
Available options:
-h,--help Show this help text
--version Print the version number and exit
--debug-console Display the debug console
-v Set verbosity for output logs. Pass multiple times
(e.g -vvv) to increase the logging. Use --daemon-log
to specify where the logs go.
--daemon-log LOGFILE File path for debugging daemon logs. Used with -v.
Setting this to 'stdout' or 'stderr' sends logs to
each, respectively. Defaults to /tmp/ghcitui.log.
2023-12-10 05:11:02 +03:00
-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:
2023-12-31 02:18:56 +03:00
.. code-block::
2023-10-28 11:09:52 +03:00
┌──────────────────┬──────┐
│ │ 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.
On top of each panel is a label where the navigation key combination is located.
2024-01-15 23:45:43 +03:00
For example, the key combination above the Modules panel displays ``[M]``.
Pressing this key combination will move the focus to that 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-31 02:18:56 +03:00
- ``?``: Display help inside GHCiTUI.
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.
2024-01-15 23:45:43 +03:00
- ``M``: Switch to the module panel.
2023-10-28 11:09:52 +03:00
- ``<Esc>``, ``q``: Quit.
2023-12-31 02:18:56 +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).
- ``<PgUp>``: Move the source viewer one page up.
- ``<PgDown>``: Move the source viewer one page down.
- ``+``, ``-``: Increase/decrease the left panel sizes.
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.
- ``<Esc>`` while in scrolling mode: Exit scrolling mode.
2023-12-31 02:18:56 +03:00
- ``<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.
2024-02-11 06:53:25 +03:00
- ``<Tab>``: Autocomplete (yes there's basic autocomplete support)
2023-12-31 02:18:56 +03:00
*******
Modules
*******
- ``?``: Display help inside GHCiTUI.
- ``Ctrl+x``: Switch to the Live Interpreter.
2024-01-15 23:45:43 +03:00
- ``<Esc>``, ``C``: Switch to Source Viewer.
2023-12-31 02:18:56 +03:00
- ``<Up>``, ``k``: Move the module selection up.
- ``<Down>``, ``j``: Move the module selection down.
- ``+``, ``-``: Increase/decrease the info panel size.
- ``<Enter>``, ``o``: Open the selected module.
-------------------------------
Reporting Bugs/Feature Requests
-------------------------------
You can file bugs and feature requests both at:
https://github.com/CrystalSplitter/ghcitui/issues
Please check to see if the bug/request already exists before filing
a new one.