hledger-ui 1.23 → 1.24
raw patch · 13 files changed
+598/−409 lines, 13 filesdep +doclayoutdep −base-compat-batteriesdep ~hledgerdep ~hledger-lib
Dependencies added: doclayout
Dependencies removed: base-compat-batteries
Dependency ranges changed: hledger, hledger-lib
Files
- CHANGES.md +40/−0
- Hledger/UI/AccountsScreen.hs +59/−34
- Hledger/UI/Main.hs +14/−7
- Hledger/UI/RegisterScreen.hs +50/−21
- Hledger/UI/TransactionScreen.hs +38/−19
- Hledger/UI/UIOptions.hs +1/−1
- Hledger/UI/UIState.hs +8/−8
- Hledger/UI/UITypes.hs +2/−1
- Hledger/UI/UIUtils.hs +38/−17
- hledger-ui.1 +33/−19
- hledger-ui.cabal +6/−6
- hledger-ui.info +267/−249
- hledger-ui.txt +42/−27
CHANGES.md view
@@ -9,6 +9,46 @@ User-visible changes in hledger-ui. See also the hledger changelog. +# 1.24 2021-12-01++Features++- hledger-ui can now be controlled with mouse or touchpad.+ Click to enter things, click left margin or bottom blank area to return to+ previous screen, and use mouse wheel / swipe to scroll.++- In addition to accounts with postings, hledger-ui now also shows+ declared accounts, even if they are empty (just leaf accounts, not+ parents). The idea is to show a useful list of accounts out of the+ box, when all you have is a starter file with account declarations.++Improvements++- The `Z` key for toggling display of zeroes is now the easier lower-case `z`.++- The `--watch` feature now has a convenient short flag flag, `-w`.++- Drop the base-compat-batteries dependency. (Stephen Morgan)++- Allow megaparsec 9.2++Fixes++- When an invalid regular expression is entered at the `/` (filter) prompt,+ we now display an error instead of silently ignoring it.+ (#1394, Stephen Morgan)++- Entering the register screen now always positions the selection mid-screen.+ Previously it would be at bottom of screen on the first entry.++- Report layout in the terminal is now robust with more kinds of wide+ characters, such as emoji.+ (#895, Stephen Morgan)+ + + ++ # 1.23 2021-09-21 Improvements
Hledger/UI/AccountsScreen.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NamedFieldPuns #-} module Hledger.UI.AccountsScreen (accountsScreen@@ -12,20 +13,20 @@ import Brick import Brick.Widgets.List- (handleListEvent, list, listElementsL, listMoveDown, listMoveTo, listNameL, listSelectedElement, listSelectedL, renderList) import Brick.Widgets.Edit import Control.Monad import Control.Monad.IO.Class (liftIO)-import Data.List+import Data.List hiding (reverse) import Data.Maybe import qualified Data.Text as T import Data.Time.Calendar (Day) import qualified Data.Vector as V-import Graphics.Vty (Event(..),Key(..),Modifier(..))+import Graphics.Vty (Event(..),Key(..),Modifier(..), Button (BLeft, BScrollDown, BScrollUp)) import Lens.Micro.Platform import Safe import System.Console.ANSI import System.FilePath (takeFileName)+import Text.DocLayout (realLength) import Hledger import Hledger.Cli hiding (progname,prognameandversion)@@ -36,6 +37,7 @@ import Hledger.UI.Editor import Hledger.UI.RegisterScreen import Hledger.UI.ErrorScreen+import Data.Vector ((!?)) accountsScreen :: Screen@@ -76,8 +78,11 @@ where as = map asItemAccountName displayitems - -- Further restrict the query based on the current period and future/forecast mode.- rspec' = reportSpecSetFutureAndForecast d (forecast_ $ inputopts_ copts) rspec+ rspec' =+ -- Further restrict the query based on the current period and future/forecast mode.+ (reportSpecSetFutureAndForecast d (forecast_ $ inputopts_ copts) rspec)+ -- always show declared accounts even if unused+ {_rsReportOpts=ropts{declared_=True}} -- run the report (items,_total) = balanceReport rspec' j@@ -122,7 +127,7 @@ - 2 -- XXX due to margin ? shouldn't be necessary (cf UIUtils) displayitems = s ^. asList . listElementsL - acctwidths = V.map (\AccountsScreenItem{..} -> asItemIndentLevel + Hledger.Cli.textWidth asItemDisplayAccountName) displayitems+ acctwidths = V.map (\AccountsScreenItem{..} -> asItemIndentLevel + realLength asItemDisplayAccountName) displayitems balwidths = V.map (maybe 0 (wbWidth . showMixedAmountB oneLine) . asItemMixedAmount) displayitems preferredacctwidth = V.maximum acctwidths totalacctwidthseen = V.sum acctwidths@@ -178,8 +183,8 @@ nonblanks = V.takeWhile (not . T.null . asItemAccountName) $ s ^. asList . listElementsL bottomlabel = case mode of- Minibuffer ed -> minibuffer ed- _ -> quickhelp+ Minibuffer label ed -> minibuffer label ed+ _ -> quickhelp where quickhelp = borderKeysStr' [ ("?", str "help")@@ -240,15 +245,18 @@ ui = ui0{aScreen=scr & asSelectedAccount .~ selacct} case mode of- Minibuffer ed ->+ Minibuffer _ ed -> case ev of VtyEvent (EvKey KEsc []) -> continue $ closeMinibuffer ui- VtyEvent (EvKey KEnter []) -> continue $ regenerateScreens j d $ setFilter s $ closeMinibuffer ui- where s = chomp $ unlines $ map strip $ getEditContents ed+ VtyEvent (EvKey KEnter []) -> continue $ regenerateScreens j d $+ case setFilter s $ closeMinibuffer ui of+ Left bad -> showMinibuffer "Cannot compile regular expression" (Just bad) ui+ Right ui' -> ui'+ where s = chomp $ unlines $ map strip $ getEditContents ed VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui VtyEvent ev -> do ed' <- handleEditorEvent ev ed- continue $ ui{aMode=Minibuffer ed'}+ continue $ ui{aMode=Minibuffer "filter" ed'} AppEvent _ -> continue ui MouseDown{} -> continue ui MouseUp{} -> continue ui@@ -298,7 +306,7 @@ -- display mode/query toggles VtyEvent (EvKey (KChar 'H') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleHistorical ui VtyEvent (EvKey (KChar 't') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleTree ui- VtyEvent (EvKey (KChar 'Z') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleEmpty ui+ VtyEvent (EvKey (KChar c) []) | c `elem` ['z','Z'] -> asCenterAndContinue $ regenerateScreens j d $ toggleEmpty ui VtyEvent (EvKey (KChar 'R') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleReal ui VtyEvent (EvKey (KChar 'U') []) -> asCenterAndContinue $ regenerateScreens j d $ toggleUnmarked ui VtyEvent (EvKey (KChar 'P') []) -> asCenterAndContinue $ regenerateScreens j d $ togglePending ui@@ -309,7 +317,7 @@ VtyEvent (EvKey (KUp) [MShift]) -> continue $ regenerateScreens j d $ growReportPeriod d ui VtyEvent (EvKey (KRight) [MShift]) -> continue $ regenerateScreens j d $ nextReportPeriod journalspan ui VtyEvent (EvKey (KLeft) [MShift]) -> continue $ regenerateScreens j d $ previousReportPeriod journalspan ui- VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer ui+ VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer "filter" Nothing ui VtyEvent (EvKey k []) | k `elem` [KBS, KDel] -> (continue $ regenerateScreens j d $ resetFilter ui) VtyEvent e | e `elem` moveLeftEvents -> continue $ popScreen ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> scrollSelectionToMiddle _asList >> redraw ui@@ -318,25 +326,30 @@ -- enter register screen for selected account (if there is one), -- centering its selected transaction if possible VtyEvent e | e `elem` moveRightEvents- , not $ isBlankElement $ listSelectedElement _asList->- -- TODO center selection after entering register screen; neither of these works till second time entering; easy strictifications didn't help- rsCenterAndContinue $- -- flip rsHandle (VtyEvent (EvKey (KChar 'l') [MCtrl])) $- screenEnter d regscr ui- where- regscr = rsSetAccount selacct isdepthclipped registerScreen- isdepthclipped = case getDepth ui of- Just d -> accountNameLevel selacct >= d- Nothing -> False+ , not $ isBlankElement $ listSelectedElement _asList -> asEnterRegister d selacct ui - -- prevent moving down over blank padding items;- -- instead scroll down by one, until maximally scrolled - shows the end has been reached- VtyEvent (EvKey (KDown) []) | isBlankElement mnextelement -> do- vScrollBy (viewportScroll $ _asList^.listNameL) 1- continue ui- where- mnextelement = listSelectedElement $ listMoveDown _asList+ -- MouseDown is sometimes duplicated, https://github.com/jtdaugherty/brick/issues/347+ -- just use it to move the selection+ MouseDown _n BLeft _mods Location{loc=(_x,y)} | not $ (=="") clickedacct -> do+ continue ui{aScreen=scr{_asList=listMoveTo y _asList}}+ where clickedacct = maybe "" asItemAccountName $ listElements _asList !? y+ -- and on MouseUp, enter the subscreen+ MouseUp _n (Just BLeft) Location{loc=(_x,y)} | not $ (=="") clickedacct -> do+ asEnterRegister d clickedacct ui+ where clickedacct = maybe "" asItemAccountName $ listElements _asList !? y + -- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled+ VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do+ vScrollBy (viewportScroll $ _asList^.listNameL) 1 >> continue ui+ where mnextelement = listSelectedElement $ listMoveDown _asList++ -- mouse scroll wheel scrolls the viewport up or down to its maximum extent,+ -- pushing the selection when necessary.+ MouseDown name btn _mods _loc | btn `elem` [BScrollUp, BScrollDown] -> do+ let scrollamt = if btn==BScrollUp then -1 else 1+ list' <- listScrollPushingSelection name _asList (asListSize _asList) scrollamt+ continue ui{aScreen=scr{_asList=list'}}+ -- if page down or end leads to a blank padding item, stop at last non-blank VtyEvent e@(EvKey k []) | k `elem` [KPageDown, KEnd] -> do list <- handleListEvent e _asList@@ -355,15 +368,25 @@ & asSelectedAccount .~ selacct } - AppEvent _ -> continue ui- MouseDown{} -> continue ui- MouseUp{} -> continue ui+ MouseDown{} -> continue ui+ MouseUp{} -> continue ui+ AppEvent _ -> continue ui where journalspan = journalDateSpan False j asHandle _ _ = error "event handler called with wrong screen type, should not happen" -- PARTIAL: +asEnterRegister d selacct ui = do+ rsCenterAndContinue $+ -- flip rsHandle (VtyEvent (EvKey (KChar 'l') [MCtrl])) $+ screenEnter d regscr ui+ where+ regscr = rsSetAccount selacct isdepthclipped registerScreen+ isdepthclipped = case getDepth ui of+ Just d -> accountNameLevel selacct >= d+ Nothing -> False+ asSetSelectedAccount a s@AccountsScreen{} = s & asSelectedAccount .~ a asSetSelectedAccount _ s = s @@ -372,3 +395,5 @@ asCenterAndContinue ui = do scrollSelectionToMiddle $ _asList $ aScreen ui continue ui++asListSize = V.length . V.takeWhile ((/="").asItemAccountName) . listElements
Hledger/UI/Main.hs view
@@ -17,7 +17,7 @@ import Data.List.Extra (nubSort) import Data.Maybe (fromMaybe) import qualified Data.Text as T-import Graphics.Vty (mkVty)+import Graphics.Vty (mkVty, Mode (Mouse), Vty (outputIface), Output (setMode)) import Lens.Micro ((^.)) import System.Directory (canonicalizePath) import System.FilePath (takeDirectory)@@ -168,9 +168,17 @@ -- print (length (show ui)) >> exitSuccess -- show any debug output to this point & quit + let + -- helper: make a Vty terminal controller with mouse support enabled+ makevty = do+ v <- mkVty mempty+ setMode (outputIface v) Mouse True+ return v+ if not (uoWatch uopts')- then- void $ Brick.defaultMain brickapp ui+ then do+ vty <- makevty+ void $ customMain vty makevty Nothing brickapp ui else do -- a channel for sending misc. events to the app@@ -228,7 +236,6 @@ writeChan eventChan FileChange ) - -- and start the app. Must be inside the withManager block- let mkvty = mkVty mempty- vty0 <- mkvty- void $ customMain vty0 mkvty (Just eventChan) brickapp ui+ -- and start the app. Must be inside the withManager block. (XXX makevty too ?)+ vty <- makevty+ void $ customMain vty makevty (Just eventChan) brickapp ui
Hledger/UI/RegisterScreen.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NamedFieldPuns #-} module Hledger.UI.RegisterScreen (registerScreen@@ -19,10 +20,9 @@ import qualified Data.Text as T import Data.Time.Calendar import qualified Data.Vector as V-import Graphics.Vty (Event(..),Key(..),Modifier(..))+import Graphics.Vty (Event(..),Key(..),Modifier(..), Button (BLeft, BScrollDown, BScrollUp)) import Brick-import Brick.Widgets.List- (handleListEvent, list, listElementsL, listMoveDown, listMoveTo, listNameL, listSelectedElement, listSelectedL, renderList)+import Brick.Widgets.List hiding (reverse) import Brick.Widgets.Edit import Lens.Micro.Platform import Safe@@ -39,6 +39,7 @@ import Hledger.UI.Editor import Hledger.UI.TransactionScreen import Hledger.UI.ErrorScreen+import Data.Vector ((!?)) registerScreen :: Screen registerScreen = RegisterScreen{@@ -72,6 +73,7 @@ -- always show historical balance -- , balanceaccum_= Historical }+ wd = whichDate ropts' rspec' = reportSpecSetFutureAndForecast d (forecast_ $ inputopts_ copts) . either (error "rsInit: adjusting the query for register, should not have failed") id $ -- PARTIAL: updateReportSpec ropts' rspec{_rsDay=d}@@ -84,7 +86,7 @@ displayitems = map displayitem items' where displayitem (t, _, _issplit, otheracctsstr, change, bal) =- RegisterScreenItem{rsItemDate = showDate $ transactionRegisterDate (_rsQuery rspec') thisacctq t+ RegisterScreenItem{rsItemDate = showDate $ transactionRegisterDate wd (_rsQuery rspec') thisacctq t ,rsItemStatus = tstatus t ,rsItemDescription = tdescription t ,rsItemOtherAccounts = otheracctsstr@@ -225,8 +227,8 @@ -- query = query_ $ reportopts_ $ cliopts_ opts bottomlabel = case mode of- Minibuffer ed -> minibuffer ed- _ -> quickhelp+ Minibuffer label ed -> minibuffer label ed+ _ -> quickhelp where quickhelp = borderKeysStr' [ ("?", str "help")@@ -286,15 +288,19 @@ lastnonblankidx = max 0 (length nonblanks - 1) case mode of- Minibuffer ed ->+ Minibuffer _ ed -> case ev of VtyEvent (EvKey KEsc []) -> continue $ closeMinibuffer ui- VtyEvent (EvKey KEnter []) -> continue $ regenerateScreens j d $ setFilter s $ closeMinibuffer ui- where s = chomp $ unlines $ map strip $ getEditContents ed+ VtyEvent (EvKey KEnter []) -> continue $ regenerateScreens j d $+ case setFilter s $ closeMinibuffer ui of+ Left bad -> showMinibuffer "Cannot compile regular expression" (Just bad) ui+ Right ui' -> ui'+ where s = chomp . unlines . map strip $ getEditContents ed+ -- VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui VtyEvent ev -> do ed' <- handleEditorEvent ev ed- continue $ ui{aMode=Minibuffer ed'}+ continue $ ui{aMode=Minibuffer "filter" ed'} AppEvent _ -> continue ui MouseDown{} -> continue ui MouseUp{} -> continue ui@@ -333,37 +339,58 @@ VtyEvent (EvKey (KChar 'V') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleValue ui VtyEvent (EvKey (KChar 'H') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleHistorical ui VtyEvent (EvKey (KChar 't') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleTree ui- VtyEvent (EvKey (KChar 'Z') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleEmpty ui+ VtyEvent (EvKey (KChar c) []) | c `elem` ['z','Z'] -> rsCenterAndContinue $ regenerateScreens j d $ toggleEmpty ui VtyEvent (EvKey (KChar 'R') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleReal ui VtyEvent (EvKey (KChar 'U') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleUnmarked ui VtyEvent (EvKey (KChar 'P') []) -> rsCenterAndContinue $ regenerateScreens j d $ togglePending ui VtyEvent (EvKey (KChar 'C') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleCleared ui VtyEvent (EvKey (KChar 'F') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleForecast d ui - VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer ui+ VtyEvent (EvKey (KChar '/') []) -> continue $ regenerateScreens j d $ showMinibuffer "filter" Nothing ui VtyEvent (EvKey (KDown) [MShift]) -> continue $ regenerateScreens j d $ shrinkReportPeriod d ui VtyEvent (EvKey (KUp) [MShift]) -> continue $ regenerateScreens j d $ growReportPeriod d ui VtyEvent (EvKey (KRight) [MShift]) -> continue $ regenerateScreens j d $ nextReportPeriod journalspan ui VtyEvent (EvKey (KLeft) [MShift]) -> continue $ regenerateScreens j d $ previousReportPeriod journalspan ui VtyEvent (EvKey k []) | k `elem` [KBS, KDel] -> (continue $ regenerateScreens j d $ resetFilter ui)- VtyEvent e | e `elem` moveLeftEvents -> continue $ popScreen ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> scrollSelectionToMiddle rsList >> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui - -- enter transaction screen for selected transaction+ -- exit screen on LEFT+ VtyEvent e | e `elem` moveLeftEvents -> continue $ popScreen ui+ -- or on a click in the app's left margin. This is a VtyEvent since not in a clickable widget.+ VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> continue $ popScreen ui+ -- or on clicking a blank list item.+ MouseUp _ (Just BLeft) Location{loc=(_,y)} | clickeddate == "" -> continue $ popScreen ui+ where clickeddate = maybe "" rsItemDate $ listElements rsList !? y++ -- enter transaction screen on RIGHT VtyEvent e | e `elem` moveRightEvents -> case listSelectedElement rsList of Just _ -> continue $ screenEnter d transactionScreen{tsAccount=rsAccount} ui Nothing -> continue ui+ -- or on transaction click+ -- MouseDown is sometimes duplicated, https://github.com/jtdaugherty/brick/issues/347+ -- just use it to move the selection+ MouseDown _n BLeft _mods Location{loc=(_x,y)} | not $ (=="") clickeddate -> do+ continue $ ui{aScreen=s{rsList=listMoveTo y rsList}}+ where clickeddate = maybe "" rsItemDate $ listElements rsList !? y+ -- and on MouseUp, enter the subscreen+ MouseUp _n (Just BLeft) Location{loc=(_x,y)} | not $ (=="") clickeddate -> do+ continue $ screenEnter d transactionScreen{tsAccount=rsAccount} ui+ where clickeddate = maybe "" rsItemDate $ listElements rsList !? y - -- prevent moving down over blank padding items;- -- instead scroll down by one, until maximally scrolled - shows the end has been reached+ -- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do- vScrollBy (viewportScroll $ rsList^.listNameL) 1- continue ui- where- mnextelement = listSelectedElement $ listMoveDown rsList+ vScrollBy (viewportScroll $ rsList ^. listNameL) 1 >> continue ui+ where mnextelement = listSelectedElement $ listMoveDown rsList + -- mouse scroll wheel scrolls the viewport up or down to its maximum extent,+ -- pushing the selection when necessary.+ MouseDown name btn _mods _loc | btn `elem` [BScrollUp, BScrollDown] -> do+ let scrollamt = if btn==BScrollUp then -1 else 1+ list' <- listScrollPushingSelection name rsList (rsListSize rsList) scrollamt+ continue ui{aScreen=s{rsList=list'}}+ -- if page down or end leads to a blank padding item, stop at last non-blank VtyEvent e@(EvKey k []) | k `elem` [KPageDown, KEnd] -> do list <- handleListEvent e rsList@@ -381,9 +408,9 @@ newitems <- handleListEvent ev' rsList continue ui{aScreen=s{rsList=newitems}} - AppEvent _ -> continue ui MouseDown{} -> continue ui MouseUp{} -> continue ui+ AppEvent _ -> continue ui rsHandle _ _ = error "event handler called with wrong screen type, should not happen" -- PARTIAL: @@ -392,3 +419,5 @@ rsCenterAndContinue ui = do scrollSelectionToMiddle $ rsList $ aScreen ui continue ui++rsListSize = V.length . V.takeWhile ((/="").rsItemDate) . listElements
Hledger/UI/TransactionScreen.hs view
@@ -15,7 +15,7 @@ import qualified Data.Text as T import Data.Time.Calendar (Day) import qualified Data.Vector as V-import Graphics.Vty (Event(..),Key(..),Modifier(..))+import Graphics.Vty (Event(..),Key(..),Modifier(..), Button (BLeft)) import Lens.Micro ((^.)) import Brick import Brick.Widgets.List (listElementsL, listMoveTo, listSelectedElement)@@ -29,6 +29,7 @@ import Hledger.UI.UIUtils import Hledger.UI.Editor import Hledger.UI.ErrorScreen+import Brick.Widgets.Edit (editorText, renderEditor) transactionScreen :: Screen transactionScreen = TransactionScreen{@@ -59,6 +60,22 @@ _ -> (t, nts) tsInit _ _ _ = error "init function called with wrong screen type, should not happen" -- PARTIAL: +-- Render a transaction suitably for the transaction screen.+showTxn :: ReportOpts -> ReportSpec -> Journal -> Transaction -> T.Text+showTxn ropts rspec j t =+ showTransactionOneLineAmounts+ $ maybe id (transactionApplyValuation prices styles periodlast (_rsDay rspec)) (value_ ropts)+ $ case cost_ ropts of+ Cost -> transactionToCost styles t+ NoCost -> t+ -- (if real_ ropts then filterTransactionPostings (Real True) else id) -- filter postings by --real+ where+ prices = journalPriceOracle (infer_prices_ ropts) j+ styles = journalCommodityStyles j+ periodlast =+ fromMaybe (error' "TransactionScreen: expected a non-empty journal") $ -- PARTIAL: shouldn't happen+ reportPeriodOrJournalLastDay rspec j+ tsDraw :: UIState -> [Widget Name] tsDraw UIState{aopts=UIOpts{uoCliOpts=copts@CliOpts{reportspec_=rspec@ReportSpec{_rsReportOpts=ropts}}} ,ajournal=j@@ -73,24 +90,18 @@ -- Minibuffer e -> [minibuffer e, maincontent] _ -> [maincontent] where- -- as with print, show amounts with all of their decimal places- t = transactionMapPostingAmounts mixedAmountSetFullPrecision t'- maincontent = Widget Greedy Greedy $ do- let- prices = journalPriceOracle (infer_prices_ ropts) j- styles = journalCommodityStyles j- periodlast =- fromMaybe (error' "TransactionScreen: expected a non-empty journal") $ -- PARTIAL: shouldn't happen- reportPeriodOrJournalLastDay rspec j-- render . defaultLayout toplabel bottomlabel . str- . T.unpack . showTransactionOneLineAmounts- . maybe id (transactionApplyValuation prices styles periodlast (_rsDay rspec)) (value_ ropts)- $ case cost_ ropts of- Cost -> transactionToCost styles t- NoCost -> t- -- (if real_ ropts then filterTransactionPostings (Real True) else id) -- filter postings by --real+ maincontent = Widget Greedy Greedy $ render $ defaultLayout toplabel bottomlabel txneditor where+ -- as with print, show amounts with all of their decimal places+ t = transactionMapPostingAmounts mixedAmountSetFullPrecision t'++ -- XXX would like to shrink the editor to the size of the entry,+ -- so handler can more easily detect clicks below it+ txneditor = + renderEditor (vBox . map txt) False $ + editorText TransactionEditor Nothing $ + showTxn ropts rspec j t+ toplabel = str "Transaction " -- <+> withAttr ("border" <> "bold") (str $ "#" ++ show (tindex t))@@ -133,7 +144,7 @@ tsHandle :: UIState -> BrickEvent Name AppEvent -> EventM Name (Next UIState) tsHandle ui@UIState{aScreen=TransactionScreen{tsTransaction=(i,t), tsTransactions=nts}- ,aopts=UIOpts{uoCliOpts=copts}+ ,aopts=UIOpts{uoCliOpts=copts@CliOpts{reportspec_=rspec@ReportSpec{_rsReportOpts=ropts}}} ,ajournal=j ,aMode=mode }@@ -181,7 +192,15 @@ VtyEvent e | e `elem` moveUpEvents -> continue $ tsSelect iprev tprev ui VtyEvent e | e `elem` moveDownEvents -> continue $ tsSelect inext tnext ui++ -- exit screen on LEFT VtyEvent e | e `elem` moveLeftEvents -> continue . popScreen $ tsSelect i t ui -- Probably not necessary to tsSelect here, but it's safe.+ -- or on a click in the app's left margin.+ VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> continue . popScreen $ tsSelect i t ui+ -- or on clicking the blank area below the transaction.+ MouseUp _ (Just BLeft) Location{loc=(_,y)} | y+1 > numentrylines -> continue . popScreen $ tsSelect i t ui+ where numentrylines = length (T.lines $ showTxn ropts rspec j t) - 1+ VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui _ -> continue ui
Hledger/UI/UIOptions.hs view
@@ -33,7 +33,7 @@ uiflags = [ -- flagNone ["debug-ui"] (setboolopt "rules-file") "run with no terminal output, showing console"- flagNone ["watch"] (setboolopt "watch") "watch for data and date changes and reload automatically"+ flagNone ["watch","w"] (setboolopt "watch") "watch for data and date changes and reload automatically" ,flagReq ["theme"] (\s opts -> Right $ setopt "theme" s opts) "THEME" ("use this custom display theme ("++intercalate ", " themeNames++")") ,flagReq ["register"] (\s opts -> Right $ setopt "register" s opts) "ACCTREGEX" "start in the (first) matched account's register" ,flagNone ["change"] (setboolopt "change")
Hledger/UI/UIState.hs view
@@ -7,9 +7,11 @@ where import Brick.Widgets.Edit+import Data.Bifunctor (first) import Data.Foldable (asum) import Data.Either (fromRight) import Data.List ((\\), foldl', sort)+import Data.Maybe (fromMaybe) import Data.Semigroup (Max(..)) import qualified Data.Text as T import Data.Text.Zipper (gotoEOL)@@ -205,11 +207,9 @@ updateReportPeriod updatePeriod = fromRight err . overEither period updatePeriod -- PARTIAL: where err = error "updateReportPeriod: updating period should not result in an error" --- | Apply a new filter query.-setFilter :: String -> UIState -> UIState-setFilter s = over reportSpec update- where- update rspec = fromRight rspec $ setEither querystring (words'' prefixes $ T.pack s) rspec -- XXX silently ignores an error+-- | Apply a new filter query, or return the failing query.+setFilter :: String -> UIState -> Either String UIState+setFilter s = first (const s) . setEither querystring (words'' prefixes $ T.pack s) -- | Reset some filters & toggles. resetFilter :: UIState -> UIState@@ -264,11 +264,11 @@ | otherwise = Just d -- | Open the minibuffer, setting its content to the current query with the cursor at the end.-showMinibuffer :: UIState -> UIState-showMinibuffer ui = setMode (Minibuffer e) ui+showMinibuffer :: T.Text -> Maybe String -> UIState -> UIState+showMinibuffer label moldq ui = setMode (Minibuffer label e) ui where e = applyEdit gotoEOL $ editor MinibufferEditor (Just 1) oldq- oldq = T.unpack . T.unwords . map textQuoteIfNeeded $ ui^.querystring+ oldq = fromMaybe (T.unpack . T.unwords . map textQuoteIfNeeded $ ui^.querystring) moldq -- | Close the minibuffer, discarding any edit in progress. closeMinibuffer :: UIState -> UIState
Hledger/UI/UITypes.hs view
@@ -69,7 +69,7 @@ data Mode = Normal | Help- | Minibuffer (Editor String Name)+ | Minibuffer Text (Editor String Name) deriving (Show,Eq) -- Ignore the editor when comparing Modes.@@ -83,6 +83,7 @@ | AccountsList | RegisterViewport | RegisterList+ | TransactionEditor deriving (Ord, Show, Eq) data AppEvent =
Hledger/UI/UIUtils.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NamedFieldPuns #-} module Hledger.UI.UIUtils ( borderDepthStr@@ -25,7 +26,8 @@ ,suspend ,redraw ,reportSpecSetFutureAndForecast-)+ ,listScrollPushingSelection+ ) where import Brick@@ -33,14 +35,14 @@ import Brick.Widgets.Border.Style import Brick.Widgets.Dialog import Brick.Widgets.Edit-import Brick.Widgets.List (List, listSelectedL, listNameL, listItemHeightL)+import Brick.Widgets.List (List, listSelectedL, listNameL, listItemHeightL, listSelected, listMoveDown, listMoveUp, GenericList, Splittable) import Control.Monad.IO.Class import Data.Bifunctor (second) import Data.List import qualified Data.Text as T import Data.Time (Day, addDays) import Graphics.Vty- (Event(..),Key(..),Modifier(..),Vty(..),Color,Attr,currentAttr,refresh+ (Event(..),Key(..),Modifier(..),Vty(..),Color,Attr,currentAttr,refresh, displayBounds -- ,Output(displayBounds,mkDisplayContext),DisplayContext(..) ) import Lens.Micro.Platform@@ -123,7 +125,7 @@ ,renderKey ("/ ", "set a filter query") ,renderKey ("F ", "show future & periodic txns") ,renderKey ("R ", "show real/all postings")- ,renderKey ("Z ", "show nonzero/all amounts")+ ,renderKey ("z ", "show nonzero/all amounts") ,renderKey ("U/P/C ", "show unmarked/pending/cleared") ,renderKey ("S-DOWN /S-UP ", "shrink/grow period") ,renderKey ("S-RIGHT/S-LEFT", "next/previous period")@@ -174,11 +176,11 @@ ui' = setMode Normal ui closeHelpEvents = moveLeftEvents ++ [EvKey KEsc [], EvKey (KChar '?') [], EvKey (KChar 'q') []] --- | Draw the minibuffer.-minibuffer :: Editor String Name -> Widget Name-minibuffer ed =+-- | Draw the minibuffer with the given label.+minibuffer :: T.Text -> Editor String Name -> Widget Name+minibuffer string ed = forceAttr ("border" <> "minibuffer") $- hBox [txt "filter: ", renderEditor (str . unlines) True ed]+ hBox [txt $ string <> ": ", renderEditor (str . unlines) True ed] borderQueryStr :: String -> Widget Name borderQueryStr "" = str ""@@ -319,18 +321,16 @@ -- middle of the display area. scrollSelectionToMiddle :: List Name e -> EventM Name () scrollSelectionToMiddle list = do- let mselectedrow = list^.listSelectedL- vpname = list^.listNameL- mvp <- lookupViewport vpname- case (mselectedrow, mvp) of- (Just selectedrow, Just vp) -> do+ case list^.listSelectedL of+ Nothing -> return ()+ Just selectedrow -> do+ Vty{outputIface} <- getVtyHandle+ pageheight <- dbg4 "pageheight" . snd <$> liftIO (displayBounds outputIface) let itemheight = dbg4 "itemheight" $ list^.listItemHeightL- vpheight = dbg4 "vpheight" $ vp^.vpSize._2- itemsperpage = dbg4 "itemsperpage" $ vpheight `div` itemheight+ itemsperpage = dbg4 "itemsperpage" $ pageheight `div` itemheight toprow = dbg4 "toprow" $ max 0 (selectedrow - (itemsperpage `div` 2)) -- assuming ViewportScroll's row offset is measured in list items not screen rows- setTop (viewportScroll vpname) toprow- _ -> return ()+ setTop (viewportScroll $ list^.listNameL) toprow -- arrow keys vi keys emacs keys moveUpEvents = [EvKey KUp [] , EvKey (KChar 'k') [], EvKey (KChar 'p') [MCtrl]]@@ -360,3 +360,24 @@ Not (Date $ DateSpan (Just $ addDays 1 d) Nothing) ,Not generatedTransactionTag ]++-- Vertically scroll the named list's viewport with the given number of non-empty items+-- by the given positive or negative number of items (usually 1 or -1).+-- The selection will be moved when necessary to keep it visible and allow the scroll.+listScrollPushingSelection :: (Ord n, Foldable t, Splittable t) => + n -> GenericList n t e -> Int -> Int -> EventM n (GenericList n t e)+listScrollPushingSelection name list listheight scrollamt = do+ viewportScroll name `vScrollBy` scrollamt+ mvp <- lookupViewport name+ case mvp of+ Just VP{_vpTop, _vpSize=(_,vpheight)} -> do+ let mselidx = listSelected list+ case mselidx of+ Just selidx -> return $ pushsel list+ where+ pushsel + | scrollamt > 0, selidx <= _vpTop && selidx < (listheight-1) = listMoveDown+ | scrollamt < 0, selidx >= _vpTop + vpheight - 1 && selidx > 0 = listMoveUp+ | otherwise = id+ _ -> return list+ _ -> return list
hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER-UI" "1" "September 2021" "hledger-ui-1.23 " "hledger User Manuals"+.TH "HLEDGER-UI" "1" "December 2021" "hledger-ui-1.24 " "hledger User Manuals" @@ -7,7 +7,7 @@ .PP hledger-ui is a terminal interface (TUI) for the hledger accounting tool.-This manual is for hledger-ui 1.23.+This manual is for hledger-ui 1.24. .SH SYNOPSIS .PP \f[C]hledger-ui [OPTIONS] [QUERYARGS]\f[R]@@ -47,7 +47,7 @@ Any QUERYARGS are interpreted as a hledger search query which filters the data. .TP-\f[B]\f[CB]--watch\f[B]\f[R]+\f[B]\f[CB]-w --watch\f[B]\f[R] watch for data and date changes and reload automatically .TP \f[B]\f[CB]--theme=default|terminal|greenterm\f[B]\f[R]@@ -219,20 +219,33 @@ A \[at]FILE argument will be expanded to the contents of FILE, which should contain one command line option/argument per line. (To prevent this, insert a \f[C]--\f[R] argument before.)+.SH MOUSE+.PP+In most modern terminals, you can navigate through the screens with a+mouse or touchpad:+.IP \[bu] 2+Use mouse wheel or trackpad to scroll up and down+.IP \[bu] 2+Click on list items to go deeper+.IP \[bu] 2+Click on the left margin (column 0), or the blank area at bottom of+screen, to go back. .SH KEYS .PP+Keyboard gives more control.+.PP \f[C]?\f[R] shows a help dialog listing all keys. (Some of these also appear in the quick help at the bottom of each screen.) Press \f[C]?\f[R] again (or \f[C]ESCAPE\f[R], or \f[C]LEFT\f[R], or \f[C]q\f[R]) to close it. The following keys work on most screens: .PP-The cursor keys navigate: \f[C]right\f[R] (or \f[C]enter\f[R]) goes-deeper, \f[C]left\f[R] returns to the previous screen,-\f[C]up\f[R]/\f[C]down\f[R]/\f[C]page up\f[R]/\f[C]page down\f[R]/\f[C]home\f[R]/\f[C]end\f[R]+The cursor keys navigate: \f[C]RIGHT\f[R] goes deeper, \f[C]LEFT\f[R]+returns to the previous screen,+\f[C]UP\f[R]/\f[C]DOWN\f[R]/\f[C]PGUP\f[R]/\f[C]PGDN\f[R]/\f[C]HOME\f[R]/\f[C]END\f[R] move up and down through lists. Emacs-style-(\f[C]ctrl-p\f[R]/\f[C]ctrl-n\f[R]/\f[C]ctrl-f\f[R]/\f[C]ctrl-b\f[R])+(\f[C]CTRL-p\f[R]/\f[C]CTRL-n\f[R]/\f[C]CTRL-f\f[R]/\f[C]CTRL-b\f[R]) movement keys are also supported (but not vi-style keys, since hledger-1.19, sorry!). A tip: movement speed is limited by your keyboard repeat rate, to move@@ -241,11 +254,11 @@ .PP With shift pressed, the cursor keys adjust the report period, limiting the transactions to be shown (by default, all are shown).-\f[C]shift-down/up\f[R] steps downward and upward through these standard+\f[C]SHIFT-DOWN/UP\f[R] steps downward and upward through these standard report period durations: year, quarter, month, week, day.-Then, \f[C]shift-left/right\f[R] moves to the previous/next period.+Then, \f[C]SHIFT-LEFT/RIGHT\f[R] moves to the previous/next period. \f[C]T\f[R] sets the report period to today.-With the \f[C]--watch\f[R] option, when viewing a \[dq]current\[dq]+With the \f[C]-w/--watch\f[R] option, when viewing a \[dq]current\[dq] 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 \f[C]/\f[R] and a@@ -329,6 +342,8 @@ command. By default, it shows all accounts and their latest ending balances (including the balances of subaccounts).+Accounts which have been declared with an account directive are also+listed, even if not yet used (except for empty parent accounts). If you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. .PP@@ -369,12 +384,11 @@ .PP \f[C]R\f[R] toggles real mode, in which virtual postings are ignored. .PP-\f[C]Z\f[R] toggles nonzero mode, in which only accounts with nonzero+\f[C]z\f[R] toggles nonzero mode, in which only accounts with nonzero balances are shown (hledger-ui shows zero items by default, unlike command-line hledger). .PP-Press \f[C]right\f[R] or \f[C]enter\f[R] to view an account\[aq]s-transactions register.+Press \f[C]RIGHT\f[R] to view an account\[aq]s transactions register. .SS Register screen .PP This screen shows the transactions affecting a particular account, like@@ -416,12 +430,11 @@ .PP \f[C]R\f[R] toggles real mode, in which virtual postings are ignored. .PP-\f[C]Z\f[R] toggles nonzero mode, in which only transactions posting a+\f[C]z\f[R] toggles nonzero mode, in which only transactions posting a nonzero change are shown (hledger-ui shows zero items by default, unlike command-line hledger). .PP-Press \f[C]right\f[R] (or \f[C]enter\f[R]) to view the selected-transaction in detail.+Press \f[C]RIGHT\f[R] to view the selected transaction in detail. .SS Transaction screen .PP This screen shows a single transaction, as a general journal entry,@@ -433,7 +446,7 @@ Simple transactions have two postings, but there can be more (or in certain cases, fewer). .PP-\f[C]up\f[R] and \f[C]down\f[R] will step through all transactions+\f[C]UP\f[R] and \f[C]DOWN\f[R] will step through all transactions listed in the previous account register screen. In the title bar, the numbers in parentheses show your position within that account register.@@ -453,7 +466,7 @@ .SS Watch mode .PP One of hledger-ui\[aq]s best features is the auto-reloading-\f[C]--watch\f[R] mode.+\f[C]-w/--watch\f[R] mode. With this flag, it will update the display automatically whenever changes are saved to the data files. .PP@@ -560,7 +573,8 @@ until the program is restarted. .PP Also, if you are viewing files mounted from another machine,-\f[C]--watch\f[R] requires that both machine clocks are roughly in step.+\f[C]-w/--watch\f[R] requires that both machine clocks are roughly in+step. .SH "REPORTING BUGS"
hledger-ui.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-ui-version: 1.23+version: 1.24 synopsis: Curses-style terminal interface for the hledger accounting system description: A simple curses-style terminal user interface for the hledger accounting system. It can be a more convenient way to browse your accounts than the CLI.@@ -63,23 +63,23 @@ hs-source-dirs: ./ ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.23"+ cpp-options: -DVERSION="1.24" build-depends: ansi-terminal >=0.9 , async , base >=4.11 && <4.16- , base-compat-batteries >=0.10.1 && <0.12 , brick >=0.23 , cmdargs >=0.8 , containers >=0.5.9 , data-default , directory+ , doclayout ==0.3.* , extra >=1.6.3 , filepath , fsnotify >=0.2.1.2 && <0.4- , hledger ==1.23.*- , hledger-lib ==1.23.*- , megaparsec >=7.0.0 && <9.2+ , hledger ==1.24.*+ , hledger-lib ==1.24.*+ , megaparsec >=7.0.0 && <9.3 , microlens >=0.4 , microlens-platform >=0.2.3.1 , process >=1.2
hledger-ui.info view
@@ -1,4 +1,5 @@-This is hledger-ui.info, produced by makeinfo version 6.8 from stdin.+This is hledger-ui/hledger-ui.info, produced by makeinfo version 4.8+from stdin. INFO-DIR-SECTION User Applications START-INFO-DIR-ENTRY@@ -6,42 +7,43 @@ END-INFO-DIR-ENTRY -File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir)+File: hledger-ui.info, Node: Top, Up: (dir) hledger-ui(1) ************* hledger-ui is a terminal interface (TUI) for the hledger accounting-tool. This manual is for hledger-ui 1.23.+tool. This manual is for hledger-ui 1.24. - 'hledger-ui [OPTIONS] [QUERYARGS]'-'hledger ui -- [OPTIONS] [QUERYARGS]'+ `hledger-ui [OPTIONS] [QUERYARGS]'+`hledger ui -- [OPTIONS] [QUERYARGS]' hledger is a reliable, cross-platform set of programs for tracking money, time, or any other commodity, using double-entry accounting and a-simple, editable file format. hledger is inspired by and largely+simple, editable file format. hledger is inspired by and largely compatible with ledger(1). hledger-ui is hledger's terminal interface, providing an efficient full-window text UI for viewing accounts and transactions, and some-limited data entry capability. It is easier than hledger's command-line+limited data entry capability. It is easier than hledger's command-line interface, and sometimes quicker and more convenient than the web interface. Like hledger, it reads data from one or more files in hledger-journal, timeclock, timedot, or CSV format specified with '-f', or-'$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps-'C:/Users/USER/.hledger.journal'). For more about this see hledger(1),+journal, timeclock, timedot, or CSV format specified with `-f', or+`$LEDGER_FILE', or `$HOME/.hledger.journal' (on windows, perhaps+`C:/Users/USER/.hledger.journal'). For more about this see hledger(1), hledger_journal(5) etc. Unlike hledger, hledger-ui hides all future-dated transactions by-default. They can be revealed, along with any rule-generated periodic+default. They can be revealed, along with any rule-generated periodic transactions, by pressing the F key (or starting with -forecast) to enable "forecast mode". * Menu: * OPTIONS::+* MOUSE:: * KEYS:: * SCREENS:: * TIPS::@@ -50,163 +52,160 @@ * BUGS:: -File: hledger-ui.info, Node: OPTIONS, Next: KEYS, Prev: Top, Up: Top+File: hledger-ui.info, Node: OPTIONS, Next: MOUSE, Prev: Top, Up: Top 1 OPTIONS ********* -Note: if invoking hledger-ui as a hledger subcommand, write '--' before+Note: if invoking hledger-ui as a hledger subcommand, write `--' before options as shown above. Any QUERYARGS are interpreted as a hledger search query which filters the data. -'--watch'-+`-w --watch' watch for data and date changes and reload automatically-'--theme=default|terminal|greenterm' +`--theme=default|terminal|greenterm' use this custom display theme-'--register=ACCTREGEX' +`--register=ACCTREGEX' start in the (first) matched account's register screen-'--change' +`--change' show period balances (changes) at startup instead of historical balances-'-l --flat' +`-l --flat' show accounts as a flat list (default)-'-t --tree' +`-t --tree' show accounts as a tree hledger input options: -'-f FILE --file=FILE'-- use a different input file. For stdin, use - (default:- '$LEDGER_FILE' or '$HOME/.hledger.journal')-'--rules-file=RULESFILE'+`-f FILE --file=FILE'+ use a different input file. For stdin, use - (default:+ `$LEDGER_FILE' or `$HOME/.hledger.journal') +`--rules-file=RULESFILE' Conversion rules file to use when reading CSV (default: FILE.rules)-'--separator=CHAR' +`--separator=CHAR' Field separator to expect when reading CSV (default: ',')-'--alias=OLD=NEW' +`--alias=OLD=NEW' rename accounts named OLD to NEW-'--anon' +`--anon' anonymize accounts and payees-'--pivot FIELDNAME' +`--pivot FIELDNAME' use some other field or tag for the account name-'-I --ignore-assertions' +`-I --ignore-assertions' disable balance assertion checks (note: does not disable balance assignments)-'-s --strict' +`-s --strict' do extra error checking (check that all posted accounts are declared) hledger reporting options: -'-b --begin=DATE'-+`-b --begin=DATE' include postings/txns on or after this date (will be adjusted to preceding subperiod start when using a report interval)-'-e --end=DATE' +`-e --end=DATE' include postings/txns before this date (will be adjusted to following subperiod end when using a report interval)-'-D --daily' +`-D --daily' multiperiod/multicolumn report by day-'-W --weekly' +`-W --weekly' multiperiod/multicolumn report by week-'-M --monthly' +`-M --monthly' multiperiod/multicolumn report by month-'-Q --quarterly' +`-Q --quarterly' multiperiod/multicolumn report by quarter-'-Y --yearly' +`-Y --yearly' multiperiod/multicolumn report by year-'-p --period=PERIODEXP' +`-p --period=PERIODEXP' set start date, end date, and/or reporting interval all at once using period expressions syntax-'--date2' +`--date2' match the secondary date instead (see command help for other effects)-'--today=DATE' +`--today=DATE' override today's date (affects relative smart dates, for tests/examples)-'-U --unmarked' +`-U --unmarked' include only unmarked postings/txns (can combine with -P or -C)-'-P --pending' +`-P --pending' include only pending postings/txns-'-C --cleared' +`-C --cleared' include only cleared postings/txns-'-R --real' +`-R --real' include only non-virtual postings-'-NUM --depth=NUM' +`-NUM --depth=NUM' hide/aggregate accounts or postings more than NUM levels deep-'-E --empty' +`-E --empty' show items with zero amount, normally hidden (and vice-versa in hledger-ui/hledger-web)-'-B --cost' +`-B --cost' convert amounts to their cost/selling amount at transaction time-'-V --market' +`-V --market' convert amounts to their market value in default valuation commodities-'-X --exchange=COMM' +`-X --exchange=COMM' convert amounts to their market value in commodity COMM-'--value' +`--value' convert amounts to cost or market value, more flexibly than -B/-V/-X-'--infer-market-prices' +`--infer-market-prices' use transaction prices (recorded with @ or @@) as additional market prices, as if they were P directives-'--auto' +`--auto' apply automated posting rules to modify transactions.-'--forecast' +`--forecast' generate future transactions from periodic transaction rules, for- the next 6 months or till report end date. In hledger-ui, also+ the next 6 months or till report end date. In hledger-ui, also make ordinary future transactions visible.-'--commodity-style' +`--commodity-style' Override the commodity style in the output for the specified commodity. For example 'EUR1.000,00'.-'--color=WHEN (or --colour=WHEN)' +`--color=WHEN (or --colour=WHEN)' Should color-supporting commands use ANSI color codes in text output. 'auto' (default): whenever stdout seems to be a color-supporting terminal. 'always' or 'yes': always, useful eg- when piping output into 'less -R'. 'never' or 'no': never. A+ when piping output into 'less -R'. 'never' or 'no': never. A NO_COLOR environment variable overrides this.-'--pretty[=WHEN]' - Show prettier output, e.g. using unicode box-drawing characters.+`--pretty[=WHEN]'+ Show prettier output, e.g. using unicode box-drawing characters. Accepts 'yes' (the default) or 'no' ('y', 'n', 'always', 'never' also work). If you provide an argument you must use '=', e.g. '-pretty=yes'.@@ -218,122 +217,138 @@ hledger help options: -'-h --help'-+`-h --help' show general or COMMAND help-'--man' +`--man' show general or COMMAND user manual with man-'--info' +`--info' show general or COMMAND user manual with info-'--version' +`--version' show general or ADDONCMD version-'--debug[=N]' +`--debug[=N]' show debug output (levels 1-9, default: 1) A @FILE argument will be expanded to the contents of FILE, which-should contain one command line option/argument per line. (To prevent-this, insert a '--' argument before.)+should contain one command line option/argument per line. (To prevent+this, insert a `--' argument before.) -File: hledger-ui.info, Node: KEYS, Next: SCREENS, Prev: OPTIONS, Up: Top+File: hledger-ui.info, Node: MOUSE, Next: KEYS, Prev: OPTIONS, Up: Top -2 KEYS+2 MOUSE+*******++In most modern terminals, you can navigate through the screens with a+mouse or touchpad:++ * Use mouse wheel or trackpad to scroll up and down++ * Click on list items to go deeper++ * Click on the left margin (column 0), or the blank area at bottom of+ screen, to go back.+++File: hledger-ui.info, Node: KEYS, Next: SCREENS, Prev: MOUSE, Up: Top++3 KEYS ****** -'?' shows a help dialog listing all keys. (Some of these also appear in-the quick help at the bottom of each screen.) Press '?' again (or-'ESCAPE', or 'LEFT', or 'q') to close it. The following keys work on+Keyboard gives more control.++ `?' shows a help dialog listing all keys. (Some of these also appear+in the quick help at the bottom of each screen.) Press `?' again (or+`ESCAPE', or `LEFT', or `q') to close it. The following keys work on most screens: - The cursor keys navigate: 'right' (or 'enter') goes deeper, 'left'-returns to the previous screen, 'up'/'down'/'page up'/'page-down'/'home'/'end' move up and down through lists. Emacs-style-('ctrl-p'/'ctrl-n'/'ctrl-f'/'ctrl-b') movement keys are also supported-(but not vi-style keys, since hledger-1.19, sorry!). 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.)+ The cursor keys navigate: `RIGHT' goes deeper, `LEFT' returns to the+previous screen, `UP'/`DOWN'/`PGUP'/`PGDN'/`HOME'/`END' move up and+down through lists. Emacs-style (`CTRL-p'/`CTRL-n'/`CTRL-f'/`CTRL-b')+movement keys are also supported (but not vi-style keys, since+hledger-1.19, sorry!). 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 '--watch' option, when viewing a+`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.+period will move automatically to track the current date. To set a+non-standard period, you can use `/' and a `date:' query. - '/' lets you set a general filter query limiting the data shown,-using the same query terms as in hledger and hledger-web. While editing-the query, you can use CTRL-a/e/d/k, BS, cursor keys; press 'ENTER' to-set it, or 'ESCAPE'to cancel. There are also keys for quickly adjusting+ `/' lets you set a general filter query limiting the data shown,+using the same query terms as in hledger and hledger-web. While editing+the query, you can use CTRL-a/e/d/k, BS, cursor keys; press `ENTER' to+set it, or `ESCAPE'to cancel. There are also keys for quickly adjusting some common filters like account depth and transaction status (see-below). 'BACKSPACE' or 'DELETE' removes all filters, showing all+below). `BACKSPACE' or `DELETE' removes all filters, showing all transactions. As mentioned above, by default hledger-ui hides future transactions - both ordinary transactions recorded in the journal, and periodic-transactions generated by rule. 'F' toggles forecast mode, in which+transactions generated by rule. `F' toggles forecast mode, in which future/forecasted transactions are shown. - 'ESCAPE' resets the UI state and jumps back to the top screen,-restoring the app's initial state at startup. Or, it cancels minibuffer+ `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. - 'CTRL-l' redraws the screen and centers the selection if possible+ `CTRL-l' redraws the screen and centers the selection if possible (selections near the top won't be centered, since we don't scroll above the top). - 'g' reloads from the data file(s) and updates the current screen and-any previous screens. (With large files, this could cause a noticeable+ `g' reloads from the data file(s) and updates the current screen and+any previous screens. (With large files, this could cause a noticeable pause.) - 'I' toggles balance assertion checking. Disabling balance assertions+ `I' toggles balance assertion checking. Disabling balance assertions temporarily can be useful for troubleshooting. - 'a' runs command-line hledger's add command, and reloads the updated-file. This allows some basic data entry.+ `a' runs command-line hledger's add command, and reloads the updated+file. This allows some basic data entry. - 'A' is like 'a', but runs the hledger-iadd tool, which provides a-terminal interface. This key will be available if 'hledger-iadd' is+ `A' is like `a', but runs the hledger-iadd tool, which provides a+terminal interface. This key will be available if `hledger-iadd' is installed in $path. - 'E' runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default ('emacsclient--a "" -nw') on the journal file. With some editors (emacs, vi), the+ `E' runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (`emacsclient+-a "" -nw') on the journal file. With some editors (emacs, vi), the cursor will be positioned at the current transaction when invoked from the register and transaction screens, and at the error location (if possible) when invoked from the error screen. - 'B' toggles cost mode, showing amounts in their transaction price's-commodity (like toggling the '-B/--cost' flag).+ `B' toggles cost mode, showing amounts in their transaction price's+commodity (like toggling the `-B/--cost' flag). - 'V' toggles value mode, showing amounts' current market value in-their default valuation commodity (like toggling the '-V/--market'-flag). Note, "current market value" means the value on the report end-date if specified, otherwise today. To see the value on another date,-you can temporarily set that as the report end date. Eg: to see a+ `V' toggles value mode, showing amounts' current market value in+their default valuation commodity (like toggling the `-V/--market'+flag). Note, "current market value" means the value on the report end+date if specified, otherwise today. To see the value on another date,+you can temporarily set that as the report end date. Eg: to see a transaction as it was valued on july 30, go to the accounts or register-screen, press '/', and add 'date:-7/30' to the query.+screen, press `/', and add `date:-7/30' to the query. At most one of cost or value mode can be active at once. There's not yet any visual reminder when cost or value mode is-active; for now pressing 'b' 'b' 'v' should reliably reset to normal+active; for now pressing `b' `b' `v' should reliably reset to normal mode. - 'q' quits the application.+ `q' quits the application. Additional screen-specific keys are described below. File: hledger-ui.info, Node: SCREENS, Next: TIPS, Prev: KEYS, Up: Top -3 SCREENS+4 SCREENS ********* * Menu:@@ -346,103 +361,105 @@ File: hledger-ui.info, Node: Accounts screen, Next: Register screen, Up: SCREENS -3.1 Accounts screen+4.1 Accounts screen =================== -This is normally the first screen displayed. It lists accounts and-their balances, like hledger's balance command. By default, it shows-all accounts and their latest ending balances (including the balances of-subaccounts). If you specify a query on the command line, it shows just-the matched accounts and the balances from matched transactions.+This is normally the first screen displayed. It lists accounts and their+balances, like hledger's balance command. By default, it shows all+accounts and their latest ending balances (including the balances of+subaccounts). Accounts which have been declared with an account+directive are also listed, even if not yet used (except for empty parent+accounts). If you specify a query on the command line, it shows just the+matched accounts and the balances from matched transactions. - Account names are shown as a flat list by default; press 't' to-toggle tree mode. In list mode, account balances are exclusive of+ Account names are shown as a flat list by default; press `t' to+toggle tree mode. In list mode, account balances are exclusive of subaccounts, except where subaccounts are hidden by a depth limit (see-below). In tree mode, all account balances are inclusive of-subaccounts.+below). In tree mode, all account balances are inclusive of subaccounts. - To see less detail, press a number key, '1' to '9', to set a depth-limit. Or use '-' to decrease and '+'/'=' to increase the depth limit.-'0' shows even less detail, collapsing all accounts to a single total.-To remove the depth limit, set it higher than the maximum account depth,-or press 'ESCAPE'.+ To see less detail, press a number key, `1' to `9', to set a depth+limit. Or use `-' to decrease and `+'/`=' to increase the depth limit.+`0' shows even less detail, collapsing all accounts to a single total.+To remove the depth limit, set it higher than the maximum account+depth, or press `ESCAPE'. - 'H' toggles between showing historical balances or period balances.+ `H' toggles between showing historical balances or period balances. Historical balances (the default) are ending balances at the end of the report period, taking into account all transactions before that date (filtered by the filter query if any), including transactions before the-start of the report period. In other words, historical balances are-what you would see on a bank statement for that account (unless-disturbed by a filter query). Period balances ignore transactions-before the report start date, so they show the change in balance during-the report period. They are more useful eg when viewing a time log.+start of the report period. In other words, historical balances are what+you would see on a bank statement for that account (unless disturbed by+a filter query). Period balances ignore transactions before the report+start date, so they show the change in balance during the report period.+They are more useful eg when viewing a time log. - 'U' toggles filtering by unmarked status, including or excluding-unmarked postings in the balances. Similarly, 'P' toggles pending-postings, and 'C' toggles cleared postings. (By default, balances+ `U' toggles filtering by unmarked status, including or excluding+unmarked postings in the balances. Similarly, `P' toggles pending+postings, and `C' toggles cleared postings. (By default, balances include all postings; if you activate one or two status filters, only those postings are included; and if you activate all three, the filter is removed.) - 'R' toggles real mode, in which virtual postings are ignored.+ `R' toggles real mode, in which virtual postings are ignored. - 'Z' toggles nonzero mode, in which only accounts with nonzero+ `z' toggles nonzero mode, in which only accounts with nonzero balances are shown (hledger-ui shows zero items by default, unlike command-line hledger). - Press 'right' or 'enter' to view an account's transactions register.+ Press `RIGHT' to view an account's transactions register. File: hledger-ui.info, Node: Register screen, Next: Transaction screen, Prev: Accounts screen, Up: SCREENS -3.2 Register screen+4.2 Register screen =================== This screen shows the transactions affecting a particular account, like-a check register. Each line represents one transaction and shows:+a check register. Each line represents one transaction and shows: - * the other account(s) involved, in abbreviated form. (If there are- both real and virtual postings, it shows only the accounts affected- by real postings.)+ * the other account(s) involved, in abbreviated form. (If there are+ both real and virtual postings, it shows only the accounts+ affected by real postings.) * the overall change to the current account's balance; positive for an inflow to this account, negative for an outflow. * the running historical total or period total for the current- account, after the transaction. This can be toggled with 'H'.- Similar to the accounts screen, the historical total is affected by- transactions (filtered by the filter query) before the report start- date, while the period total is not. If the historical total is- not disturbed by a filter query, it will be the running historical- balance you would see on a bank register for the current account.+ account, after the transaction. This can be toggled with `H'.+ Similar to the accounts screen, the historical total is affected+ by transactions (filtered by the filter query) before the report+ start date, while the period total is not. If the historical total+ is not disturbed by a filter query, it will be the running+ historical balance you would see on a bank register for the+ current account. + Transactions affecting this account's subaccounts will be included in the register if the accounts screen is in tree mode, or if it's in list mode but this account has subaccounts which are not shown due to a depth-limit. In other words, the register always shows the transactions-contributing to the balance shown on the accounts screen. Tree-mode/list mode can be toggled with 't' here also.+limit. In other words, the register always shows the transactions+contributing to the balance shown on the accounts screen. Tree mode/list+mode can be toggled with `t' here also. - 'U' toggles filtering by unmarked status, showing or hiding unmarked-transactions. Similarly, 'P' toggles pending transactions, and 'C'-toggles cleared transactions. (By default, transactions with all+ `U' toggles filtering by unmarked status, showing or hiding unmarked+transactions. Similarly, `P' toggles pending transactions, and `C'+toggles cleared transactions. (By default, transactions with all statuses are shown; if you activate one or two status filters, only those transactions are shown; and if you activate all three, the filter is removed.) - 'R' toggles real mode, in which virtual postings are ignored.+ `R' toggles real mode, in which virtual postings are ignored. - 'Z' toggles nonzero mode, in which only transactions posting a+ `z' toggles nonzero mode, in which only transactions posting a nonzero change are shown (hledger-ui shows zero items by default, unlike command-line hledger). - Press 'right' (or 'enter') to view the selected transaction in-detail.+ Press `RIGHT' to view the selected transaction in detail. File: hledger-ui.info, Node: Transaction screen, Next: Error screen, Prev: Register screen, Up: SCREENS -3.3 Transaction screen+4.3 Transaction screen ====================== This screen shows a single transaction, as a general journal entry,@@ -454,11 +471,11 @@ Simple transactions have two postings, but there can be more (or in certain cases, fewer). - 'up' and 'down' will step through all transactions listed in the-previous account register screen. In the title bar, the numbers in-parentheses show your position within that account register. They will+ `UP' and `DOWN' will step through all transactions listed in the+previous account register screen. In the title bar, the numbers in+parentheses show your position within that account register. They will vary depending on which account register you came from (remember most-transactions appear in multiple account registers). The #N number+transactions appear in multiple account registers). The #N number preceding them is the transaction's position within the complete unfiltered journal, which is a more stable id (at least until the next reload).@@ -466,18 +483,18 @@ File: hledger-ui.info, Node: Error screen, Prev: Transaction screen, Up: SCREENS -3.4 Error screen+4.4 Error screen ================ This screen will appear if there is a problem, such as a parse error,-when you press g to reload. Once you have fixed the problem, press g-again to reload and resume normal operation. (Or, you can press escape+when you press g to reload. Once you have fixed the problem, press g+again to reload and resume normal operation. (Or, you can press escape to cancel the reload attempt.) File: hledger-ui.info, Node: TIPS, Next: ENVIRONMENT, Prev: SCREENS, Up: Top -4 TIPS+5 TIPS ****** * Menu:@@ -488,113 +505,116 @@ File: hledger-ui.info, Node: Watch mode, Next: Watch mode limitations, Up: TIPS -4.1 Watch mode+5.1 Watch mode ============== -One of hledger-ui's best features is the auto-reloading '--watch' mode.-With this flag, it will update the display automatically whenever+One of hledger-ui's best features is the auto-reloading `-w/--watch'+mode. With this flag, it will update the display automatically whenever changes are saved to the data files. - This is very useful when reconciling. A good workflow is to have-your bank's online register open in a browser window, for reference; the+ This is very useful when reconciling. A good workflow is to have your+bank's online register open in a browser window, for reference; the journal file open in an editor window; and hledger-ui in watch mode in a terminal window, eg: + $ hledger-ui --watch --register checking -C As you mark things cleared in the editor, you can see the effect-immediately without having to context switch. This leaves more mental-bandwidth for your accounting. Of course you can still interact with+immediately without having to context switch. This leaves more mental+bandwidth for your accounting. Of course you can still interact with hledger-ui when needed, eg to toggle cleared mode, or to explore the history. File: hledger-ui.info, Node: Watch mode limitations, Prev: Watch mode, Up: TIPS -4.2 Watch mode limitations+5.2 Watch mode limitations ========================== There are situations in which it won't work, ie the display will not-update when you save a change (because the underlying 'inotify' library-does not support it). Here are some that we know of:+update when you save a change (because the underlying `inotify' library+does not support it). Here are some that we know of: - * Certain editors: saving with 'gedit', and perhaps any Gnome- application, won't be detected (#1617). Jetbrains IDEs, such as+ * Certain editors: saving with `gedit', and perhaps any Gnome+ application, won't be detected (#1617). Jetbrains IDEs, such as IDEA, also may not work (#911). - * Certain unusual filesystems might not be supported. (All the usual+ * Certain unusual filesystems might not be supported. (All the usual ones on unix, mac and windows are supported.) + In such cases, the workaround is to switch to the hledger-ui window-and press 'g' each time you want it to reload. (Actually, see #1617 for+and press `g' each time you want it to reload. (Actually, see #1617 for another workaround, and let us know if it works for you.) - If you leave 'hledger-ui --watch' running for days, on certain+ If you leave `hledger-ui --watch' running for days, on certain platforms (?), perhaps with many transactions in your journal (?), perhaps with large numbers of other files present (?), you may see it-gradually using more and more memory and CPU over time, as seen in 'top'-or Activity Monitor or Task Manager.+gradually using more and more memory and CPU over time, as seen in+`top' or Activity Monitor or Task Manager. - A workaround is to 'q'uit and restart it, or to suspend it ('CTRL-z')-and restart it ('fg') if your shell supports that.+ A workaround is to `q'uit and restart it, or to suspend it+(`CTRL-z') and restart it (`fg') if your shell supports that. File: hledger-ui.info, Node: ENVIRONMENT, Next: FILES, Prev: TIPS, Up: Top -5 ENVIRONMENT+6 ENVIRONMENT ************* -*COLUMNS* The screen width to use. Default: the full terminal width.+*COLUMNS* The screen width to use. Default: the full terminal width. - *LEDGER_FILE* The journal file path when not specified with '-f'.-Default: '~/.hledger.journal' (on windows, perhaps-'C:/Users/USER/.hledger.journal').+ *LEDGER_FILE* The journal file path when not specified with `-f'.+Default: `~/.hledger.journal' (on windows, perhaps+`C:/Users/USER/.hledger.journal'). - A typical value is '~/DIR/YYYY.journal', where DIR is a-version-controlled finance directory and YYYY is the current year. Or-'~/DIR/current.journal', where current.journal is a symbolic link to+ A typical value is `~/DIR/YYYY.journal', where DIR is a+version-controlled finance directory and YYYY is the current year. Or+`~/DIR/current.journal', where current.journal is a symbolic link to YYYY.journal. - On Mac computers, you can set this and other environment variables in-a more thorough way that also affects applications started from the GUI-(say, an Emacs dock icon). Eg on MacOS Catalina I have a-'~/.MacOSX/environment.plist' file containing+ On Mac computers, you can set this and other environment variables+in a more thorough way that also affects applications started from the+GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a+`~/.MacOSX/environment.plist' file containing + { "LEDGER_FILE" : "~/finance/current.journal" } - To see the effect you may need to 'killall Dock', or reboot.+ To see the effect you may need to `killall Dock', or reboot. File: hledger-ui.info, Node: FILES, Next: BUGS, Prev: ENVIRONMENT, Up: Top -6 FILES+7 FILES ******* Reads data from one or more files in hledger journal, timeclock,-timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or-'$HOME/.hledger.journal' (on windows, perhaps-'C:/Users/USER/.hledger.journal').+timedot, or CSV format specified with `-f', or `$LEDGER_FILE', or+`$HOME/.hledger.journal' (on windows, perhaps+`C:/Users/USER/.hledger.journal'). File: hledger-ui.info, Node: BUGS, Prev: FILES, Up: Top -7 BUGS+8 BUGS ****** -The need to precede options with '--' when invoked from hledger is+The need to precede options with `--' when invoked from hledger is awkward. - '-f-' doesn't work (hledger-ui can't read from stdin).+ `-f-' doesn't work (hledger-ui can't read from stdin). - '-V' affects only the accounts screen.+ `-V' affects only the accounts screen. - When you press 'g', the current and all previous screens are-regenerated, which may cause a noticeable pause with large files. Also+ When you press `g', the current and all previous screens are+regenerated, which may cause a noticeable pause with large files. Also there is no visual indication that this is in progress. - '--watch' is not yet fully robust. It works well for normal usage,+ `--watch' is not yet fully robust. It works well for normal usage, but many file changes in a short time (eg saving the file thousands of times with an editor macro) can cause problems at least on OSX. Symptoms include: unresponsive UI, periodic resetting of the cursor position,@@ -603,41 +623,39 @@ program is restarted. Also, if you are viewing files mounted from another machine,-'--watch' requires that both machine clocks are roughly in step.+`-w/--watch' requires that both machine clocks are roughly in step. + Tag Table:-Node: Top221+Node: Top232 Node: OPTIONS1644-Ref: #options1741-Node: KEYS6620-Ref: #keys6715-Node: SCREENS10786-Ref: #screens10884-Node: Accounts screen10974-Ref: #accounts-screen11102-Node: Register screen13317-Ref: #register-screen13472-Node: Transaction screen15469-Ref: #transaction-screen15627-Node: Error screen16497-Ref: #error-screen16619-Node: TIPS16863-Ref: #tips16962-Node: Watch mode17014-Ref: #watch-mode17131-Node: Watch mode limitations17877-Ref: #watch-mode-limitations18018-Node: ENVIRONMENT19154-Ref: #environment19265-Node: FILES20072-Ref: #files20171-Node: BUGS20384-Ref: #bugs20461+Ref: #options1742+Node: MOUSE6617+Ref: #mouse6712+Node: KEYS6996+Ref: #keys7089+Node: SCREENS11153+Ref: #screens11251+Node: Accounts screen11341+Ref: #accounts-screen11469+Node: Register screen13796+Ref: #register-screen13951+Node: Transaction screen15933+Ref: #transaction-screen16091+Node: Error screen16958+Ref: #error-screen17080+Node: TIPS17322+Ref: #tips17421+Node: Watch mode17473+Ref: #watch-mode17590+Node: Watch mode limitations18337+Ref: #watch-mode-limitations18478+Node: ENVIRONMENT19611+Ref: #environment19722+Node: FILES20527+Ref: #files20626+Node: BUGS20839+Ref: #bugs20916 End Tag Table---Local Variables:-coding: utf-8-End:
hledger-ui.txt view
@@ -5,7 +5,7 @@ NAME hledger-ui is a terminal interface (TUI) for the hledger accounting- tool. This manual is for hledger-ui 1.23.+ tool. This manual is for hledger-ui 1.24. SYNOPSIS hledger-ui [OPTIONS] [QUERYARGS]@@ -41,7 +41,7 @@ Any QUERYARGS are interpreted as a hledger search query which filters the data. - --watch+ -w --watch watch for data and date changes and reload automatically --theme=default|terminal|greenterm@@ -211,28 +211,41 @@ contain one command line option/argument per line. (To prevent this, insert a -- argument before.) +MOUSE+ In most modern terminals, you can navigate through the screens with a+ mouse or touchpad:++ o Use mouse wheel or trackpad to scroll up and down++ o Click on list items to go deeper++ o Click on the left margin (column 0), or the blank area at bottom of+ screen, to go back.+ KEYS+ Keyboard gives more control.+ ? shows a help dialog listing all keys. (Some of these also appear in the quick help at the bottom of each screen.) Press ? again (or ESCAPE, or LEFT, or q) to close it. The following keys work on most screens: - The cursor keys navigate: right (or enter) goes deeper, left returns to- the previous screen, up/down/page up/page down/home/end move up and- down through lists. Emacs-style (ctrl-p/ctrl-n/ctrl-f/ctrl-b) movement- keys are also supported (but not vi-style keys, since hledger-1.19,- sorry!). 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.)+ The cursor keys navigate: RIGHT goes deeper, LEFT returns to the previ-+ ous screen, UP/DOWN/PGUP/PGDN/HOME/END move up and down through lists.+ Emacs-style (CTRL-p/CTRL-n/CTRL-f/CTRL-b) movement keys are also sup-+ ported (but not vi-style keys, since hledger-1.19, sorry!). 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+ 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 --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.+ With the -w/--watch option, when viewing a "current" period (the cur-+ rent day, week, month, quarter, or year), the period will move automat-+ ically to track the current date. To set a non-standard period, you+ can use / and a date: query. / lets you set a general filter query limiting the data shown, using the same query terms as in hledger and hledger-web. While editing the@@ -299,7 +312,9 @@ This is normally the first screen displayed. It lists accounts and their balances, like hledger's balance command. By default, it shows all accounts and their latest ending balances (including the balances- of subaccounts). If you specify a query on the command line, it shows+ of subaccounts). Accounts which have been declared with an account+ directive are also listed, even if not yet used (except for empty par-+ ent accounts). If you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. Account names are shown as a flat list by default; press t to toggle@@ -332,11 +347,11 @@ R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only accounts with nonzero balances+ z toggles nonzero mode, in which only accounts with nonzero balances are shown (hledger-ui shows zero items by default, unlike command-line hledger). - Press right or enter to view an account's transactions register.+ Press RIGHT to view an account's transactions register. Register screen This screen shows the transactions affecting a particular account, like@@ -372,11 +387,11 @@ R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only transactions posting a nonzero+ z toggles nonzero mode, in which only transactions posting a nonzero change are shown (hledger-ui shows zero items by default, unlike com- mand-line hledger). - Press right (or enter) to view the selected transaction in detail.+ Press RIGHT to view the selected transaction in detail. Transaction screen This screen shows a single transaction, as a general journal entry,@@ -388,7 +403,7 @@ shown. Simple transactions have two postings, but there can be more (or in certain cases, fewer). - up and down will step through all transactions listed in the previous+ UP and DOWN will step through all transactions listed in the previous account register screen. In the title bar, the numbers in parentheses show your position within that account register. They will vary depending on which account register you came from (remember most trans-@@ -404,9 +419,9 @@ TIPS Watch mode- One of hledger-ui's best features is the auto-reloading --watch mode.- With this flag, it will update the display automatically whenever- changes are saved to the data files.+ One of hledger-ui's best features is the auto-reloading -w/--watch+ mode. With this flag, it will update the display automatically when-+ ever changes are saved to the data files. This is very useful when reconciling. A good workflow is to have your bank's online register open in a browser window, for reference; the@@ -494,7 +509,7 @@ siding, and possibly a small but persistent build-up of CPU usage until the program is restarted. - Also, if you are viewing files mounted from another machine, --watch+ Also, if you are viewing files mounted from another machine, -w/--watch requires that both machine clocks are roughly in step. @@ -518,4 +533,4 @@ -hledger-ui-1.23 September 2021 HLEDGER-UI(1)+hledger-ui-1.24 December 2021 HLEDGER-UI(1)