├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── doc └── mix.txt └── plugin └── mix.vim /.gitignore: -------------------------------------------------------------------------------- 1 | /doc/tags 2 | tags 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | **Participating** 2 | 3 | Anyone is welcome to open a pull-request, and I ask that you to scan the open 4 | issues on GitHub before creating a new issue. 5 | 6 | Be courteous and provide an appropriate amount of detail in your issue, and I 7 | will be happy to help! 8 | 9 | **Documentation** 10 | 11 | Do your best to document any new functionality. 12 | 13 | **Git commit messages** 14 | 15 | Please follow [these][0] guidelines when writing commit messages. 16 | 17 | [0]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mix.vim 2 | 3 | Plugin for using Elixir's build tool, `mix`. 4 | 5 | ## Installation 6 | 7 | I recommend installing [pathogen.vim][pathogen], then running the following: 8 | 9 | cd ~/.vim/bundle 10 | git clone git://github.com/mattreduce/vim-mix.git 11 | 12 | ## Usage 13 | 14 | - `:Mix [command]` runs the default mix task (the "run" task, unless otherwise 15 | configured), or the given command. 16 | - `:Mclean` cleans generated application files 17 | - `:Mcompile` compiles sources files 18 | - `:Mdeps` lists project dependencies and their status 19 | - `:Mdeps clean` removes dependency files 20 | - `:Mdeps compile` compiles dependencies 21 | - `:Mdeps get` gets all out of date dependencies 22 | - `:Mdeps unlock` unlocks all dependencies 23 | - `:Mdeps update` updates project dependencies 24 | - `:Mtest` runs the project's tests 25 | 26 | ## Planned commands 27 | 28 | - `:Mixfile` opens the project Mixfile. 29 | - `:Mdeps unlock ` unlocks _specific_ dependencies 30 | - `:Mdeps update ` updates _specific_ dependencies 31 | - `:Mdo` executes the commands separated by comma 32 | - `:Mescript` generates an escript and replaces the current buffer 33 | - `:Mrun` runs the given expression 34 | 35 | ## License 36 | 37 | Copyright © Matthew Conway. Distributed under the same terms as Vim itself. 38 | See `:help license`. 39 | 40 | [pathogen]: https://github.com/tpope/vim-pathogen 41 | -------------------------------------------------------------------------------- /doc/mix.txt: -------------------------------------------------------------------------------- 1 | *mix.txt* Plugin for using Elixir's build tool, mix. 2 | 3 | Author: Matthew Conway 4 | License: Same terms as Vim itself (see |license|) 5 | 6 | INTRODUCTION *mix* 7 | 8 | This plugin wraps access to Elixir's leiningen-inspired build tool, mix. 9 | 10 | COMMANDS *mix-commands* 11 | 12 | *mix-:Mix* 13 | :Mix [command] Runs the default mix task. This is the run task, 14 | unless the user has configured the project to use 15 | another task by default. 16 | 17 | *mix-:Mclean* 18 | :Mclean Cleans generated application files. 19 | 20 | *mix-:Mcompile* 21 | :Mcompile Compiles source files. 22 | 23 | *mix-:Mdeps* 24 | :Mdeps [subcommand] Lists all dependencies and their status. 25 | 26 | *mix-:Mtest* 27 | :Mtest Runs the tests for a project. 28 | 29 | ABOUT *mix-about* 30 | 31 | Obtain the latest mix.vim or report a bug on GitHub: 32 | 33 | https://github.com/mattreduce/vim-mix 34 | 35 | vim:tw=78:et:ft=help:norl: 36 | -------------------------------------------------------------------------------- /plugin/mix.vim: -------------------------------------------------------------------------------- 1 | " mix.vim - Plugin for using Elixir's build tool, `mix`. 2 | " Maintainer: Matthew Conway 3 | " Version: 0.1.0 4 | 5 | if exists('g:loaded_mix') || &cp 6 | finish 7 | endif 8 | let g:loaded_mix = 1 9 | 10 | function! s:Mix(...) 11 | if a:0 == 0 12 | execute '!mix' 13 | elseif a:0 == 1 14 | " Execute a top-level mix command 15 | execute '!mix ' . a:1 16 | else 17 | " Execute a subcommand, which is separated by a dot 18 | execute '!mix ' . a:1 . '.' . a:2 19 | endif 20 | endfunction 21 | 22 | " TODO: support command options 23 | command! -nargs=? Mix call s:Mix() 24 | 25 | function! s:Mclean() 26 | call s:Mix('clean') 27 | endfunction 28 | 29 | command! Mclean call s:Mclean() 30 | 31 | function! s:Mcompile() 32 | call s:Mix('compile') 33 | endfunction 34 | 35 | command! Mcompile call s:Mcompile() 36 | 37 | function! s:Mdeps(...) 38 | if a:0 == 0 39 | call s:Mix('deps') 40 | else 41 | call s:Mix('deps', a:1) 42 | endif 43 | endfunction 44 | 45 | command! -nargs=? Mdeps call s:Mdeps() 46 | 47 | function! s:Mtest() 48 | " TODO: load failures into the QuickFix list 49 | call s:Mix('test --no-color') 50 | endfunction 51 | 52 | command! Mtest call s:Mtest() 53 | 54 | " vim:set ft=vim et sw=2: 55 | --------------------------------------------------------------------------------