Skip to content

Instantly share code, notes, and snippets.

@johnallen3d
Created August 11, 2022 15:26
Show Gist options
  • Save johnallen3d/9b885e9bbfeb34be8ec237358f229d21 to your computer and use it in GitHub Desktop.
Save johnallen3d/9b885e9bbfeb34be8ec237358f229d21 to your computer and use it in GitHub Desktop.
Use NeoVim as the scrollback pager in Kitty terminal allowing for search, navigation and yanking
scrollback_pager bash -c "exec nvim 63<&0 0</dev/null -u NONE -c 'map <silent> q :qa!<CR>' -c 'set shell=bash scrollback=100000 termguicolors laststatus=0 clipboard+=unnamedplus' -c 'autocmd TermEnter * stopinsert' -c 'autocmd TermClose * call cursor(max([0,INPUT_LINE_NUMBER-1])+CURSOR_LINE, CURSOR_COLUMN)' -c 'terminal sed </dev/fd/63 -e \"s/'$'\x1b'']8;;file:[^\]*[\]//g\" && sleep 0.01 && printf \"'$'\x1b'']2;\"'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment