Skip to content

Instantly share code, notes, and snippets.

@Luavis
Last active March 16, 2016 06:26
Show Gist options
  • Save Luavis/e94554689c2aace983b2 to your computer and use it in GitHub Desktop.
Save Luavis/e94554689c2aace983b2 to your computer and use it in GitHub Desktop.
setup vim git ctags in ubuntu env
#!/usr/bin/env python
import platform
from os import system, getuid
__author__ = 'Luavis'
__license__ = "MIT"
__version__ = "1.0.0"
__email__ = "luaviskang@gmail.com"
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
FAIL = '\033[91m'
ENDC = '\033[0m'
vimrc_url = 'https://gist.githubusercontent.com/Luavis' + \
'/304f982fe0c85d3932db/raw' + \
'/c30a7c82918a5dd8854684faf985a40743f51c30/.vimrc'
vundle_url = 'https://github.com/VundleVim/Vundle.vim.git' + \
' ~/.vim/bundle/Vundle.vim'
def msg(content, color=None):
if color is None:
print(content)
else:
print(color + content + ENDC)
def run_command(command, print_msg=''):
msg(print_msg)
system(command + ' > /dev/null')
def main():
run_command(
'apt-get install -qq -y git ctags vim curl',
'Install git, ctags, vim, curl')
run_command('rm -rf ~/.vim ~/.vimrc', 'remove original .vim and .vimrc')
run_command('git clone ' + vundle_url, 'Install Vundle')
run_command('curl -s -o ~/.vimrc ' + vimrc_url, 'Install .vimrc')
# run Vundle install
system('vim +VundleInstall +qall')
msg("Done! Happy Hacking!!", OKGREEN)
if __name__ == '__main__':
if not platform.dist()[0] == 'Ubuntu':
msg("ERROR: This script only support ubuntu sorry :(", FAIL)
if not getuid() == 0:
msg("ERROR: Please run this script in root permission :(", FAIL)
else:
msg("Install Start!!", OKBLUE)
main()
@Luavis
Copy link
Author

Luavis commented Mar 12, 2016

Requirements

  • Any version of ubuntu
  • python 2.x over

Installation

  • wget
sudo python -c "$(wget https://goo.gl/IRN5Zj -O -)"
  • curl
sudo python -c "$(curl -fsSL https://goo.gl/IRN5Zj)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment