programs: integrate nvimpager into man to make text reflow correctly
also get marginally better syntax highlighting! the cursor movements are a little strange, but overall net improvement
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -46,8 +46,6 @@
|
|||||||
|
|
||||||
## IMPROVEMENTS:
|
## IMPROVEMENTS:
|
||||||
- sane-deadlines: show day of the week for upcoming items
|
- sane-deadlines: show day of the week for upcoming items
|
||||||
- `man`: reflow text when resized
|
|
||||||
- most likely solution is to use a HTML pager: <https://unix.stackexchange.com/a/11413>
|
|
||||||
- curlftpfs: replace with something better
|
- curlftpfs: replace with something better
|
||||||
- safer (rust? actively maintained? sandboxable?)
|
- safer (rust? actively maintained? sandboxable?)
|
||||||
- handles spaces/symbols in filenames
|
- handles spaces/symbols in filenames
|
||||||
|
@@ -91,6 +91,7 @@ in
|
|||||||
"nmap"
|
"nmap"
|
||||||
"nmcli"
|
"nmcli"
|
||||||
"nmon"
|
"nmon"
|
||||||
|
"nvimpager"
|
||||||
"nvme-cli" # nvme
|
"nvme-cli" # nvme
|
||||||
# "openssl"
|
# "openssl"
|
||||||
"parted"
|
"parted"
|
||||||
|
@@ -133,6 +133,7 @@
|
|||||||
./nmcli.nix
|
./nmcli.nix
|
||||||
./notejot.nix
|
./notejot.nix
|
||||||
./ntfy-sh.nix
|
./ntfy-sh.nix
|
||||||
|
./nvimpager.nix
|
||||||
./nwg-panel
|
./nwg-panel
|
||||||
./objdump.nix
|
./objdump.nix
|
||||||
./obsidian.nix
|
./obsidian.nix
|
||||||
|
@@ -15,9 +15,11 @@
|
|||||||
# - --use-color = enable color instead of just monochrome (highlights search matches)
|
# - --use-color = enable color instead of just monochrome (highlights search matches)
|
||||||
# SYSTEMD_LESS defaults to FRSXMK
|
# SYSTEMD_LESS defaults to FRSXMK
|
||||||
env = rec {
|
env = rec {
|
||||||
|
# MANPAGER = "less";
|
||||||
PAGER = "less";
|
PAGER = "less";
|
||||||
LESS = "--incsearch --LONG-PROMPT --quit-if-one-screen --quit-on-intr --RAW-CONTROL-CHARS --shift=.2 --use-color";
|
LESS = "--incsearch --LONG-PROMPT --quit-if-one-screen --quit-on-intr --RAW-CONTROL-CHARS --shift=.2 --use-color";
|
||||||
SYSTEMD_LESS = LESS; #< used by journalctl
|
SYSTEMD_LESS = LESS; #< used by journalctl
|
||||||
};
|
};
|
||||||
|
mime.priority = 200; # fallback to more specialized pagers where exists
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -29,3 +29,10 @@ set conceallevel=2
|
|||||||
" source: https://www.reddit.com/r/neovim/comments/chlmfk/highlight_trailing_whitespaces_in_neovim/
|
" source: https://www.reddit.com/r/neovim/comments/chlmfk/highlight_trailing_whitespaces_in_neovim/
|
||||||
set list
|
set list
|
||||||
set listchars=tab:▷\·,trail:·,extends:◣,precedes:◢,nbsp:○
|
set listchars=tab:▷\·,trail:·,extends:◣,precedes:◢,nbsp:○
|
||||||
|
|
||||||
|
" when using vim to view manpages
|
||||||
|
" (`:Man topic` or `MANPAGER='nvim +Man!' man topic` or `vim man://topic`),
|
||||||
|
" instruct `man` to output unwrapped buffers, and let vim soft-wrap them.
|
||||||
|
" this allows one to resize the terminal and have the manpage be re-rendered.
|
||||||
|
" see: <https://github.com/neovim/neovim/issues/11436>
|
||||||
|
let g:man_hardwrap=0
|
||||||
|
24
hosts/common/programs/nvimpager.nix
Normal file
24
hosts/common/programs/nvimpager.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.nvimpager = {
|
||||||
|
packageUnwrapped = (pkgs.nvimpager.override {
|
||||||
|
neovim = config.sane.programs.neovim.packageUnwrapped;
|
||||||
|
}).overrideAttrs {
|
||||||
|
# check phase fails, something to do with me enabling plugins not expected by the tester
|
||||||
|
doCheck = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
suggestedPrograms = [ "neovim" ];
|
||||||
|
|
||||||
|
sandbox.whitelistWayland = true; # for system clipboard integration
|
||||||
|
|
||||||
|
env.MANPAGER = "nvimpager";
|
||||||
|
# env.PAGER = "nvimpager";
|
||||||
|
# `man 2 select` will have `man` render the manpage to plain text, then pipe it into vim for syntax highlighting.
|
||||||
|
# force MANWIDTH=999 to make `man` not hard-wrap any lines, and instead let vim soft-wrap lines.
|
||||||
|
# that allows the document to be responsive to screen-size/windowing changes.
|
||||||
|
# MANROFFOPT = "-c" improves the indentation, but i'm not totally sure what it actually does.
|
||||||
|
env.MANWIDTH = "999";
|
||||||
|
env.MANROFFOPT = "-c";
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user