From 401c5ac12dba6ba3b6b1ceefca42c50d7d510c8d Mon Sep 17 00:00:00 2001 From: TeoDev1611 Date: Mon, 21 Jun 2021 09:44:32 -0500 Subject: [PATCH] Initial Commit --- README.md | 0 doc/deno.nvim.txt | 6 ++++++ plugin/deno.vim | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 README.md create mode 100644 doc/deno.nvim.txt create mode 100644 plugin/deno.vim diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/deno.nvim.txt b/doc/deno.nvim.txt new file mode 100644 index 0000000..2bd90b7 --- /dev/null +++ b/doc/deno.nvim.txt @@ -0,0 +1,6 @@ +______ _ _ _ +| _ \ | | | (_) +| | | |___ _ __ ___ | | | |_ _ __ ___ +| | | / _ \ '_ \ / _ \ | | | | | '_ ` _ \ +| |/ / __/ | | | (_) | \ \_/ / | | | | | | +|___/ \___|_| |_|\___/ \___/|_|_| |_| |_| diff --git a/plugin/deno.vim b/plugin/deno.vim new file mode 100644 index 0000000..8f2e4c3 --- /dev/null +++ b/plugin/deno.vim @@ -0,0 +1,52 @@ +" Author: TeoDev1611 +" Version: 0.1.0 +" Mantainer: TeoDev1611 +" Deno Vim + +" Config Variables +let g:deno_fmt = 'deno fmt ' +let g:deno_cache = 'deno cache ' +let g:deno_run = 'deno run -A ' +let g:deno_doc = 'deno doc --json ' +" Util variables +let s:current_time = strftime('%c') +let s:path = expand(':p') + +if !executable("deno") + echoerr "Deno executable not found" + finish +endif + +" Fmt Runner +function DenoFmt() + execute "!" . g:deno_fmt + echo "Succesfuly formated with: " . g:deno_fmt + echomsg "Fmt runned at" . s:current_time . "with: " . g:deno_fmt "path: " . s:path +endfunction + +" Cache runner +function DenoCache() + execute "!". g:deno_cache . s:path + echo "Cached succesfuly with: " . g:deno_cache + echomsg "Cache runned at" . s:current_time . "with: " . g:deno_cache "path: " . s:path +endfunction + +" Run current file +function DenoRun() + execute "!". g:deno_run . s:path + echo "Script runned succesfuly with: " . g:deno_run + echomsg "Script runned at" . s:current_time . "with: " . g:deno_run "path: " . s:path +endfunction + +" Deno Doc arg +function DenoDoc(file) + execute "!". g:deno_doc . file + echo "Documentation runned with: ". g:deno_doc + echomsg "Script runned at" . s:current_time . "with: " . g:deno_doc "path: " . s:path +endfunction + +" Register the commands +command! -nargs=0 DenoFmt call DenoFmt() +command! -nargs=0 DenoCache call DenoCache() +command! -nargs=0 DenoRun call DenoRun() +command! -nargs=1 DenoDoc call DenoDoc()