13 ms·
Show HN: Ov – feature rich terminal pager
I made a terminal pager that can be used instead of more, less, tail -f.
It has a mode that distinguishes between headers and columns.
- armchairhacker 4y agoI'm surprised there aren't more pagers besides `less` and `more`. Alternatives I've found online: - https://linux.die.net/man/1/most https://linux.die.net/man/1/most (multiple files/windows at once) - https://github.com/sharkdp/bat https://github.com/sharkdp/bat (uses `less` under the hood, syntax highlighting and git diffs) - https://linux.die.net/man/1/lesskey https://linux.die.net/man/1/lesskey (add parameters to `less`) - https://github.com/ivanov/kanten https://github.com/ivanov/kanten (looks abandoned) - "Just use vim" (and vim's paging is really good, so this is viable, in fact probably the most viable so far) `less` is a great program, despite being old there aren't really many flaws. It's one of those tools that don't really need updates or improvements. But I do think there are a few features which would be nice to have (automatic ANSI coloring, tailing, syntax highlighting, support for files like sqlite and tar - which of which are in ov). The one thing which `less` may have over `ov` (besides already being on most distros) is speed. `less` takes in really large files, or forever terminal output, and is still really fast. And I find that when I use `less` I use it with large files or terminal output often. Though I don't actually know if `ov` is any slower, it's something the dev should watch out for (I don't see "speed" mentioned in the README).
- funcDropShadow 4y agoANSI coloring and tailing is supported by less. Press F to start tailing. Many programs detect if they are redirected to a pipe and then stop to emit ANSI color codes.
- noborus 4y agoFirst of all please keep in mind that "less" is wonderfully updated https://github.com/gwsw/less https://github.com/gwsw/less ov is built for speed, but "less" is often better. "bat" is a nice application, but it's not a pager. I believe "bat" is not suitable for opening large files. https://twitter.com/noborus/status/1610111558574804993?s=20&t=pM4JvX-NrFireVYWTWQgNQ https://twitter.com/noborus/status/1610111558574804993?s=20&...
- deleted 4y ago[deleted]
- jwilk 4y agolinux.die.net man pages are horribly outdated. Better links: https://github.com/jedsoft/most/raw/master/doc/most.txt https://github.com/jedsoft/most/raw/master/doc/most.txt https://www.man7.org/linux/man-pages/man1/lesskey.1.html https://www.man7.org/linux/man-pages/man1/lesskey.1.html
- kseistrup 4y agoThere's also moar, written in go: - https://github.com/walles/moar https://github.com/walles/moar
- goombacloud 4y agoI find myself using cat or less even thought I have bat around because copying from cat or less works best and you don't get line breaks inserted.
- adamredwoods 4y agoI'm a fan of lnav, more for log files but incredibly useful: https://lnav.org/ https://lnav.org/
- dmfay 4y agopspg ( https://github.com/okbob/pspg https://github.com/okbob/pspg ) is wonderful for tabular data.
- Sakos 4y agoI'm impressed by the documentation. Commonly used options with examples fairly high up, then a complete overview of all the options below that. Definitely going to give this a try.
- noborus 4y agoThank you.
- kbd 4y agoAnyone tried using this for a scrollback pager for kitty terminal? I have a convoluted nvim incantation right now I’d love to replace.
- shaicoleman 4y agoYes, it works by adding to kitty.conf: scrollback_pager ov
- kbd 4y agoYeah I experimented with it, seemed to work out of the box. I used `ov -f` so it starts at the end of the scrollback. Searching behaves strangely (different from vim). Seems to run fast but I haven't tried it on giant scrollbacks yet.
- href 4y agoIf the log-file viewing capabilities look interesting to you, check out lnav, which is built for that and excels at it: https://lnav.org/ https://lnav.org/
- neilv 4y agoNice! I've been in rapid-response situations where I had to pull logs from various sources (including embedded devices) that weren't unified in a central logging service. I could get the logs onto my workstation, but then manually lining up who-saw-what-when involved a headache, even with Emacs. lnav seems to have a few features to support this. One very useful feature for this I didn't see listed for lnav was to support adjusting for timestamps in different timezones, like maybe you have a desktop's log in local time that you're trying to reconcile with servers. (A related but less-important bonus would be to be able to specify smaller arbitrary clock drift/offsets for each log.)
- tstack 4y ago> One very useful feature for this I didn't see listed for lnav was to support adjusting for timestamps in different timezones, like maybe you have a desktop's log in local time that you're trying to reconcile with servers. (A related but less-important bonus would be to be able to specify smaller arbitrary clock drift/offsets for each log.) You can adjust the timestamps for a file using the ":adjust-log-time" command (https://docs.lnav.org/en/latest/commands.html#adjust-log-time-timestamp https://docs.lnav.org/en/latest/commands.html#adjust-log-tim...). For example, if you wanted to shift the timestamps back an hour, you can do: :adjust-log-time -1h The shift is applied to the messages in the file that the top line in the view belongs to. If you want to do the shift programmatically, you can UPDATE the "time_offset" column of the "lnav_file" table directly (see https://docs.lnav.org/en/latest/sqltab.html#lnav-file https://docs.lnav.org/en/latest/sqltab.html#lnav-file)
- neilv 4y agoThanks!
- deleted 4y ago
- rakoo 4y agoov looks really nice and probable deserves a try. I like the section thing, it's going to be useful for diffs to go file by file. One feature I discovered recently in less that I'm always using now is filtering: type '&' and then the thing you're looking for, and less will only show matching lines.
- DiabloD3 4y ago[flagged]
- kleiba 4y agoHuh?
- DiabloD3 4y agoI'm not part of the Go cult, so I simply do not get why people would start brand new projects in it when so many other good languages exist that actually seem to have taken off and become popular enough to survive long-term.
- unsafecast 4y agoOkay but why _not_ use go? You never gave a reason.
- DiabloD3 4y agoThere are multiple lengthy writeups on the good and bad of Go that have made it to the HN front page multiple times over the past 5+ years. The little search bar at the bottom HN works pretty well, sometimes better than Google due to HN's habit of promoting interesting and well written blog posts, podcasts, and talks about technical subjects.
- thiht 4y agoSo you don’t have actual arguments? On my end I love Go executables because I know they’re fast, self contained with very little dynamic linking or dependencies, and I know I can (and do!) contribute easily. I try to avoid Python tools because they depend too much on the installed Python version (even with 3+ I’ve had incompatibility issues), are generally slow (I use autojump because it’s best in class IMO compared to zoxide, z, or jump, but it’s slow as a cow), and sometimes suffer from bad error handling (the few Python tools I use like awscli routinely give me Python stack traces whereas Go or Rust tools rarely, if ever, fail that badly) Now that you have an example, what are your arguments against Go tools?
- omani 4y agohey OP, nice tool. can we use $HOME/config/ for the config file? keeps the home clean.
- user3939382 4y ago~/.config https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/basedir-spec/basedir-...
- Korikaze 4y agoThere is a --config flag to specify the location[1] but I agree it should be in $XDG_CONFIG_HOME by default. [1] https://github.com/noborus/ov/blob/master/main.go#L207 https://github.com/noborus/ov/blob/master/main.go#L207
- noborus 4y ago$XDG_CONFIG_HOME is now default. thank you.
- throwawaybutwhy 4y agoSuppose it is a technicality, but if it can't handle large (larger than available memory, that is) files [0], it's not a pager. [0] https://github.com/noborus/ov/issues/201 https://github.com/noborus/ov/issues/201
- benj111 4y agoIt is a technicality and it is still a pager.
- throwawaybutwhy 4y agoYou are right, of course, and I stand corrected, performance and/or ability to fully replace less have no bearing on whether a program is a pager.
- VWWHFSfQ 4y agoNah I still wouldn't call it a pager. They used the correct term themselves as "text viewer".
- noborus 4y agoI see memory efficiency as an issue, but not as a priority issue as it was 30 years ago.
- ktpsns 4y agoIn data science/industry it frequently happens for people to open files bigger then the available memory in less. "Big data" is a somewhat independent concept of the fact that RAM was smaller 30 years ago.
- adamredwoods 4y agoAny markdown support? I don't see any in the feature list. :(
- noborus 4y agoDoes not support markdown. ov is a pager, so there is no rendering of specific files. But it can be used as a bat(https://github.com/sharkdp/bat https://github.com/sharkdp/bat) pager. It can also be created using the ov(oviewer) package. Here's a sample: https://github.com/noborus/mdviewer https://github.com/noborus/mdviewer
- pseufaux 4y agoI didn’t see any indication in the readme if this supports syntax highlighting. Any plans to add it?
- John23832 4y agoI tried testing this using /dev/random and I got a lot of flickering. ``` < /dev/random ov ```
- pxc 4y agoLooks like posting this to Hacker News got it packaged for Nixpkgs¹! I had to add it via package override when the article came out, but it's since been added to Nixpkgs. :) If you're a NixOS newbie and you don't want to wait for the PR to land, you can add it with a package override by pasting in the function body from the PR and prepending a `with` expression for the original Nixpkgs used in the override, like: nixpkgs.config.packageOverrides = superPkgs: { ov = with superPkgs; buildGoModule rec { pname = "ov"; version = "0.13.0"; <...> meta = with lib; { description = "Feature-rich terminal-based text viewer"; homepage = "https://noborus.github.io/ov"; license = licenses.mit; platforms = platforms.linux ++ platforms.darwin; }; }; }; Hopefully in a week or two, Nixpkgs will provide another convenient way for Linux and macOS users to quickly try out this new pager! I know I'll be following along to see how it develops. :) -- 1: https://github.com/NixOS/nixpkgs/pull/209034 https://github.com/NixOS/nixpkgs/pull/209034