diff options
| author | Mitermayer Reis <mitermayer.reis@gmail.com> | 2017-09-17 23:48:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-17 23:48:53 -0700 |
| commit | bfe75968b5b05cb4b31ea08697d62908539e623e (patch) | |
| tree | 6fcd31b6a42cc1fc962b85b8d983467b2cbbc5b8 /autoload/prettier.vim | |
| parent | 7f3c9f3d92619eedf0593b915dae0e3fd20aaa27 (diff) | |
| parent | 2f5b382087f131c0ab967600b2d9ce2f3201e653 (diff) | |
| download | vim-prettier-bfe75968b5b05cb4b31ea08697d62908539e623e.tar.xz | |
Merge pull request #54 from prettier/adding-extra-commands
feature: Adding more vim-prettier commands
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 |
