Can now install powerline fonts. Added comments and help menu

This commit is contained in:
Antoine Bartuccio 2016-08-10 00:13:54 +02:00
parent 3c27e9235c
commit 5589d1dd2b
1 changed files with 28 additions and 1 deletions

View File

@ -2,8 +2,17 @@
use 5.014;
use autodie;
use File::Path;
use Cwd 'realpath';
if (shift @ARGV eq '-h'){
say "install.pl [args]";
say "-h to display help";
say "--fonts install powerline fonts";
die;
}
# Backup
my $old_file = $ENV{'HOME'}.'/.vimrc';
if (-e $old_file) {
@ -13,6 +22,7 @@ if (-e $old_file) {
say "No file to backup";
}
# Writing files
say "Writing your new config";
open my $vimrc, '>', $old_file;
@ -26,8 +36,25 @@ select STDOUT;
close $vimrc;
# Install stuff from git
say "Installing Vundle";
`git clone https://github.com/VundleVim/Vundle.vim $ENV{'HOME'}/.vim/bundle/Vundle.vim`;
my $tmp_dir = '.tmp_vim_config';
rmtree $tmp_dir if -e $tmp_dir;
mkdir $tmp_dir;
chdir $tmp_dir;
for(@ARGV){
if ($_ eq "--fonts"){
`git clone https://github.com/powerline/fonts.git`;
`fonts/install.sh`;
}
}
chdir '..';
rmtree $tmp_dir;
# Finish install
say "Installing your plugins";
system('vim -c PluginInstall');
say "Installation complete";
say "Now just launch vim and use :PluginInstall to complete your install";