Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoDev1611 committed Jun 21, 2021
0 parents commit 401c5ac
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
Empty file added README.md
Empty file.
6 changes: 6 additions & 0 deletions doc/deno.nvim.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
______ _ _ _
| _ \ | | | (_)
| | | |___ _ __ ___ | | | |_ _ __ ___
| | | / _ \ '_ \ / _ \ | | | | | '_ ` _ \
| |/ / __/ | | | (_) | \ \_/ / | | | | | |
|___/ \___|_| |_|\___/ \___/|_|_| |_| |_|
52 changes: 52 additions & 0 deletions plugin/deno.vim
Original file line number Diff line number Diff line change
@@ -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('<sfile>: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(<args>)

0 comments on commit 401c5ac

Please sign in to comment.