├── .editorconfig
├── .gitignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── doc
└── vagrant.txt
├── ftdetect
└── vagrant.vim
├── plugin
└── vagrant.vim
├── update_automagic.sh
└── update_commands.rb
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = true
8 | insert_final_newline = true
9 |
10 | [*.md]
11 | trim_trailing_whitespace = false
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /doc/tags
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # vim-vagrant CHANGELOG
2 |
3 | ## Version 1.1.2 (December 10, 2014)
4 |
5 | - update with commands in Vagrant 1.7
6 |
7 | ## Version 1.1.1 (June 7, 2013)
8 |
9 | - move ftplugin to ftdetect
10 |
11 | ## Version 1.1.0 (May 21, 2013)
12 |
13 | - don't load plugin if vagrant isn't installed
14 | - add MIT license
15 |
16 | ## Version 1.0.0 (April 25, 2013)
17 |
18 | - Initial release
19 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, and in the interest of
4 | fostering an open and welcoming community, we pledge to respect all people who
5 | contribute through reporting issues, posting feature requests, updating
6 | documentation, submitting pull requests or patches, and other activities.
7 |
8 | We are committed to making participation in this project a harassment-free
9 | experience for everyone, regardless of level of experience, gender, gender
10 | identity and expression, sexual orientation, disability, personal appearance,
11 | body size, race, ethnicity, age, religion, or nationality.
12 |
13 | Examples of unacceptable behavior by participants include:
14 |
15 | - The use of sexualized language or imagery
16 |
17 | - Personal attacks
18 |
19 | - Trolling or insulting/derogatory comments
20 |
21 | - Public or private harassment
22 |
23 | - Publishing other's private information, such as physical or electronic
24 | addresses, without explicit permission
25 |
26 | - Other unethical or unprofessional conduct.
27 |
28 | Project maintainers have the right and responsibility to remove, edit, or reject
29 | comments, commits, code, wiki edits, issues, and other contributions that are
30 | not aligned to this Code of Conduct. By adopting this Code of Conduct, project
31 | maintainers commit themselves to fairly and consistently applying these
32 | principles to every aspect of managing this project. Project maintainers who do
33 | not follow or enforce the Code of Conduct may be permanently removed from the
34 | project team.
35 |
36 | This code of conduct applies both within project spaces and in public spaces
37 | when an individual is representing the project or its community.
38 |
39 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
40 | reported by opening an issue or contacting one or more of the project
41 | maintainers.
42 |
43 | This Code of Conduct is adapted from the [Contributor
44 | Covenant](http://contributor-covenant.org), version 1.2.0, available at
45 |
46 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing To My Vim Plugins
2 |
3 | I'm not a Vim wizard by any means, nor am I too proud to accept
4 | contributions that improve my code, so if you think you have a problem,
5 | improvement, or other contribution towards the betterment of Vim-kind,
6 | please file an issue or, where appropriate, a pull request.
7 |
8 | Before filing an issue, please read this article by my friends and
9 | former colleagues at Viget:
10 |
11 |
12 |
13 | Keep in mind that I'm not paid to write Vim plugins, so I'm doing this
14 | in my spare time, which means it might take me a while to respond. If
15 | you're not satisfied with my response to your problem with my free (as
16 | in beer and in speech) software, I will give you triple your $0.00 back.
17 |
18 | When filing a pull request, please explain what you're changing and why.
19 | Please limit your changes to the specific thing you're fixing; it's
20 | probably easiest for both of us if you isolate your change in a topic
21 | branch that I can merge without pulling in other stuff. Please do not
22 | update CHANGELOG, versions, etc.; I'll take care of that. I'll also add
23 | you to the Credits list with my thanks.
24 |
25 | All of my Vim plugins use the ISC license. If you submit a pull request,
26 | I'll assume you are OK with any code you add being placed under that
27 | same ISC license. If this is not the case for any reason, please let me
28 | know why you can't tolerate the ISC license. I am 99.99% likely to
29 | reject your change in that case, but I'll let you have your say.
30 |
31 | This project is intended to be a safe, welcoming space for collaboration, and
32 | contributors are expected to adhere to the [Contributor
33 | Covenant](http://contributor-covenant.org) code of conduct.
34 |
35 | Thanks for contributing!
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2015 Mark Cornick
2 |
3 | Permission to use, copy, modify, and/or distribute this software for any purpose
4 | with or without fee is hereby granted, provided that the above copyright notice
5 | and this permission notice appear in all copies.
6 |
7 | THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
13 | THIS SOFTWARE.
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/hashicorp/vagrant/blob/v2.2.0/CHANGELOG.md)
2 |
3 | # Call For Maintainers
4 |
5 | This plugin, along with others like it, is now maintained by the
6 | [HashiVim](http://hashivim.github.io/) organization, which is looking for
7 | additional maintainers and contributors. See the HashiVim home page for
8 | further information.
9 |
10 | # vim-vagrant
11 |
12 | This plugin adds a `:Vagrant` command that runs vagrant, with tab
13 | completion of subcommands. It also sets up Vagrantfiles to be highlighted
14 | as Ruby.
15 |
16 | ## Installation
17 |
18 | With [pathogen.vim](https://github.com/tpope/vim-pathogen) just do:
19 |
20 | cd ~/.vim/bundle
21 | git clone https://github.com/hashivim/vim-vagrant.git
22 |
23 | If you prefer to use something besides pathogen, go ahead.
24 |
25 | ## Credits
26 |
27 | Thanks to these contributors:
28 |
29 | * Denny Schäfer @tuxinaut
30 |
31 | Originally written by Mark Cornick . I fumbled my
32 | way through VimL by reading @tpope's code, so thanks to Tim.
33 |
34 | Licensed under the ISC license.
35 |
36 | This project is intended to be a safe, welcoming space for collaboration, and
37 | contributors are expected to adhere to the [Contributor
38 | Covenant](http://contributor-covenant.org) code of conduct.
39 |
--------------------------------------------------------------------------------
/doc/vagrant.txt:
--------------------------------------------------------------------------------
1 | *vagrant.txt* basic vim/vagrant integration
2 |
3 | Author: HashiVim
4 | License: ISC license
5 | Repo: https://github.com/hashivim/vim-vagrant
6 |
7 | COMMANDS *vagrant*
8 |
9 | This command is only available if vagrant is in your PATH.
10 |
11 | *vagrant-:Vagrant*
12 | :Vagrant [args] Invoke an arbitrary vagrant command.
13 |
14 | vim:tw=78:et:ft=help:norl:
15 |
--------------------------------------------------------------------------------
/ftdetect/vagrant.vim:
--------------------------------------------------------------------------------
1 | au BufRead,BufNewFile Vagrantfile set filetype=ruby
2 |
--------------------------------------------------------------------------------
/plugin/vagrant.vim:
--------------------------------------------------------------------------------
1 | " vagrant.vim - basic vim/vagrant integration
2 | " Maintainer: HashiVim
3 |
4 | if exists("g:loaded_vagrant") || v:version < 700 || &cp || !executable('vagrant')
5 | finish
6 | endif
7 | let g:loaded_vagrant = 1
8 |
9 | function! s:commands(A, L, P)
10 | return join([
11 | \ "box",
12 | \ "cap",
13 | \ "cloud",
14 | \ "destroy",
15 | \ "docker-exec",
16 | \ "docker-logs",
17 | \ "docker-run",
18 | \ "global-status",
19 | \ "halt",
20 | \ "help",
21 | \ "hostmanager",
22 | \ "init",
23 | \ "list-commands",
24 | \ "login",
25 | \ "package",
26 | \ "plugin",
27 | \ "port",
28 | \ "powershell",
29 | \ "provider",
30 | \ "provision",
31 | \ "push",
32 | \ "rdp",
33 | \ "reload",
34 | \ "resume",
35 | \ "rsync",
36 | \ "rsync-auto",
37 | \ "snapshot",
38 | \ "ssh",
39 | \ "ssh-config",
40 | \ "status",
41 | \ "suspend",
42 | \ "up",
43 | \ "upload",
44 | \ "validate",
45 | \ "version",
46 | \ "winrm",
47 | \ "winrm-config"
48 | \ ], "\n")
49 | endfunction
50 |
51 | augroup vagrant
52 | autocmd!
53 | autocmd VimEnter *
54 | \ command! -nargs=+ -complete=custom,s:commands Vagrant execute '!vagrant '.
55 | augroup END
56 |
57 | " vim:set et sw=2:
58 |
--------------------------------------------------------------------------------
/update_automagic.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | VERSION=$1
3 |
4 | function usage {
5 | echo -e "
6 | USAGE EXAMPLES:
7 |
8 | ./$(basename $0) 0.8.7
9 | ./$(basename $0) 0.9.2
10 | "
11 | }
12 |
13 | if [ $# -ne 1 ]; then
14 | usage
15 | exit 1
16 | fi
17 |
18 | EXISTING_VAGRANT_VERSION=$(vagrant version | head -n1 | awk '{print $3}')
19 |
20 | if [ "${EXISTING_VAGRANT_VERSION}" != "${VERSION}" ]; then
21 | echo "-) You are trying to update this script for vagrant ${VERSION} while you have"
22 | echo " vagrant ${EXISTING_VAGRANT_VERSION} installed at $(which vagrant)."
23 | echo " Please update your local vagrant before using this script."
24 | exit 1
25 | fi
26 |
27 | echo "+) Acquiring vagrant-${VERSION}"
28 | wget https://github.com/mitchellh/vagrant/archive/v${VERSION}.tar.gz
29 |
30 | echo "+) Extracting vagrant-${VERSION}.tar.gz"
31 | tar zxf v${VERSION}.tar.gz
32 |
33 | echo "+) Running update_commands.rb"
34 | ./update_commands.rb
35 |
36 | echo "+) Updating the badge in the README.md"
37 | sed -i "/img.shields.io/c\[\](https://github.com/hashicorp/vagrant/blob/v${VERSION}/CHANGELOG.md)" README.md
38 |
39 | echo "+) Cleaning up after ourselves"
40 | rm -f v${VERSION}.tar.gz
41 | rm -rf vagrant-${VERSION}
42 |
43 | git status
44 |
--------------------------------------------------------------------------------
/update_commands.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # Use this script to update the commands auto-completed in plugin/vagrant.vim.
4 |
5 | require 'open3'
6 |
7 | command_re = /^(\S+)\s\s/
8 | plugin_file = 'plugin/vagrant.vim'
9 |
10 | # Create the list of commands.
11 | stdout, stderr, _status = Open3.capture3('vagrant list-commands')
12 | output = stdout.split("\n")
13 | commands = output.collect do |l|
14 | match = command_re.match(l)
15 | " \\ \"#{match[1]}\"" if match
16 | end.reject(&:nil?).join(",\n")
17 |
18 | # Read in the existing plugin file.
19 | plugin = File.open(plugin_file, 'r').readlines
20 |
21 | # Replace the terraResourceTypeBI lines with our new list.
22 | first = plugin.index { |l| /^ return join\(\[/.match(l) } + 1
23 | last = plugin.index { |l| /^ \\ \], "\\n"\)/.match(l) }
24 | plugin.slice!(first, last - first)
25 | commands.split("\n").reverse_each do |r|
26 | plugin.insert(first, r)
27 | end
28 |
29 | # Write the plugin file back out.
30 | File.open(plugin_file, 'w') do |f|
31 | f.puts plugin
32 | end
33 |
--------------------------------------------------------------------------------