gat
cat alternative written in Go.
Installation
Homebrew
$ brew install gat
go install
$ go install github.com/koki-develop/[email protected]
Releases
Download the binary from the releases page.
Usage
$ gat --help
cat alternative written in Go.
Usage:
gat [file]... [flags]
Flags:
-c, --force-color force colored output
-f, --format string output format (default "terminal256")
-h, --help help for gat
-l, --lang string language for syntax highlighting
--list-formats print a list of supported output formats
--list-langs print a list of supported languages for syntax highlighting
--list-themes print a list of supported themes with preview
-p, --pretty whether to format a content pretty
-t, --theme string highlight theme (default "monokai")
-v, --version version for gat
-l
, --lang
Explicitly set the language for syntax highlighting.
See languages.md for valid languages.
-f
, --format
Set the output format ( default: terminal256
).
See formats.md for valid formats.
-t
, --theme
Set the highlight theme ( default: monokai
).
See themes.md for valid thtmes.
-p
, --pretty
Format a content pretty.
For unsupported languages, this flag is ignored.
-c
, --force-color
gat
disables colored output when piped to another program.
Settings the --force-color
forces colored output to be enabled.
This is useful, for example, when used in combination with the less -R
command.
It is also useful to declare the following function to allow gat
to be used with a pager.
function gess() {
gat --force-color "$@" | less -R
}
Possible Performance Issues when it comes to large files
At Printer.go we should change
io.ReadAll
toio.Copy
orio.CopyBuffer
and to avoid allocation fromsrc := string(b)
To
Update module github.com/alecthomas/chroma to v2
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | github.com/alecthomas/chroma | require | major |
v0.10.0
->v2.5.0
|Release Notes
alecthomas/chroma
v2.5.0
Compare Source
Changelog
4bfa1bb
Rust: Add initial support for string interpolationf5f48e2
Rust: Generalize declaritive and function-like macros (#742)55b0e59
Rust: Attempt to lex constant idents (#741)87869f8
Fix rust byte char capture (#740)0ea6503
Rust: Include starting apostrophe in lifetime / loop label token (#739)633f8e0
Removes 'tabindex="0"' from `3d1bc51
add missing type suffixes for nimd5b3291
Add default diff support (#732)db073d8
deps: Bump modules forcmd/chromad
4553686
deps: Bump go modules forcmd/chroma
366b9db
deps: Bump go modules482cb62
[Rust] Fix string whitespace skip4aaf294
Update issue template to reference playground shareable links5ca7345
fix: inconsistent YAML multiline parsing (#475)d330b76
feat: support sharing in playground0e2db44
Add-webkit-user-select: none;
to support Safari45e3bfb
Convert bashsessions lexer to XMLv2.4.0
Compare Source
Changelog
aecedef
Rename 'Base Makefile' lexer to 'Makefile'740e4b8
Add systemd .service and .socket to ini lexerf07788e
More improvements to PowerShell lexer (#708)94d7858
Create Onedark theme (#704)42e5421
Improved PowerShell lexer (#700)16fd666
Fix a bug that ate functions ;) (#702)ee9558d
Update c.xml877797e
fix: add CSSgap
property5644f41
Add lexer for BQN (#691)71d4be6
Lexer support for the stas language (#699)be4aebd
Add Vala Lexer (#697)d6ea504
Classify object names and enum names as class names6ca7db7
Fix typobe6230c
Update Rose-pine styleebba701
feat: add MustNewXMLStylec263f6f
feat: XML style definitions (#693)b264397
fix: ensure HTML flags apply to --html-stylesd0e811c
fix: use a class with line links when requested (#692)5e27ea4
Update Catppuccin for all variants (#687)f0bac8c
Lexer for VHS (#690)06f7007
Update READMEs to be more obvious about XML lexers.9b9b245
Feat: Add Rosé-Pine variants (#689)b2a2ba5
added lexer for PSL (#688)40b7a91
Upgrade project to Go 1.19 and switch to alecthomas/assert/v2b338844
add catppuccin mochab7c7bdb
Add a lexer for sed (#682)5559bcc
Add support for F# open static class396f572
fix: parse all of@foo.bar
as a Python decorator750df98
style: reformat Whiley expected testdatad0d94c2
Revise the fortran lexer to correctly flag whitespace for "DO CONCURRENT" and "GO TO", and to correctly flag the word boundary of keywords.c56819b
Fixed OpenEdgeABL String literals (#652)48a2af1
Update UsingByGroup documentation739028e
Add pygments2chroma_xml.py65c601b
Add HLSL language support (#675)cbe8b53
Add Modus Operandi (light) theme5b957aa
Add Modus Vivendi (dark) themef3aeb99
Add .editorconfig1da7ff5
Add .pylintrc to ini lexerd38b871
Add linkable line number option to CLI9ac9b11
Add .mts,.cts to typescript lexer (#677)v2.3.0
Compare Source
Changelog
6138519
Add properties to supported languages (#674)a238967
Improve properties file lexer (#671)a531e40
Add lexer for properties files (#670)dbb09a5
Add Colour.ClampBrightness and StyleBuilder.Transform.e1a35d4
transact-sql: added functions string_agg and concat_ws to lexer3f86ac7
Add Gruvbox light themed55b06c
Bump testify, repr to the latest version (#665)4fa270a
Update GAS lexer (#661)cde3818
Update mcfunction lexer to support newer spec of commands6538430
cfengine3: Removed rule attempting to highlight variable names111921a
Add cjs to Javascript lexerc13ff14
fix(styles/github-dark): update definitions, reformat96fe58e
Add BSDmakefile to make lexer (#654)c714e84
add(styles/github-dark): github's dark colorscheme for chroma (#653)3b326be
Add Dockerfile.* to docker lexer5ce1d5d
lexers: Add BIND DNS Zone lexerf941d46
Add Chapel Lexer298b727
Revise fortran fixed format lexer to recognize comments using the "!" mark in columns 1-5 and columns > 6. Remove incorrect "0" label being a comment.9a038fb
Revise fortran lexer to be consistent with the current version in pygmentsv2.2.0
Compare Source
Changelog
d18e8a4
AddInlineCode
option for inline code blocksv2.1.0
Compare Source
Changelog
530c45d
Don't append semicolon to styleEntry if there is no other style5397b48
Append semicolon totabWidthStyle
.c78b8a6
Fix extra semicolon intabWidthStyle
806ca29
Add V lexer (#640)v2.0.1
Compare Source
Changelog
4dfc2ca
refactor: run go mod tidy on chromadv2.0.0
Compare Source
Changelog
d13d611
Add value keyword for Kotlindea6a13
Add CSS style inheritance toWithCustomCSS
option7d77940
[html formatter] Add option to let users provide custom CSS styles7cc13cf
Add support for F# package reference + Fix CommentPreproc detection (#631)073a30b
Add Whiley Lexer (#628)44d1d23
fix: revert line change from pygments converterd070b1c
Fix for C# identifiers with leading underscoresf7d2bb0
fix: pin to Go 1.17 for nowf7893bc
add an average rgb scheme7bfe2f4
fix: add Dartrequired
keywordConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update module golang.org/x/term to v0.7.0
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | golang.org/x/term | require | minor |
v0.6.0
->v0.7.0
|Release Notes
golang/term
v0.7.0
Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update module github.com/google/yamlfmt to v0.9.0
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | github.com/google/yamlfmt | require | minor |
v0.8.0
->v0.9.0
|Release Notes
google/yamlfmt
v0.9.0
Compare Source
The Content Analyzer Release
Biggest release in a long time! Had lots of spare time to fix some stuff that has been requested for a while, as well as some stuff that came up during the work on this release.
Features
Downgrade to Go 1.18
This is the most disruptive change, although I hope it won't affect anyone too much. Previously,
yamlfmt
was using Go 1.19 and then Go 1.20. I wasn't actually using any features from Go 1.19, and onlyerrors.Join
from Go 1.20. Since I now support installing as a pre-commit hook, and some folks still go throughgo install
to installyamlfmt
, I figured it would be in everyone's best interest to support a lower minimum version. I still make use of generics and would like to continue to, so I went with Go 1.18 as the minimum required version.Better Docs
The docs have been cleaned up quite a bit and should be easier to navigate. I'm still considering moving over to using the GitHub Wiki feature, but right now it's really convenient to have the docs living with the code and there's a chance I might opt for a documentation site instead. I'll keep thinking about this!
Content Analyzer
A new construct has been added in this release, the
ContentAnalyzer
. This is an interface designed for performing actions based on the contents of the discovered yaml files. In this release, the only action currently possible is excluding yaml files based on their content instead of justexclude
patterns. I added two ways to do this.Metadata
In the
yamlfmt
library a new construct has been added called Metadata. See the Metadata docs for more information. This was created in this release to support the first type of Metadata,ignore
:If this metadata is detected in the document,
yamlfmt
will exclude it from formatting.Exclude files by content regex (#101)
The other way is through a new command configuration called
regex_exclude
. Using Golang regexes, you can now provide a regex foryamlfmt
to match with each files contents. For example, if you generate yaml files with a header comment:You can provide the following
regex_exclude
:This will cause any file with that header comment to be excluded from formatting.
Configure
yamlfmt
through the CLI (#88)This one has been requested for a while and I've wanted to do it for a while but never could think of a nice way to do it based on how I'd chosen to implement configuration. I've settled on an implementation that I think will work pretty well, and doesn't rock the boat too much. This should be easier for folks using
yamlfmt
directly in CI, removing the need for a.yamlfmt
file if you'd like not to.Drop Merge Tags (#102)
yamlfmt
used to always add a!!merge
tag explicitly:This release adds a formatter configuration option called
drop_merge_tag
, that whentrue
will ensure this tag is excluded:Pad Line Comments (#104)
By default,
yamlfmt
will put one space between line contents and the comment on that line. The new formatter configuration option calledpad_line_comments
will allow you to configure the number of spaces that theyaml
library uses to pad line comments. i.e. withpad_line_comments: 1
And with
pad_line_comments: 2
Bug Fixes
Absolute paths in
doublestar
exclude patterns (#97)Providing an absolute system path in your
exclude
patterns would previously not match in most scenarios. This has been fixed, and absolute paths like/home/user/**/ignore_this_file.yaml
should work now.Contributors
Thank you @badouralix for all the new suggestions this release, as well as contributing a bugfix in CLI configuration (#100 which I'm glad was found before release), and the
pad_line_comments
feature!This ended up being a large release because I had some free time to really catch up on the features I've wanted to include for a while. Now that I've settled up some of these feature gaps, I'm going to spend my time mainly on improving the testing in this repo. I plan on setting up some end-to-end tests to improve my verification of release (which right now is just me running the command a bunch of different ways). I also want to finally properly
godoc
all the types at least in the mainyamlfmt
library section. I will still be addressing bugfixes, but feature work may get put on hold unless there's really low-hanging fruit or someone else is willing to contribute them. Thanks as always for using the tool and providing your feedback!Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update module github.com/spf13/cobra to v1.7.0
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | github.com/spf13/cobra | require | minor |
v1.6.1
->v1.7.0
|Release Notes
spf13/cobra
v1.7.0
Compare Source
✨ Features
bash
,zsh
,pwsh
, &fish
: @h4ck3rk3y #1903🐛 Bug fixes
template
import variable name: @yashLadha #1879🧪 Testing & CI/CD
🔧 Maintenance
stale.yaml
mispellings: @enrichman #1863Vitess
andArewefastyet
to projects using cobra: @frouioui #1932✏️ Documentation
MarkFlagsMutuallyExclusive
example in user guide: @janhn #1904shell_completions.md
: @gusega #1907This release contains several long running fixes, improvements to powershell completions, and further optimizations for completions.
Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you! 🐍
Full changelog: https://github.com/spf13/cobra/compare/v1.6.1...v1.7.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update module github.com/alecthomas/chroma/v2 to v2.7.0
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | github.com/alecthomas/chroma/v2 | require | minor |
v2.6.0
->v2.7.0
|Release Notes
alecthomas/chroma
v2.7.0
Compare Source
Changelog
b9e3758
Upgrade goreleaser.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update module github.com/alecthomas/chroma/v2 to v2.6.0
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | github.com/alecthomas/chroma/v2 | require | minor |
v2.5.0
->v2.6.0
|Release Notes
alecthomas/chroma
v2.6.0
Compare Source
Changelog
f995707
cfengine3 xml: add $(..) to match NameVariable (#768)cc132ed
cfengine3 (#766)7e30655
Allow custom XML lexers and styles to be loaded from the command-line.0d91785
Upgrade go + golangci-lintb831d1b
Groovy added a 'record' type and keyword in version 4 (#764)42c314d
Raku: Change the token type of builtin types to KeywordType (#759)96a518b
[Python]Add match and case to Keywords (#756)ecb69ce
Add Note about testing lexers to Readme (#757)3131088
Fix Playground on Windows (#758)22f3c60
styles/vulcan: Fix background color (#753)ba01b92
Add support for Z80 assembly (#751)3ac94ee
Add HolyC support (#750)1d0ed7f
increase php priority over phtmla40c95e
Add support for Natural languageConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Update actions/setup-go action to v4
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | actions/setup-go | action | major |
v3
->v4
|Release Notes
actions/setup-go
v4
Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Configure Renovate
Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.
🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.
Detected Package Files
.github/workflows/build.yml
(github-actions).github/workflows/release.yml
(github-actions)go.mod
(gomod)Configuration Summary
Based on the default config's presets, Renovate will:
fix
for dependencies andchore
for all others.node_modules
,bower_components
,vendor
and various test/tests directories.🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the
renovate.json
in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.What to Expect
With your current configuration, Renovate will create 1 Pull Request:
Update module github.com/alecthomas/chroma to v2
renovate/github.com-alecthomas-chroma-2.x
main
v2.5.0
❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.
This PR has been generated by Mend Renovate. View repository job log here.
Update peter-evans/create-pull-request action to v5
This PR contains the following updates:
| Package | Type | Update | Change | |---|---|---|---| | peter-evans/create-pull-request | action | major |
v4
->v5
|Release Notes
peter-evans/create-pull-request
v5
Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
Fails to be a `cat` alternative
tail -f some_log_file | cat
works,tail -f some_log_file | gat
doesn't.yes | cat
works,yes | gat
doesn't.cat a_file_70_GB_in_size
works,gat a_file_70_GB_in_size
isn't even worth trying (as you're reading the whole file into memory before processing).Call it what it is: a console pretty-printer. It is in no way a
cat
alternative, not the same ballpark, not the same league, hardly even the same sport!Dependency Dashboard
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Open
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Detected dependencies
github-actions
gomod