circumflex
is a command line tool for browsing Hacker News in your terminal.
- ๐ Everything in one place - read articles in Reader Mode or enter the comment section without leaving your terminal
- ๐คน Native terminal colors - you bring your own color scheme,
circumflex
does the rest - โก๏ธ Tools you already know - articles and comments are piped to the pager
less
- ๐ Syntax highlighting - syntax-aware formatting for comment quotes, references and submissions headlines
- โจ๏ธ Vim keybindings - including repeat motion and g
- ๐ Configureable - change comment width, indentation size, highlighting ++
- โค๏ธ Add to favorites - save interesting submissions for later
- ๐ Dotfiles and VCS-friendly - easy to commit your config and favorites to your dotfiles repo
# Install
brew install bensadeh/circumflex/circumflex
# Run
clx
# Install
go install
# Run
clx
When building from source, make sure the dependencies less
and
lynx
are installed on your system.
Enter: Read comments Space: Read article in Reader Mode Tab: Change category o: Open link to article in browser c: Open comment section in browser r: Refresh f: Add submission to favorites F: Add submission to favorites by ID x: Remove submission from favorites g/G: Go to line (Vim) q: Quit ?/i: Show keymaps and settings
Comments are pretty-printed and piped to the pager less
. To present a nice and readable comment section,
circumflex
features:
- Text in bold, italics, hyperlinks and
code
where available - Labels for Original Posters (
OP
), Parent Posters (PP
) and moderators (mod
)
circumflex
prints every top-level comment with the string ::
. Using less
's search functionality,
one can move between top-level posts by searching for ::
.
To navigate between top-level comments, press / to search for ::
. Then, press n and N to jump forwards and backwards, respectively.
/: search n: repeat search forwards N: repeat search backward
less
remembers your search term between sessions. This means that the next time you want to jump between top-level posts, you can hit n to go to the next ::
directly.
Press Space to read the submission link in Reader Mode.
On Hacker News, quotes are in their own paragraph and open with a >
. They are not further stylized or formatted.
In circumflex
, the >
symbol is omitted and quotes are instead italicised and dimmed.
Headlines containing the text Ask HN
, Tell HN
, Show HN
and Launch HN
are highlighted. On by default,
but can be disabled.
Twice a year, Y Combinator funds start-ups through its accelerator program.
circumflex
highlights these startups to signalize their affiliation with YC. On by default, but can be disabled.
By convention, references on Hacker News are formatted as numbers inside brackets. circumflex
highlights these numbers
for easier cross-referencing.
Save submissions you'd like to revisit by adding them to Favorites. Press f to add the currently highlighted submission to your Favorites list. Press F to add a submission by ID. Submissions can be removed with x.
Favorites are stored in favorites.json
in ~/.config/circumflex
.
The available options and their current values are displayed in the Settings View. Overridden values are marked with
*
. To enter Settings View, press i on the Main View and then Tab to change the category. Note
that the settings cannot be changed from within the Settings View.
To change the settings, you can either:
- edit
config.env
in~/.config/circumflex
, or - set environment variables in your shell
circumflex
can create a config.env
template in ~/.config/circumflex
by pressing t in the Settings View.
Edit this file and uncomment the values you want to change.
Depending on your preference, it might be more convenient for you to configure circumflex
by setting
environment variables.
Below are a couple of examples on how to set the variables in different shells. Run the commands directly from your
shell to set the value for the current session. Put the commands in somewhere in your
dotfiles to make the settings permanent.
Bash and zsh:
export CLX_COMMENT_WIDTH=65
Fish:
set -x CLX_COMMENT_WIDTH "65"
The following table shows the different ways in which circumflex
can be configured:
Key | Default Value | Description |
---|---|---|
CLX_COMMENT_WIDTH |
70 |
Sets the maximum number of characters on each line for comments, replies and descriptions in settings. Set to 0 to use the whole screen. |
CLX_INDENT_SIZE |
4 |
The number of whitespaces prepended to each reply multiplied by the indent level. |
CLX_HIGHLIGHT_HEADLINES |
2 |
Highlights YC-funded startups and text containing Show HN , Ask HN , Tell HN and Launch HN . Can be set to 0 (No highlighting), 1 (inverse highlighting) or 2 (colored highlighting). |
CLX_RELATIVE_NUMBERING |
false |
Shows each line with a number relative to the currently selected element. Similar to Vim's hybrid line number mode. |
CLX_HIDE_YC_JOBS |
true |
Hides X is hiring posts from YC-funded startups. Does not affect the monthly Who is Hiring? posts. |
CLX_PRESERVE_RIGHT_MARGIN |
false |
Shortens replies so that the total length, including indentation, is the same as the comment width. Best used when Indent Size is small to avoid deep replies being too short. |
circumflex
uses:
- tcell and cview for the TUI
- viper for reading and setting configurations
- cheeaun's unofficial Hacker News API for providing stories and comments
less
for viewing comments- go-term-text for text formatting
Screenshots use:
- iTerm2 for the terminal
- Palenight Theme for the color scheme
- JetBrains Mono for the font