Giter Club home page Giter Club logo

build.vim's People

Contributors

alxhnr avatar lattay avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lattay

build.vim's Issues

[Feature proposal] Add more possible commands in build_systems

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 message
  • Build run initialize the build directory but do nothing more
  • Build build actually build the project
  • Build 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:

  • keys would correspond to the first argument from the Build command, and 'build' would be used by default
  • the commands themselves would be templates (using s:prepare_cmd_for_shell) and ran from the location of the first build system file found

Also, 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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.