Open Hubro opened 1 year ago
I use kitty too, I'll take a look.
The AnsiEsc support, to be honest, is only meant for simple things like Git diffs. And I haven't looked at or updated the version I have in many years. Dunno right now I'm going to do that soon, this project needs a lot of work in general.
If you don't really need AnsiEsc support, you can try turning it off with:
let g:vimpager.ansiesc = 0
.
I will look at whatever the bug is here a bit later.
I tried your mapping, and it does run for me, although the AnsiEsc output is not ideal.
Did you install a different version of AnsiEsc with Plug or pathogen or something? Is your vim recent?
Did you install a different version of AnsiEsc with Plug or pathogen or something? Is your vim recent?
I'm using NVIM v0.7.2, I just installed "rkitover/vimpager" using vim-plug. I haven't installed AnsiEsc separately.
It does "kind of" work for me too, after I move past the error:
Disabling ANSI support wouldn't be very useful, as it's really the only reason I'm trying vimpager :sweat_smile: Otherwise I would just pipe to nvim -
, which is my current solution[1]. I'm just really tired of the terminal turning black/white any time I do. I'm basically trying to replicate the scrollback experience in Alacritty, which lets me scroll, select and copy from the history buffer using Vim keybindings.
map f1 launch --stdin-source=@screen_scrollback --type=overlay nvim - -m -n + +"set nornu" +"set nonu" +"set bt=nofile"
Disabling ANSI support wouldn't be very useful, as it's really the only reason I'm trying vimpager :sweat_smile:
The ANSI support in vimpager is generally very broken and is only meant for simple things like Git diffs/colordiff/etc.. As far as highlighting goes, the point of vimpager is to use Vim's powerful filetype detection and syntax highlighting support.
I haven't worked on this project in a while, but I might look into updating AnsiEsc in case it has gotten any better and/or fixing some things in it. Maybe there are better solutions now too, I may do some research. I'm not optimistic about this however and I'm not promising anything. AnsiEsc is a giant horrible hack, which I made even worse in my copy.
I'm basically trying to replicate the scrollback experience in Alacritty, which lets me scroll, select and copy from the history buffer using Vim keybindings.
Have you considered using the tmux scrollback support with something like:
set-window-option -g mode-keys vi
bind-key Escape copy-mode
# Add shift-page<up/down> bindings for scrolling.
bind-key -T root -n S-PPage copy-mode -u
bind-key -T copy-mode-vi -n S-PPage send-keys -X page-up
bind-key -T copy-mode-vi -n S-NPage send-keys -X page-down
# Increase copy-mode buffer size.
set-option -g history-limit 300000
. This may give you most of what you want, you can copy and paste from the scrollback as well. This is from the tmux config I maintain here.
I'm using this keybind with Kitty:
This causes errors when vimpager starts: