Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only enable for *.js files when tsconfig.json present? #299

Open
fidian opened this issue Nov 19, 2019 · 0 comments
Open

Only enable for *.js files when tsconfig.json present? #299

fidian opened this issue Nov 19, 2019 · 0 comments

Comments

@fidian
Copy link

fidian commented Nov 19, 2019

You have a wonderful plugin.

Is there a way to enable g:tsuquyomi_javascript_support only when the current directory or any parent has a tsconfig.json file? Right now I am thinking of adapting the routine found here, but would prefer if this was built into the plugin so it could just happen automatically.

Here's my attempt at making it work - I did not try this nor am I great at vimscript.

let local_path = "/"
let path_parts = split(getcwd(), "/")
for path_part in path_parts
    let local_path = local_path . path_part . "/"
    if filereadable(local_path . "tsconfig.json")
        let g:tsuquyomi_javascript_support = 1
    endif
endfor
unlet local_path path_parts  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant