helix: add helix pager
This commit is contained in:
parent
ba4d00d1df
commit
d32bd28650
|
@ -31,6 +31,8 @@ create_scripts
|
|||
_sway_idle_toggle = [ final.swayidle ];
|
||||
kak-pager = [ fish final._diffr ];
|
||||
kak-man-pager = [ final.kak-pager ];
|
||||
helix-pager = [ fish final._diffr ];
|
||||
helix-man-pager = [ final.helix-pager ];
|
||||
musmenu = [ mpc-cli final.wdmenu trash-cli xdg-user-dirs libnotify sd wl-clipboard ];
|
||||
showkeys =
|
||||
[ ]; # This will not work unless programs.wshowkeys is enabled systemwide
|
||||
|
|
3
scripts/helix-man-pager
Executable file
3
scripts/helix-man-pager
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
col -b -x | hx
|
28
scripts/helix-pager
Normal file
28
scripts/helix-pager
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
if test (count $argv) -ne 0
|
||||
for i in $argv
|
||||
cat "$i"
|
||||
end | eval (status filename)
|
||||
exit 0
|
||||
end
|
||||
|
||||
set term_line_count (tput lines)
|
||||
|
||||
while read line
|
||||
set -a input_lines "$line"
|
||||
|
||||
set input_line_count (printf "%s\n" $input_lines | wc -l)
|
||||
|
||||
if test "$term_line_count" -lt "$input_line_count"
|
||||
begin
|
||||
printf "%s\n" $input_lines
|
||||
cat
|
||||
end | hx
|
||||
|
||||
exit 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
printf "%s\n" $input_lines
|
26
user/man.nix
26
user/man.nix
|
@ -1,16 +1,28 @@
|
|||
{ config, pkgs, lib, inputs, ... }:
|
||||
let inherit (pkgs.uservars) key theme color accent font desktop;
|
||||
in {
|
||||
config = {
|
||||
programs.man = {
|
||||
enable = true;
|
||||
generateCaches = true;
|
||||
let inherit (pkgs.uservars) key theme color accent font desktop editor;
|
||||
pagers = rec {
|
||||
kak = kakoune;
|
||||
kakoune = {
|
||||
PAGER = "${pkgs.kak-pager}/bin/kak-pager";
|
||||
MANPAGER = "${pkgs.kak-man-pager}/bin/kak-man-pager";
|
||||
SYSTEMD_PAGER = "${pkgs.kak-pager}/bin/kak-pager";
|
||||
SYSTEMD_PAGERSECURE = "1";
|
||||
};
|
||||
home.sessionVariables = {
|
||||
hx = helix;
|
||||
helix = {
|
||||
PAGER = "${pkgs.kak-pager}/bin/kak-pager";
|
||||
MANPAGER = "${pkgs.kak-man-pager}/bin/kak-man-pager";
|
||||
SYSTEMD_PAGER = "${pkgs.kak-pager}/bin/kak-pager";
|
||||
SYSTEMD_PAGERSECURE = "1";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
config = {
|
||||
programs.man = {
|
||||
enable = true;
|
||||
generateCaches = true;
|
||||
};
|
||||
home.sessionVariables = pagers.${editor};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue