1
1
mirror of https://github.com/walles/moar.git synced 2024-11-05 04:24:19 +03:00
moar/README.md

144 lines
3.9 KiB
Markdown
Raw Normal View History

2019-06-08 23:12:52 +03:00
Moar is a pager. It's designed to just do the right thing without any
configuration:
![Moar displaying its own test suite](http://walles.github.io/moar/images/moar.png)
The intention is that Moar should work as a drop-in replacement for
[Less](http://www.greenwoodsoftware.com/less/). If you find that Moar
doesn't work that way,
[please report it](https://github.com/walles/moar/issues)!
Doing the right thing includes:
* **Syntax highlight** source code by default if
2019-06-18 21:15:15 +03:00
[Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php)
2019-06-08 23:12:52 +03:00
is installed.
* **Search is incremental** / find-as-you-type just like in
[Chrome](http://www.google.com/chrome) or
[Emacs](http://www.gnu.org/software/emacs/)
* Search becomes case sensitive if you add any UPPER CASE characters
to your search terms, just like in Emacs
* [Regexp](http://en.wikipedia.org/wiki/Regular_expression#Basic_concepts)
search if your search string is a valid regexp
* Supports displaying ANSI color coded texts (like the output from
"git diff" for example)
* Supports UTF-8 input and output
* The position in the file is always shown
Installing
----------
2019-06-09 08:47:55 +03:00
FIXME: End-user install instructions for the Go-built product
2019-06-08 23:12:52 +03:00
...
And now you can just invoke `moar` from the prompt!
Setting Moar as Your Default Pager
----------------------------------
Set it as your default pager by adding...
```bash
export PAGER=/usr/local/bin/moar
```
... to your `.bashrc`.
Issues
------
Issues are tracked [here](https://github.com/walles/moar/issues), or
you can send questions to <johan.walles@gmail.com>.
Developing
----------
2019-06-19 08:13:05 +03:00
First, install [Highlight](http://www.andre-simon.de/zip/download.php),
otherwise the test suite won't pass:
* On macOS: [`brew install highlight`](https://brew.sh/)
* On Ubuntu: [`sudo apt-get install highlight`](https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=highlight)
* Elsewhere, follow [instructions](http://www.andre-simon.de/zip/download.php)
Also, you need the [go tools](https://golang.org/doc/install).
Run tests:
2019-06-09 08:47:55 +03:00
```bash
2019-06-19 08:13:05 +03:00
./test.sh
2019-06-09 08:47:55 +03:00
```
2019-06-08 23:12:52 +03:00
2019-06-19 08:13:05 +03:00
Build + run:
2019-06-09 19:42:25 +03:00
```bash
2019-06-19 08:13:05 +03:00
./moar.sh ...
2019-06-09 19:42:25 +03:00
```
2019-07-07 19:44:08 +03:00
Install (into `/usr/local/bin`) from source:
```bash
./install.sh
```
2019-06-08 23:12:52 +03:00
Making a new Release
--------------------
FIXME: Go release instructions
TODO
----
2019-06-09 08:47:55 +03:00
2019-07-26 20:39:05 +03:00
* Make sure search hits are highlighted even when we have to scroll right
to see them
2019-06-08 23:12:52 +03:00
* Change out-of-file visualization to writing --- after the end of the
file and leaving the rest of the screen blank.
2019-07-26 20:39:05 +03:00
* Exit search on pressing up / down / pageup / pagedown keys and
scroll. I attempted to do that spontaneously, so it's probably a
good idea.
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Release the `go` version as the new `moar`, replacing the previous Ruby
implementation
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Searching for something above us should wrap the search.
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Handle all kinds of line endings.
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Enable exiting using ^c (without restoring the screen).
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Start at a certain line if run as "moar.rb file.txt:42"
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Add licensing information (BSD)
2019-06-08 23:12:52 +03:00
* Make sure version information is printed if there are warnings.
2019-07-26 20:39:05 +03:00
* Redefine 'g' without any prefix to prompt for which line to go
to. This definition makes more sense to me than having to prefix 'g'
to jump.
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Handle search hits to the right of the right screen edge. Searching
forwards should move first right, then to the left edge and
down. Searching backwards should move first left, then up and to the
right edge (if needed for showing search hits).
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Support viewing multiple files by pushing them in reverse order on
the view stack.
2019-06-08 23:12:52 +03:00
2019-07-26 20:39:05 +03:00
* Incremental search using ^s and ^r like in Emacs
2019-06-08 23:12:52 +03:00
* Retain the search string when pressing / to search a second time.
* Make sure "git grep" output gets highlighted properly.
Done
----
* Add '>' markers at the end of lines being cut because they are too long
* Doing moar on an arbitrary binary (like /bin/ls) should put all
line-continuation markers at the rightmost column. This really
means our truncation code must work even with things like tabs and
various control characters.