From 32c85f0c3fdf8b2665e9540511a2f4f2b28651f6 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Sun, 26 Jul 2020 16:45:27 -0400 Subject: [PATCH] fish: add mkcd and mansearch --- fish/functions/mansearch.fish | 4 ++++ fish/functions/mkcd.fish | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 fish/functions/mansearch.fish create mode 100644 fish/functions/mkcd.fish diff --git a/fish/functions/mansearch.fish b/fish/functions/mansearch.fish new file mode 100644 index 0000000..28de62d --- /dev/null +++ b/fish/functions/mansearch.fish @@ -0,0 +1,4 @@ +function mansearch --description 'Full-text search of man pages' + # -F is used to match literally (no regex) + command rg -z -F $argv (manpath | string split :) -l | command sed -r 's@.*/(.*)\.([0-9]+)(\.gz)?@\1(\2)@g' +end diff --git a/fish/functions/mkcd.fish b/fish/functions/mkcd.fish new file mode 100644 index 0000000..f1d325e --- /dev/null +++ b/fish/functions/mkcd.fish @@ -0,0 +1,3 @@ +function mkcd --description 'Create and cd into a directory' + mkdir -p $argv[1] && cd $argv[1] +end