Skip to content

Commit

Permalink
;doc: ui: keys: updates, clarify period narrowing & shift arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Jul 7, 2024
1 parent 7020ed3 commit 2f7eae0
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions hledger-ui/hledger-ui.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,31 +102,9 @@ The cursor keys navigate:
Emacs-style (`CTRL-p`/`CTRL-n`/`CTRL-f`/`CTRL-b`)
and VI-style (`k`,`j`,`l`,`h`)
movement keys are also supported.
A tip: movement speed is limited by your keyboard repeat rate,
to move faster you may want to adjust it.
(If you're on a mac, the karabiner app is one way to do that.)

With shift pressed, the cursor keys adjust the report period,
limiting the transactions to be shown (by default, all are shown).
`SHIFT-DOWN/UP` steps downward and upward through these standard report period durations:
year, quarter, month, week, day.
Then, `SHIFT-LEFT/RIGHT` moves to the previous/next period.
`T` sets the report period to today.
With the `-w/--watch` option, when viewing a "current" period
(the current day, week, month, quarter, or year),
the period will move automatically to track the current date.
To set a non-standard period, you can use `/` and a `date:` query.

(Mac users: SHIFT-DOWN/UP keys do not work by default in Terminal, as of MacOS Monterey.
You can configure them as follows:
open Terminal,
press CMD-comma to open preferences,
click Profiles,
select your current terminal profile on the left,
click Keyboard on the right,
click + and add this for Shift-Down: `\033[1;2B`,
click + and add this for Shift-Up: `\033[1;2A`.
Press the Escape key to enter the `\033` part, you can't type it directly.)

(Tip: movement speed is limited by your keyboard repeat rate, to move faster you may want to adjust it.
On a mac, the Karabiner app is one way to do that.)

`/` lets you set a general filter query limiting the data shown,
using the same [query terms](hledger.html#queries) as in hledger and hledger-web.
Expand All @@ -140,6 +118,26 @@ both ordinary transactions recorded in the journal, and periodic
transactions generated by rule. `F` toggles forecast mode, in which
future/forecasted transactions are shown.

Pressing `SHIFT-DOWN` narrows the report period, and pressing `SHIFT-UP` expands it again.
When narrowed, the current report period is displayed in the header line,
pressing `SHIFT-LEFT` or `SHIFT-RIGHT` moves to the previous or next period,
and pressing `T` moves to the period containing today.
If you are using `-w/--watch` and viewing a narrowed period containing today,
the view will follow any changes in system date (moving to the period containing the new date).

You can also specify a non-standard period with `/` and a `date:` query;
in this case, the period is not movable with the arrow keys.

(Tip: arrow keys with Shift do not work out of the box in all terminal software.
Eg in Apple's Terminal, the SHIFT-DOWN and SHIFT-UP keys must be configured as follows:
in Terminal's preferences, click Profiles,
select your current profile on the left,
click Keyboard on the right,
click + and add this for SHIFT-DOWN: `\033[1;2B`,
click + and add this for SHIFT-UP: `\033[1;2A`. <!-- Press the Escape key to enter the `\033` part, you can't type it directly.) -->
In other terminals (Windows Terminal ?) you might need to configure SHIFT-RIGHT and SHIFT-LEFT
to emit `\033[1;2C` and `\033[1;2D` respectively.)

`ESCAPE` resets the UI state and jumps back to the top screen,
restoring the app's initial state at startup.
Or, it cancels minibuffer data entry or the help dialog.
Expand Down

0 comments on commit 2f7eae0

Please sign in to comment.