Skip to content

bensadeh/circumflex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

^

Changelog License Go Version

circumflex is a command line tool for browsing Hacker News in your terminal.

^

Features

  • ๐Ÿ›‹ 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

Installing

Via Homebrew

# Install
brew install bensadeh/circumflex/circumflex

# Run
clx

From source

# Install
go install

# Run
clx

When building from source, make sure the dependencies less and lynx are installed on your system.

Keymaps

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

Comment section

Overview

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)

^

Jumping between top-level comments

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.

Reader Mode

Press Space to read the submission link in Reader Mode.

Syntax highlighting

Quotes

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

Headlines containing the text Ask HN, Tell HN, Show HN and Launch HN are highlighted. On by default, but can be disabled.

^

YC-funded startups

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.

^

References

By convention, references on Hacker News are formatted as numbers inside brackets. circumflex highlights these numbers for easier cross-referencing.

^

Favorites

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.

Settings

Overview

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:

  1. edit config.env in ~/.config/circumflex, or
  2. set environment variables in your shell

Changing settings through config.env

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.

Changing settings with environment variables

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"

Available options

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.

Under the hood

circumflex uses:

Screenshots use: