eraserhd / kak-ansi Goto Github PK
View Code? Open in Web Editor NEWKakoune support for rendering ANSI-colored text.
Home Page: https://github.com/eraserhd/kak-ansi
License: The Unlicense
Kakoune support for rendering ANSI-colored text.
Home Page: https://github.com/eraserhd/kak-ansi
License: The Unlicense
Hi! Not sure if this is within the intended scope of the project — I'm not really familiar with the details of formatting text in terminals, but:
I've installed this plugin via plug.kak, and it seems to work well as a pager: PAGER=kak git log
has colors and looks great. PAGER=kak man man
however — not so much:
man - format and display the on-line manual pages
S�SY�YN�NO�OP�PS�SI�IS�S
m�ma�an�n [-�-a�ac�cd�df�fF�Fh�hk�kK�Kt�tw�wW�W] [-�--�-p�pa�at�th�h] [-�-m�m _�s_�y_�s_�t_�e_�m] [-�-p�p _�s_�t_�r_�i_�n_�g] [-�-C�C _�c_�o_�n_�f_�i_�g_�__�f_�i_�l_�e] [-�-M�M
_�p_�a_�t_�h_�l_�i_�s_�t] [-�-P�P _�p_�a_�g_�e_�r] [-�-B�B _�b_�r_�o_�w_�s_�e_�r] [-�-H�H _�h_�t_�m_�l_�p_�a_�g_�e_�r] [-�-S�S _�s_�e_�c_�t_�i_�o_�n_�__�l_�i_�s_�t]
[_�s_�e_�c_�t_�i_�o_�n] _�n_�a_�m_�e _�._�._�.
D�DE�ES�SC�CR�RI�IP�PT�TI�IO�ON�N
m�ma�an�n formats and displays the on-line manual pages. If you specify _�s_�e_�c_�t_�i_�o_�n, m�ma�an�n only looks in that section of the manual. _�n_�a_�m_�e is normally the
name of the manual
page, which is typically the name of a command, function, or file. However, if _�n_�a_�m_�e contains a slash (/�/) then m�ma�an�n interprets it as a file specification, so that you
can do m�ma�an�n .�./�/f�fo�oo�o.�.5�5 or even m�ma�an�n /�/c�cd�d/�/f�fo�oo�o/�/b�ba�ar�r.�.1�1.�.g�gz�z.
See below for a description of where m�ma�an�n looks for the manual page files.
M�MA�AN�NU�UA�AL�L S�SE�EC�CT�TI�IO�ON�NS�S
The standard sections of the manual include:
[...]
Without any styling, of course.
I've tried all combinations of ansi-enable/disable/render/clear without any changes. Am I doing something wrong?
I'm using macOS with kitty as my terminal, if that's relevant.
Hello,
I looked at your Nixos dotfiles, as well as nix packages for plugins available to use with Kakoune, and it seems like the code below should work. However, when I run "nixos-rebuild switch" it tells me that kak-ansi is an undefined variable. The kak-buffers plugin that I also listed works as expected.
Also, I am having trouble understanding what this plugin does by the description. I having been looking for a command-line tool that will take my kakoune syntax highlighting from the editor and turn it into ansi color escaping when I send the text to a repl. Is that what this plugin does? It looks like from the code that it does that for a selection (which would be perfect).
Sorry to keep asking you questions. It is tough to find people that share an overlapping interest in Nixos, Clojure, and Kakoune.
{
nixpkgs.overlays = [
(self: super: {
kakoune = super.wrapKakoune self.kakoune-unwrapped {
configure = {
plugins = with self.kakounePlugins; [
parinfer-rust
kak-ansi
kak-buffers
];
};
};
})
];
environment.systemPackages = [ pkgs.kakoune ];
}
v2020.09.01-1320-g94192402
scrollback_pager
to kak -ro
In between lines there's this color code that isn't rendered correctly in the pager (CTRL+SHIFT+h
)
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
]133;A�\
�~
❯
]133;A�\
�~
❯
No response
This is a mawww/kakoune#4801 copy-paste. I noticed I actually use this plugin and was diverted here. Thanks :)
I'd like to use Kakoune as a pager, but when I do git log
in a repository with a long history, the processing of the ANSI sequences takes ages and I have to wait quite a long time until I see any text. Can we let the filtering program output the filtered text right away and then add highlighting later? That would make it viable to actually use Kakoune as a pager for large portions of text.
Currently, kak-ansi
checks whether the filter binary exists. It could also check whether it is the proper version, to avoid problems after an update.
If I run kak < repro.txt
it only reads 420 lines, even though the file has 4000 lines.
Ok this just because the file contained invalid UTF-8.
Will try to work on a fix, or at least print a warning.
When I do
PAGER=kak git log
In the kakoune git repository, there is no highlighting even though the escape sequences have been deleted.
When I scroll to the bottom of the buffer, the ansi sequences are still there.
Running ansi-render
manually removes the ansi sequences, but still no coloring.
It works fine for smaller git histories though.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.