├── metadata.json ├── package.sh ├── sh ├── vim.sh ├── redis.sh ├── core.sh ├── .vimrc ├── heroku.sh ├── travis.sh ├── nodejs.sh ├── mongodb.sh ├── github.sh ├── repair-mac.sh ├── provision.sh └── .vim │ └── colors │ └── mango.vim ├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile └── box └── Vagrantfile /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider": "virtualbox" 3 | } 4 | -------------------------------------------------------------------------------- /package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | vagrant package --vagrantfile ./box/Vagrantfile --output nodejs.box 3 | -------------------------------------------------------------------------------- /sh/vim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp -r /vagrant/sh/.vim /home/vagrant/ 4 | cp /vagrant/sh/.vimrc /home/vagrant/ 5 | -------------------------------------------------------------------------------- /sh/redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | add-apt-repository -y ppa:chris-lea/redis-server 4 | apt-get update 5 | apt-get install -y redis-server 6 | -------------------------------------------------------------------------------- /sh/core.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt-get update 4 | # Install build tools 5 | apt-get install -y make g++ git curl vim libcairo2-dev libav-tools nfs-common portmap -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | node_modules 16 | 17 | .vagrant 18 | *.box 19 | -------------------------------------------------------------------------------- /sh/.vimrc: -------------------------------------------------------------------------------- 1 | " syntax highlighting 2 | set background=dark " you can use `dark` or `light` as your background 3 | syntax on 4 | color mango 5 | 6 | " soft tabs 7 | set tabstop=2 8 | set softtabstop=2 9 | set shiftwidth=2 10 | set expandtab 11 | -------------------------------------------------------------------------------- /sh/heroku.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Heroku toolbelt: 4 | 5 | wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh 6 | 7 | echo "Run the following commands to finish setting up Heroku:" 8 | echo "heroku login" 9 | echo "heroku keys:add" 10 | echo "heroku git:remote -a heroku" 11 | -------------------------------------------------------------------------------- /sh/travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Travis-CI toolbelt: install ruby1.9.1-dev package & Travis gem 4 | apt-get remove -y ruby1.9.1 5 | apt-get install -y ruby1.9.1-dev 6 | gem install travis --no-rdoc --no-ri 7 | 8 | echo "Run the following commands to login:" 9 | echo "travis login" 10 | -------------------------------------------------------------------------------- /sh/nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Modified from https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager 4 | apt-get update 5 | apt-get install -y python-software-properties python g++ make 6 | add-apt-repository -y ppa:chris-lea/node.js 7 | apt-get update 8 | apt-get install -y nodejs 9 | -------------------------------------------------------------------------------- /sh/mongodb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Update apt-get to get 10gen stable packages 4 | apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 5 | echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list 6 | apt-get update 7 | # Install specific stable version 8 | apt-get install -y mongodb-10gen=2.4.4 9 | # Pin to the exact version above, so it's not auto upgraded by apt-get 10 | echo "mongodb-10gen hold" | dpkg --set-selections 11 | -------------------------------------------------------------------------------- /sh/github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Git config 4 | su vagrant -c 'git config --global color.ui true' 5 | 6 | # Default editor: Vim! 7 | su vagrant -c 'git config --global core.editor "vim"' 8 | 9 | echo "Run 'vagrant ssh' then set your git config manually, e.g.:" 10 | echo "ssh-keygen -t rsa" 11 | echo "(Copy the contents of ~/.ssh/id_rsa.pub into your GitHub account: https://github.com/settings/ssh)" 12 | echo "git config --global user.name ''" 13 | echo "git config --global user.email " 14 | -------------------------------------------------------------------------------- /sh/repair-mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script fixes the problem that occurs (usually after a forced reboot) where 4 | # the following error shows up on 'vagrant up': 5 | 6 | #There was an error while executing `VBoxManage`, a CLI used by Vagrant 7 | #for controlling VirtualBox. The command and stderr is shown below. 8 | # 9 | #Command: ["hostonlyif", "create"] 10 | # 11 | #Stderr: 0%... 12 | #Progress state: NS_ERROR_FAILURE 13 | #VBoxManage: error: Failed to create the host-only adapter 14 | #VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory 15 | #VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface 16 | #VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp 17 | 18 | sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Chris Bumgardner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /sh/provision.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -e "/etc/vagrant-provisioned" ]; 4 | then 5 | echo "Vagrant provisioning already completed. Skipping..." 6 | exit 0 7 | else 8 | echo "Starting Vagrant provisioning process..." 9 | fi 10 | 11 | # Change the hostname so we can easily identify what environment we're on: 12 | echo "nodejs-vagrant" > /etc/hostname 13 | # Update /etc/hosts to match new hostname to avoid "Unable to resolve hostname" issue: 14 | echo "127.0.0.1 nodejs-vagrant" >> /etc/hosts 15 | # Use hostname command so that the new hostname takes effect immediately without a restart: 16 | hostname nodejs-vagrant 17 | 18 | # Install core components 19 | /vagrant/sh/core.sh 20 | 21 | # Install Node.js 22 | /vagrant/sh/nodejs.sh 23 | 24 | # Install MongoDB 25 | /vagrant/sh/mongodb.sh 26 | 27 | # Install Redis 28 | /vagrant/sh/redis.sh 29 | 30 | # GitHub repositories: 31 | /vagrant/sh/github.sh 32 | 33 | # Travis-CI toolbelt: 34 | /vagrant/sh/travis.sh 35 | 36 | # Heroku toolbelt (NOTE: after Travis-CI due to Ruby removal/reinstall): 37 | /vagrant/sh/heroku.sh 38 | 39 | # Vim settings: 40 | /vagrant/sh/vim.sh 41 | 42 | touch /etc/vagrant-provisioned 43 | 44 | echo "--------------------------------------------------" 45 | echo "Your vagrant instance is running at: 192.168.33.10" 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nodejs-vagrant 2 | 3 | Provisions a clean Ubuntu 12.04 32-bit server instance with all needed Node.js development tools (Node.js, git, vim); services (MongoDB, Redis, GitHub, Heroku, Travis-CI). 4 | 5 | ## Install Vagrant & VirtualBox 6 | 7 | ### Install Vagrant 1.5: 8 | [http://vagrantup.com](http://vagrantup.com) 9 | 10 | ### Install VirtualBox: 11 | [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads) 12 | 13 | ## Setup Option 1: Box 14 | 15 | ``` 16 | mkdir DIR && cd DIR 17 | vagrant init cbumgard/nodejs 18 | vagrant up 19 | vagrant ssh 20 | ``` 21 | 22 | Done! 23 | 24 | For more see: [https://vagrantcloud.com/cbumgard/nodejs](https://vagrantcloud.com/cbumgard/nodejs) 25 | 26 | ## Setup Option 2: Vagrantfile 27 | 28 | ``` 29 | git clone git@github.com:cbumgard/nodejs-vagrant.git 30 | cd nodejs-vagrant 31 | vagrant up 32 | vagrant ssh 33 | ``` 34 | 35 | Done! 36 | 37 | ## Post-Setup 38 | 39 | ### Vagrant user 40 | 41 | By default the ```vagrant``` user is configured with password 'vagrant'. The vagrant user is also configured for password-less sudo. 42 | 43 | ### Edit code on host machine, build in VM 44 | 45 | Your ```~/``` home directory on your host machine is synced to the ```/host/``` directory inside of Vagrant. So for example you can edit code in ```~/code/``` on your laptop and build it inside a Vagrant shell inside ```/host/code```. 46 | 47 | ### Networking: 48 | 49 | Configured for private network on static IP: ```192.168.33.10```, with port ```:3000``` forwarded. 50 | 51 | So from a web browser you have two ways of accessing a node.js process for example running on port 3000 on the VM: 52 | 53 | * ```localhost:3000``` 54 | * ```192.168.33.10:3000``` 55 | 56 | Additionally for convenience, append this line to your ```/etc/hosts``` file: 57 | 58 | ```192.168.33.10 vagrant.localhost``` 59 | 60 | ## Services 61 | 62 | ### MongoDB & Redis 63 | 64 | Verify from CLI by running ```mongo``` and ```redis-cli```. 65 | 66 | ### GitHub 67 | 68 | ``` 69 | ssh-keygen -t rsa 70 | (Copy the contents of ~/.ssh/id_rsa.pub into your GitHub account: https://github.com/settings/ssh) 71 | git config --global user.name '' 72 | git config --global user.email 73 | ``` 74 | 75 | ### Heroku 76 | 77 | ``` 78 | Run the following commands to finish setting up Heroku: 79 | heroku login 80 | heroku keys:add 81 | ``` 82 | 83 | ### Travis-CI 84 | 85 | ```travis login``` 86 | or 87 | ```travis login --pro``` 88 | 89 | ## Troubleshooting 90 | 91 | Included is a script ```./sh/repair-mac.sh``` that fixes the problem that occurs (usually after a forced reboot) where the following error shows up on 'vagrant up': 92 | 93 | ```bash 94 | There was an error while executing `VBoxManage`, a CLI used by Vagrant 95 | for controlling VirtualBox. The command and stderr is shown below. 96 | 97 | Command: ["hostonlyif", "create"] 98 | 99 | Stderr: 0%... 100 | Progress state: NS_ERROR_FAILURE 101 | VBoxManage: error: Failed to create the host-only adapter 102 | VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory 103 | VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface 104 | VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp 105 | ``` 106 | 107 | ## License 108 | 109 | [MIT](https://github.com/cbumgard/nodejs-vagrant/blob/master/LICENSE) 110 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | # All Vagrant configuration is done here. The most common configuration 6 | # options are documented and commented below. For a complete reference, 7 | # please see the online documentation at vagrantup.com. 8 | 9 | # Every Vagrant virtual environment requires a box to build off of. 10 | config.vm.box = "precise32" 11 | 12 | # The url from where the 'config.vm.box' box will be fetched if it 13 | # doesn't already exist on the user's system. 14 | config.vm.box_url = "http://files.vagrantup.com/precise32.box" 15 | 16 | # Create a forwarded port mapping which allows access to a specific port 17 | # within the machine from a port on the host machine. In the example below, 18 | # accessing "localhost:8080" will access port 80 on the guest machine. 19 | config.vm.network :forwarded_port, guest: 3000, host: 3000 20 | 21 | # Create a private network, which allows host-only access to the machine 22 | # using a specific IP. 23 | config.vm.network :private_network, ip: "192.168.33.10" 24 | 25 | # Create a public network, which generally matched to bridged network. 26 | # Bridged networks make the machine appear as another physical device on 27 | # your network. 28 | # config.vm.network :public_network 29 | 30 | # Share an additional folder to the guest VM. The first argument is 31 | # the path on the host to the actual folder. The second argument is 32 | # the path on the guest to mount the folder. And the optional third 33 | # argument is a set of non-required options. 34 | 35 | # Give the guest OS access to the user's home dir for .ssh keys and so on. 36 | # Enable nfs for faster performance. Ingored on Windows host. 37 | config.vm.synced_folder "~/", "/host", nfs: true 38 | 39 | # Provider-specific configuration so you can fine-tune various 40 | # backing providers for Vagrant. These expose provider-specific options. 41 | # Example for VirtualBox: 42 | # 43 | # config.vm.provider :virtualbox do |vb| 44 | # # Don't boot with headless mode 45 | # vb.gui = true 46 | # 47 | # # Use VBoxManage to customize the VM. For example to change memory: 48 | # vb.customize ["modifyvm", :id, "--memory", "1024"] 49 | # end 50 | # 51 | # View the documentation for the provider you're using for more 52 | # information on available options. 53 | 54 | # Enable provisioning with Puppet stand alone. Puppet manifests 55 | # are contained in a directory path relative to this Vagrantfile. 56 | # You will need to create the manifests directory and a manifest in 57 | # the file precise32.pp in the manifests_path directory. 58 | # 59 | # An example Puppet manifest to provision the message of the day: 60 | # 61 | # # group { "puppet": 62 | # # ensure => "present", 63 | # # } 64 | # # 65 | # # File { owner => 0, group => 0, mode => 0644 } 66 | # # 67 | # # file { '/etc/motd': 68 | # # content => "Welcome to your Vagrant-built virtual machine! 69 | # # Managed by Puppet.\n" 70 | # # } 71 | # 72 | # config.vm.provision :puppet do |puppet| 73 | # puppet.manifests_path = "manifests" 74 | # puppet.manifest_file = "init.pp" 75 | # end 76 | 77 | # Enable provisioning with chef solo, specifying a cookbooks path, roles 78 | # path, and data_bags path (all relative to this Vagrantfile), and adding 79 | # some recipes and/or roles. 80 | # 81 | # config.vm.provision :chef_solo do |chef| 82 | # chef.cookbooks_path = "../my-recipes/cookbooks" 83 | # chef.roles_path = "../my-recipes/roles" 84 | # chef.data_bags_path = "../my-recipes/data_bags" 85 | # chef.add_recipe "mysql" 86 | # chef.add_role "web" 87 | # 88 | # # You may also specify custom JSON attributes: 89 | # chef.json = { :mysql_password => "foo" } 90 | # end 91 | 92 | # Enable provisioning with chef server, specifying the chef server URL, 93 | # and the path to the validation key (relative to this Vagrantfile). 94 | # 95 | # The Opscode Platform uses HTTPS. Substitute your organization for 96 | # ORGNAME in the URL and validation key. 97 | # 98 | # If you have your own Chef Server, use the appropriate URL, which may be 99 | # HTTP instead of HTTPS depending on your configuration. Also change the 100 | # validation key to validation.pem. 101 | # 102 | # config.vm.provision :chef_client do |chef| 103 | # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" 104 | # chef.validation_key_path = "ORGNAME-validator.pem" 105 | # end 106 | # 107 | # If you're using the Opscode platform, your validator client is 108 | # ORGNAME-validator, replacing ORGNAME with your organization name. 109 | # 110 | # If you have your own Chef Server, the default validation client name is 111 | # chef-validator, unless you changed the configuration. 112 | # 113 | # chef.validation_client_name = "ORGNAME-validator" 114 | 115 | # For now we'll use basic shell provisioning script: 116 | config.vm.provision :shell, :path => "sh/provision.sh" 117 | end 118 | -------------------------------------------------------------------------------- /box/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | # All Vagrant configuration is done here. The most common configuration 6 | # options are documented and commented below. For a complete reference, 7 | # please see the online documentation at vagrantup.com. 8 | 9 | # Every Vagrant virtual environment requires a box to build off of. 10 | config.vm.box = "cbumgard/nodejs" 11 | 12 | # The url from where the 'config.vm.box' box will be fetched if it 13 | # doesn't already exist on the user's system. 14 | config.vm.box_url = "https://vagrantcloud.com/cbumgard/nodejs/version/1/provider/virtualbox.box" 15 | 16 | # Create a forwarded port mapping which allows access to a specific port 17 | # within the machine from a port on the host machine. In the example below, 18 | # accessing "localhost:8080" will access port 80 on the guest machine. 19 | config.vm.network :forwarded_port, guest: 3000, host: 3000 20 | 21 | # Create a private network, which allows host-only access to the machine 22 | # using a specific IP. 23 | config.vm.network :private_network, ip: "192.168.33.10" 24 | 25 | # Create a public network, which generally matched to bridged network. 26 | # Bridged networks make the machine appear as another physical device on 27 | # your network. 28 | # config.vm.network :public_network 29 | 30 | # Share an additional folder to the guest VM. The first argument is 31 | # the path on the host to the actual folder. The second argument is 32 | # the path on the guest to mount the folder. And the optional third 33 | # argument is a set of non-required options. 34 | 35 | # Give the guest OS access to the user's home dir for .ssh keys and so on. 36 | # Enable nfs for faster performance. Ingored on Windows host. 37 | config.vm.synced_folder "~/", "/host", nfs: true 38 | 39 | # Provider-specific configuration so you can fine-tune various 40 | # backing providers for Vagrant. These expose provider-specific options. 41 | # Example for VirtualBox: 42 | # 43 | # config.vm.provider :virtualbox do |vb| 44 | # # Don't boot with headless mode 45 | # vb.gui = true 46 | # 47 | # # Use VBoxManage to customize the VM. For example to change memory: 48 | # vb.customize ["modifyvm", :id, "--memory", "1024"] 49 | # end 50 | # 51 | # View the documentation for the provider you're using for more 52 | # information on available options. 53 | 54 | # Enable provisioning with Puppet stand alone. Puppet manifests 55 | # are contained in a directory path relative to this Vagrantfile. 56 | # You will need to create the manifests directory and a manifest in 57 | # the file precise32.pp in the manifests_path directory. 58 | # 59 | # An example Puppet manifest to provision the message of the day: 60 | # 61 | # # group { "puppet": 62 | # # ensure => "present", 63 | # # } 64 | # # 65 | # # File { owner => 0, group => 0, mode => 0644 } 66 | # # 67 | # # file { '/etc/motd': 68 | # # content => "Welcome to your Vagrant-built virtual machine! 69 | # # Managed by Puppet.\n" 70 | # # } 71 | # 72 | # config.vm.provision :puppet do |puppet| 73 | # puppet.manifests_path = "manifests" 74 | # puppet.manifest_file = "init.pp" 75 | # end 76 | 77 | # Enable provisioning with chef solo, specifying a cookbooks path, roles 78 | # path, and data_bags path (all relative to this Vagrantfile), and adding 79 | # some recipes and/or roles. 80 | # 81 | # config.vm.provision :chef_solo do |chef| 82 | # chef.cookbooks_path = "../my-recipes/cookbooks" 83 | # chef.roles_path = "../my-recipes/roles" 84 | # chef.data_bags_path = "../my-recipes/data_bags" 85 | # chef.add_recipe "mysql" 86 | # chef.add_role "web" 87 | # 88 | # # You may also specify custom JSON attributes: 89 | # chef.json = { :mysql_password => "foo" } 90 | # end 91 | 92 | # Enable provisioning with chef server, specifying the chef server URL, 93 | # and the path to the validation key (relative to this Vagrantfile). 94 | # 95 | # The Opscode Platform uses HTTPS. Substitute your organization for 96 | # ORGNAME in the URL and validation key. 97 | # 98 | # If you have your own Chef Server, use the appropriate URL, which may be 99 | # HTTP instead of HTTPS depending on your configuration. Also change the 100 | # validation key to validation.pem. 101 | # 102 | # config.vm.provision :chef_client do |chef| 103 | # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" 104 | # chef.validation_key_path = "ORGNAME-validator.pem" 105 | # end 106 | # 107 | # If you're using the Opscode platform, your validator client is 108 | # ORGNAME-validator, replacing ORGNAME with your organization name. 109 | # 110 | # If you have your own Chef Server, the default validation client name is 111 | # chef-validator, unless you changed the configuration. 112 | # 113 | # chef.validation_client_name = "ORGNAME-validator" 114 | 115 | # For now we'll use basic shell provisioning script: 116 | #config.vm.provision :shell, :path => "sh/provision.sh" 117 | end 118 | -------------------------------------------------------------------------------- /sh/.vim/colors/mango.vim: -------------------------------------------------------------------------------- 1 | " Vim color file -- Mango 2 | " Maintainer: Josh Perez 3 | " Version: 1.4.7 4 | 5 | " mango.vim {{{ 6 | set t_Co=256 7 | let g:colors_name = "mango" 8 | let bgcolor = &background 9 | highlight clear SignColumn 10 | " }}} 11 | 12 | " Colors: {{{ 13 | if bgcolor == "light" 14 | let Black = "guifg=#444444 guibg=NONE gui=NONE ctermfg=238 ctermbg=NONE cterm=NONE" 15 | let Orange = "guifg=#ff5f00 guibg=NONE gui=NONE ctermfg=202 ctermbg=NONE cterm=NONE" 16 | let Peach = "guifg=#ff875f guibg=NONE gui=NONE ctermfg=209 ctermbg=NONE cterm=NONE" 17 | let Purple = "guifg=#af87ff guibg=NONE gui=NONE ctermfg=141 ctermbg=NONE cterm=NONE" 18 | let Red = "guifg=#ff0000 guibg=NONE gui=NONE ctermfg=196 ctermbg=NONE cterm=NONE" 19 | endif 20 | if bgcolor == "dark" 21 | let Black = "guifg=#585858 guibg=NONE gui=NONE ctermfg=240 ctermbg=NONE cterm=NONE" 22 | let Orange = "guifg=#ffaf00 guibg=NONE gui=NONE ctermfg=214 ctermbg=NONE cterm=NONE" 23 | let Peach = "guifg=#ffd787 guibg=NONE gui=NONE ctermfg=222 ctermbg=NONE cterm=NONE" 24 | let Purple = "guifg=#afd7ff guibg=NONE gui=NONE ctermfg=153 ctermbg=NONE cterm=NONE" 25 | let Red = "guifg=#ff5f5f guibg=NONE gui=NONE ctermfg=203 ctermbg=NONE cterm=NONE" 26 | endif 27 | 28 | let Green = "guifg=#87af5f guibg=NONE gui=NONE ctermfg=107 ctermbg=NONE cterm=NONE" 29 | let Gray = "guifg=#bcbcbc guibg=NONE gui=NONE ctermfg=250 ctermbg=NONE cterm=NONE" 30 | let Blue = "guifg=#5f87d7 guibg=NONE gui=NONE ctermfg=68 ctermbg=NONE cterm=NONE" 31 | let Pink = "guifg=#ff5faf guibg=NONE gui=NONE ctermfg=205 ctermbg=NONE cterm=NONE" 32 | let Pink2 = "guifg=#ff87af guibg=NONE gui=NONE ctermfg=211 ctermbg=NONE cterm=NONE" 33 | let Purple2 = "guifg=#d700d7 guibg=NONE gui=NONE ctermfg=164 ctermbg=NONE cterm=NONE" 34 | let Silver = "guifg=#8a8a8a guibg=NONE gui=NONE ctermfg=245 ctermbg=NONE cterm=NONE" 35 | let White = "guifg=#eeeeee guibg=#282828 gui=NONE ctermfg=255 ctermbg=NONE cterm=NONE" 36 | " }}} 37 | 38 | " Light Background: {{{ 39 | if bgcolor == "light" 40 | exe "hi Boolean " .Red 41 | exe "hi Constant " .Blue 42 | exe "hi Character " .Blue 43 | exe "hi Comment " .Gray 44 | exe "hi Conditional " .Peach 45 | exe "hi Debug " .Blue 46 | exe "hi Define " .Peach 47 | exe "hi Delimiter " .Silver 48 | exe "hi Exception " .Red 49 | exe "hi Float " .Red 50 | exe "hi Function " .Pink 51 | exe "hi Identifier " .Blue 52 | exe "hi Ignore " .Blue 53 | exe "hi Include " .Purple 54 | exe "hi Keyword " .Peach 55 | exe "hi Label " .Blue 56 | exe "hi LineNr " .Gray 57 | exe "hi Macro " .Purple 58 | exe "hi Normal " .Black 59 | exe "hi Number " .Red 60 | exe "hi Operator " .Orange 61 | exe "hi PreCondit " .Purple 62 | exe "hi PreProc " .Peach 63 | exe "hi Repeat " .Peach 64 | exe "hi Special " .Pink 65 | exe "hi SpecialChar " .Pink 66 | exe "hi SpecialComment " .Blue 67 | exe "hi Statement " .Orange 68 | exe "hi StorageClass " .Purple 69 | exe "hi String " .Green 70 | exe "hi Structure " .Peach 71 | exe "hi Tag " .Blue 72 | exe "hi Type " .Orange 73 | exe "hi TypeDef " .Purple2 74 | 75 | hi CursorLine guifg=NONE guibg=#ffffff gui=NONE ctermfg=NONE ctermbg=231 cterm=NONE 76 | hi ColorColumn guifg=#ff0000 guibg=#ffffff gui=NONE ctermfg=203 ctermbg=231 cterm=NONE 77 | hi Todo guifg=#080808 guibg=#ffaf87 gui=NONE ctermfg=232 ctermbg=216 cterm=NONE 78 | hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline 79 | hi Error guifg=#ff5f00 guibg=#ff0000 gui=NONE ctermfg=202 ctermbg=196 cterm=NONE 80 | endif 81 | " }}} 82 | " Dark Background: {{{ 83 | if bgcolor == "dark" 84 | exe "hi Boolean " .Red 85 | exe "hi Constant " .Blue 86 | exe "hi Character " .Blue 87 | exe "hi Comment " .Black 88 | exe "hi Conditional " .Peach 89 | exe "hi Debug " .Blue 90 | exe "hi Define " .Peach 91 | exe "hi Delimiter " .White 92 | exe "hi Exception " .Red 93 | exe "hi Float " .Red 94 | exe "hi Function " .Pink 95 | exe "hi Identifier " .Blue 96 | exe "hi Ignore " .Blue 97 | exe "hi Include " .Purple 98 | exe "hi Keyword " .Peach 99 | exe "hi Label " .Blue 100 | exe "hi LineNr " .Black 101 | exe "hi Macro " .Purple 102 | exe "hi Normal " .White 103 | exe "hi Number " .Red 104 | exe "hi Operator " .Orange 105 | exe "hi PreCondit " .Purple 106 | exe "hi PreProc " .Peach 107 | exe "hi Repeat " .Peach 108 | exe "hi Special " .Pink 109 | exe "hi SpecialChar " .Pink 110 | exe "hi SpecialComment " .Blue 111 | exe "hi Statement " .Orange 112 | exe "hi StorageClass " .White 113 | exe "hi String " .Green 114 | exe "hi Structure " .Peach 115 | exe "hi Tag " .Blue 116 | exe "hi Type " .Orange 117 | exe "hi TypeDef " .Purple2 118 | 119 | hi CursorLine guifg=NONE guibg=#1c1c1c gui=NONE ctermfg=NONE ctermbg=234 cterm=NONE 120 | hi ColorColumn guifg=#ff0000 guibg=#1c1c1c gui=NONE ctermfg=203 ctermbg=234 cterm=NONE 121 | hi Todo guifg=#080808 guibg=#ffd700 gui=NONE ctermfg=232 ctermbg=220 cterm=NONE 122 | hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline 123 | hi Error guifg=#ff5f00 guibg=#ff0000 gui=NONE ctermfg=202 ctermbg=196 cterm=NONE 124 | endif 125 | " }}} 126 | 127 | " MIT LICENSE {{{ 128 | " The MIT License (MIT) 129 | " Copyright 2012 Josh Perez, http://www.goatslacker.com 130 | " 131 | " Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 132 | " 133 | " The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 134 | " 135 | " THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 136 | " }}} 137 | 138 | " vim:foldmethod=marker:foldlevel=0 139 | --------------------------------------------------------------------------------