From 138d5522f9e7fa0faf7b8e2a0bc40c73c21a8206 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 30 Sep 2021 19:14:03 +0300 Subject: [PATCH] feat(console): with-editor --- .config/fish/config.fish | 6 ++++++ Console.org | 8 ++++++++ bin/scripts/autocommit | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 1f17f03..95e72a7 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -60,3 +60,9 @@ bind -M insert \eh backward-char bind -M insert \ew forward-word bind -M insert \eb backward-word # Keybindings:1 ends here + +# [[file:../../Console.org::*Functions][Functions:1]] +function e + eval $EDITOR $argv +end +# Functions:1 ends here diff --git a/Console.org b/Console.org index 34e744d..809f231 100644 --- a/Console.org +++ b/Console.org @@ -489,6 +489,14 @@ bind -M insert \eh backward-char bind -M insert \ew forward-word bind -M insert \eb backward-word #+end_src +** Functions +A small function to open the file with =$EDITOR=. + +#+begin_src fish +function e + eval $EDITOR $argv +end +#+end_src * Nushell :PROPERTIES: :header-args+: :tangle ./.config/nu/config.toml :comments link diff --git a/bin/scripts/autocommit b/bin/scripts/autocommit index 2bfa812..bca1396 100755 --- a/bin/scripts/autocommit +++ b/bin/scripts/autocommit @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# [[file:../../Console.org::*=autocommmit=][=autocommmit=:1]] +# [[file:../../Console.org::*=autocommit=][=autocommit=:1]] TIMEOUT_MIN=${TIMEOUT_MIN:-60} export DISPLAY=:0 @@ -58,4 +58,4 @@ fi if [[ $(git ls-files -u | wc -l) -gt 0 ]]; then notify-send -u critical "Autocommit $(pwd)" "Merge conflict!" fi -# =autocommmit=:1 ends here +# =autocommit=:1 ends here