m | ||
sample-files | ||
.gitignore | ||
.travis.yml | ||
.whitesource | ||
build.sh | ||
go.mod | ||
go.sum | ||
install.sh | ||
LICENSE | ||
moar.go | ||
moar.sh | ||
README.md | ||
test.sh |
Moar is a pager. It's designed to just do the right thing without any configuration:
The intention is that Moar should work as a drop-in replacement for Less. If you find that Moar doesn't work that way, please report it!
Doing the right thing includes:
- Syntax highlight source code by default if Highlight is installed.
- Search is incremental / find-as-you-type just like in Chrome or Emacs
- Search becomes case sensitive if you add any UPPER CASE characters to your search terms, just like in Emacs
- Regexp 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
FIXME: End-user install instructions for the Go-built product
...
And now you can just invoke moar
from the prompt!
Setting Moar as Your Default Pager
Set it as your default pager by adding...
export PAGER=/usr/local/bin/moar
... to your .bashrc
.
Issues
Issues are tracked here, or you can send questions to johan.walles@gmail.com.
Developing
First, install Highlight, otherwise the test suite won't pass:
- On macOS:
brew install highlight
- On Ubuntu:
sudo apt-get install highlight
- Elsewhere, follow instructions
Also, you need the go tools.
Run tests:
./test.sh
Build + run:
./moar.sh ...
Install (into /usr/local/bin
) from source:
./install.sh
Making a new Release
FIXME: Go release instructions
TODO
-
Exit search on pressing up / down / pageup / pagedown keys and scroll. I attempted to do that spontaneously, so it's probably a good idea.
-
Release the
go
version as the newmoar
, replacing the previous Ruby implementation -
Searching for something above us should wrap the search.
-
Handle all kinds of line endings.
-
Enable exiting using ^c (without restoring the screen).
-
Start at a certain line if run as "moar.rb file.txt:42"
-
Add licensing information (BSD)
-
Make sure version information is printed if there are warnings.
-
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.
-
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).
-
Support viewing multiple files by pushing them in reverse order on the view stack.
-
Incremental search using ^s and ^r like in Emacs
-
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.
-
Make sure search hits are highlighted even when we have to scroll right to see them
-
Change out-of-file visualization to writing --- after the end of the file and leaving the rest of the screen blank.