chore: pager AnsiEsc

This commit is contained in:
2025-06-11 22:13:58 +00:00
parent 9c8a3790c5
commit 8631eac0d4
4 changed files with 33 additions and 14 deletions

View File

@@ -1,14 +1,10 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "pager" ''
nvim -R --clean -c 'set buftype=nofile' -c 'nnoremap q :q!<CR>' -c 'set nowrap' \
-c 'set runtimepath^=${pkgs.vimPlugins.vim-plugin-AnsiEsc}' \
-c 'runtime! plugin/*.vim' -c 'AnsiEsc' - $@
# ^^^^^^^^^^^^^^^^^^^^
# Prevents Neovim from treating the buffer as a file
# ^^^^^^^^^^^^^^^^^^^^
# Makes 'q' quit Neovim immediately
# ^^^^^^^^^^^
# Disables text wrapping
# ^^^^^^^^
# Enables ANSI color interpretation
nvim -R --clean NONE \
-c 'nnoremap q :q!<CR>' \
-c 'set buftype=nofile nowrap' \
-c 'set runtimepath^=${pkgs.vimPlugins.vim-plugin-AnsiEsc}' \
-c 'runtime! plugin/*.vim' \
-c 'set conceallevel=3' \
-c 'AnsiEsc' $@ -
''