fish cached source
ima genius
This commit is contained in:
@@ -1,2 +1,28 @@
|
||||
command -q zoxide; and command zoxide init fish | source
|
||||
command -q direnv; and command direnv hook fish | source
|
||||
function cached_source -d 'cache the command result for sourcing'
|
||||
set -l cache_dir $__fish_config_dir/source
|
||||
test -e $cache_dir; or mkdir $cache_dir; or return
|
||||
|
||||
command -q -- $argv[1]; or return
|
||||
|
||||
set -l cache_file $cache_dir/$argv[1].fish
|
||||
if status is-login; or not test -e $cache_file
|
||||
command $argv >$cache_file; or return
|
||||
end
|
||||
|
||||
source $cache_file
|
||||
end
|
||||
|
||||
function cached_source_static -d 'source the cached command result'
|
||||
test -e $__fish_config_dir/source/$argv[1].fish
|
||||
and source $__fish_config_dir/source/$argv[1].fish
|
||||
or cached_source $argv
|
||||
end
|
||||
|
||||
cached_source direnv hook fish
|
||||
|
||||
status is-interactive; or return
|
||||
cached_source zoxide init fish
|
||||
cached_source trashy completions fish
|
||||
cached_source sqlx completions fish
|
||||
|
||||
cached_source_static zmk --show-completion
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function remux --wraps ffmpeg --description 'remux to mp4'
|
||||
mkdir -p /tmp/remux
|
||||
test -e /tmp/remux; or mkdir /tmp/remux
|
||||
|
||||
# download file if input path is a url
|
||||
if string match -qr '^(https?://|youtu\.?be|[a-zA-Z0-9]{11}$)' $argv[1]
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,6 +23,7 @@
|
||||
# CLI / TUI
|
||||
!.config/gdu/
|
||||
!.config/fish/
|
||||
.config/fish/source
|
||||
!.config/paru/
|
||||
!.config/htop/
|
||||
!.config/tealdeer/
|
||||
|
||||
Reference in New Issue
Block a user