diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2017-09-17 23:38:58 -0700 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2017-09-17 23:43:27 -0700 |
| commit | 2f5b382087f131c0ab967600b2d9ce2f3201e653 (patch) | |
| tree | 6fcd31b6a42cc1fc962b85b8d983467b2cbbc5b8 /autoload/prettier.vim | |
| parent | 7f3c9f3d92619eedf0593b915dae0e3fd20aaa27 (diff) | |
| download | vim-prettier-2f5b382087f131c0ab967600b2d9ce2f3201e653.tar.xz | |
feature: Adding more commands
This includes more commands to interact with the prettier CLI from
within vim itself
Diffstat (limited to 'autoload/prettier.vim')
| -rw-r--r-- | autoload/prettier.vim | 21 |
1 files changed, 21 insertions, 0 deletions
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('<sfile>: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 |
