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

Define custom variables #12

Closed
Shatur opened this issue Mar 2, 2020 · 4 comments
Closed

Define custom variables #12

Shatur opened this issue Mar 2, 2020 · 4 comments

Comments

@Shatur
Copy link
Contributor

Shatur commented Mar 2, 2020

Is it possible to add the ability to define custom variables? For example, I have the following two tasks:

[project-build]
command=cmake --build . --target myawesomprogram
cwd=<root>/../build-$(VIM_PRONAME)-debug
errorformat=%f:%m:%l

[project-run]
command=myawesomprogram --argument example
cwd=<root>/../build-$(VIM_PRONAME)-debug
output=terminal

The first task builds the selected application from the entire project, and the second starts this application. If you need to change the application, then I need to replace its occurrences. It would be convenient to be able to set custom variable at the begging of the file for it.

Alternatively, this variable can be built-in and set from cmd like a profile.

@skywind3000
Copy link
Owner

  1. system environment variable is capable for this:

    command=echo $HOME

And thay can be changed in vimscript:

let $HOME = 'somewhere'
  1. There is also internal variable:

https://github.com/skywind3000/asynctasks.vim/wiki/Task-Examples#internal-variable-example

@Shatur
Copy link
Contributor Author

Shatur commented Mar 2, 2020

Yes, this will work, but such settings allows set the name system-wide, while executable file is project-wide. Is it possible to set this variable only for specific project? Like in regular IDE.

@skywind3000
Copy link
Owner

Currently, still want to keep this plugin simple enough
and no plan for project-wide variables.

@Shatur
Copy link
Contributor Author

Shatur commented Mar 3, 2020

Okay, It's not a problem to replace several occurrences, especially in vim :)

@Shatur Shatur closed this as completed Mar 3, 2020
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

2 participants