summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorstuebinm2023-03-19 23:17:11 +0100
committerstuebinm2023-03-19 23:17:11 +0100
commiteec9a0315f05fad89cfd8c359d26cb30f6f19592 (patch)
tree2baf70e7e1edafe58c27d908b97df0f697ac2738 /home
parent19370f3bd46552d8abfcb7a1e0d8f5faeb5ab2b2 (diff)
home: mds alias to read markdown files
Diffstat (limited to 'home')
-rw-r--r--home/home-minimal.nix8
-rw-r--r--home/home.nix2
-rw-r--r--home/packages-minimal.nix2
3 files changed, 10 insertions, 2 deletions
diff --git a/home/home-minimal.nix b/home/home-minimal.nix
index f28240a..dc39d9d 100644
--- a/home/home-minimal.nix
+++ b/home/home-minimal.nix
@@ -57,6 +57,14 @@
fish_greeting = {
body = "";
};
+ mds.body = ''
+ if [ "$argv[1]" = "" ]
+ set pattern ".md"
+ else
+ set pattern $argv[1]
+ end
+ fd $pattern | fzf --preview="glow {} --style=dark" --bind ctrl-j:preview-down,ctrl-k:preview-up,ctrl-alt-j:preview-page-down,ctrl-alt-k:preview-page-up
+ '';
};
};
diff --git a/home/home.nix b/home/home.nix
index 74f6bde..604f490 100644
--- a/home/home.nix
+++ b/home/home.nix
@@ -59,7 +59,7 @@
echo "No url given"
return
end
- set choice (curl $url | rg -e '<a[^>]*href="([^"]*\.pdf)"[^>]*>([^<]*)</a>' -o | sed 's/<a[^>]*href="\([^"]*\)"[^>]*>\(.*\)<\/a>/"\1" "\2"/g' | fzf)
+ set choice (curl -L $url | rg -e '<a[^>]*href="([^"]*\.pdf)"[^>]*>([^<]*)</a>' -o | sed 's/<a[^>]*href="\([^"]*\)"[^>]*>\(.*\)<\/a>/"\1" "\2"/g' | fzf)
if test "$status" != 0
return
end
diff --git a/home/packages-minimal.nix b/home/packages-minimal.nix
index 5dbc7a2..17f4aa1 100644
--- a/home/packages-minimal.nix
+++ b/home/packages-minimal.nix
@@ -15,7 +15,7 @@
tree dnsutils inetutils pijul bat age libsecret gping bottom dogdns
cifs-utils jekyll fzf ripgrep fd sd bandwhich exa dive
ripgrep python39Packages.isort shellcheck graphviz
- zip unzip acpi sfz viu
+ zip unzip acpi sfz viu glow
yt-dlp weechat hexyl bottom lm_sensors
usbutils
# git