You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we can see, we need total number of lines, which kitty does not include in KITTY_PIPE_DATA.
Work Around:
I could try to compute total number of lines using wc -l within my script. However, doing so requires that I first store the entire stdin into a variable (because wc -l would consume stdin and I need stdin later to feed to vim.)
Possible Solutions:
Include total number of lines in KITTY_PIPE_DATA.
Add a new special argument named @input_line_number or @total_line_count (like @selection).
The first one is preferred as the latter would still need bit of math and may force the need to write a wrapper script for folks who want it all inline within the kitty.conf file.
Notes
I am reluctant to use scrollback_pager mechanism as none of the examples mentioned in this thread implement the scrolling part. Moreover, vim's +LINE command-line argument does not seem to work when we use the term command to load stdin (as the current solutions do).
The text was updated successfully, but these errors were encountered:
Never mind. I figured it all out only to end with a disappointment where vim seems to have a bug that prevents it from correctly loading large buffers using the term command. Nevertheless, if you think someone else could use this feature, go right ahead.
The
launch
mechanism does not have the equivalent ofINPUT_LINE_NUMBER
asscrollback_pager
does.I am feeding the contents of the current screen and scrollback to
vim
like this:Where
vimw
is my wrapper script that execsvim
.I want to have my wrapper script scroll
vim
to the exact position as the scroll position within the kitty window.The equation to compute
input_line_number
is:As we can see, we need total number of lines, which kitty does not include in
KITTY_PIPE_DATA
.Work Around:
I could try to compute total number of lines using
wc -l
within my script. However, doing so requires that I first store the entire stdin into a variable (becausewc -l
would consume stdin and I need stdin later to feed tovim
.)Possible Solutions:
Include total number of lines in
KITTY_PIPE_DATA
.Add a new special argument named
@input_line_number
or@total_line_count
(like@selection
).Notes
I am reluctant to use
scrollback_pager
mechanism as none of the examples mentioned in this thread implement the scrolling part. Moreover, vim's+LINE
command-line argument does not seem to work when we use theterm
command to load stdin (as the current solutions do).The text was updated successfully, but these errors were encountered: