From 2f5b382087f131c0ab967600b2d9ce2f3201e653 Mon Sep 17 00:00:00 2001 From: mitermayer Date: Sun, 17 Sep 2017 23:38:58 -0700 Subject: feature: Adding more commands This includes more commands to interact with the prettier CLI from within vim itself --- autoload/prettier.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'autoload/prettier.vim') diff --git a/autoload/prettier.vim b/autoload/prettier.vim index 7d6eb08..79b4611 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -2,6 +2,27 @@ let s:root_dir = fnamemodify(resolve(expand(':p')), ':h') let s:prettier_job_running = 0 let s:prettier_quickfix_open = 0 +function! prettier#PrettierCliPath() abort + let l:execCmd = s:Get_Prettier_Exec() + + if l:execCmd != -1 + echom l:execCmd + else + call s:Suggest_Install_Prettier() + endif +endfunction + +function! prettier#PrettierCli(user_input) abort + let l:execCmd = s:Get_Prettier_Exec() + + if l:execCmd != -1 + let l:out = system(l:execCmd. ' ' . a:user_input) + echom l:out + else + call s:Suggest_Install_Prettier() + endif +endfunction + function! prettier#Prettier(...) abort let l:execCmd = s:Get_Prettier_Exec() let l:async = a:0 > 0 ? a:1 : 0 -- cgit v1.3