From 1a21be56c040a7c0fe96ad4a33dfd0d81152b005 Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Mon, 15 Apr 2024 09:49:03 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fish):=20Abbr=20to=20execute?= =?UTF-8?q?=20a=20.txt=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dot_config/fish/conf.d/20-aliases.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dot_config/fish/conf.d/20-aliases.fish b/dot_config/fish/conf.d/20-aliases.fish index 00ea263..0663b19 100644 --- a/dot_config/fish/conf.d/20-aliases.fish +++ b/dot_config/fish/conf.d/20-aliases.fish @@ -25,6 +25,15 @@ end abbr -a _cd_up --position command --regex "\.{2,}" --function _cd_up_func +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Execute .txt files as a command. +function _edit_txt_func --argument-names file + echo "$EDITOR $file" +end + +abbr -a _edit_txt --position command --regex ".+\.txt" --function _edit_txt_func + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Default command options.