alxhnr / build.vim Goto Github PK
View Code? Open in Web Editor NEWVim plugin for building projects
License: MIT License
Vim plugin for building projects
License: MIT License
Hello,
In order to implement properly #1 I need the Build command to do be able to use different command templates depending on its parameters.
For example if I add the following to the s:build_systems dict:
\ 'Dune':
\ {
\ 'file' : 'dune',
\ 'command' : 'dune',
\ },
Basically nothing work as expected:
Build
command produce the dune help messageBuild run
initialize the build directory but do nothing moreBuild build
actually build the projectBuild exec ./%:r.exe
would actually run the current file if it is defined in a dune file as an executable to be buit and the only dune file is in the current working directory of vim.So for a retro compatible fix of this I would propose that the 'command'
item of a build system could be either a string, in which case nothing changes, or a dictionary of specific commands.
This dictionary would be similar to s:language_cmds
items:
Build
command, and 'build'
would be used by defaults:prepare_cmd_for_shell
) and ran from the location of the first build system file foundAlso, a new magic should be added to s:prepare_cmd_for_shell
: %RELPATH%
being the relative path directory where the command will be ran to the current file.
This way I could implement my previous example as:
\ 'Dune':
\ {
\ 'file' : 'dune',
\ 'command' : {
\ 'build' : 'dune build',
\ 'clean' : 'dune clean',
\ 'run' : 'dune exec %RELPATH%/%HEAD%.exe',
\ },
\ },
Eventually, a 'base'
key could be added to the 'command'
dict (in this case the value would be 'dune') which would allow handling unknown arguments to Build
(:Build runtest
would expand to dune runtest
using 'base'
).
I would happily implement all of this but I do not want to take over your project @AlxHnr so what do you think ?
Does this conform to what you want for this plugin ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.