From d98733c7a29bb3f11bd6b0fd95ae0989a414b1c8 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 21 Aug 2020 13:00:07 +0200 Subject: [PATCH] Added vim commands to defer with notification --- vim/plugin/defer.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vim/plugin/defer.vim b/vim/plugin/defer.vim index f0634a8..e505684 100644 --- a/vim/plugin/defer.vim +++ b/vim/plugin/defer.vim @@ -7,4 +7,14 @@ function Defer(command, callback) \ }) endfun +function s:echo(message) + echom a:message +endfun + +function s:notify(message) + call Defer('notify-send "Vim" "'.a:message.'"', { b -> 0 }) +endfun + comm -complete=shellcmd -nargs=* Defer call Defer(, { buffer -> 0 }) +comm -complete=shellcmd -nargs=* DeferEcho call Defer(, { buffer -> echo("Deferred job completed: ".) }) +comm -complete=shellcmd -nargs=* DeferNotify call Defer(, { buffer -> notify("Deferred job completed:\n$ ".) })