circumflex
is a command line tool for browsing Hacker News in your terminal.
Install circumflex
with Homebrew:
# Install
brew install bensadeh/circumflex/circumflex
# Run
clx
Press i to show available keymaps and settings.
circumflex
is Hacker News on the command line. It lets you browse submissions by category and read comments.
circumflex
is customizable, supports Vim-keybindings and respects your terminal's native color scheme.
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
) - Ability to jump between top-level comments by searching for
::
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 ways 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, not including the color bar. |
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 submissions 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