mirror of
https://github.com/klmp200/vim-sync.git
synced 2024-11-21 13:43:21 +00:00
Can now install powerline fonts. Added comments and help menu
This commit is contained in:
parent
3c27e9235c
commit
5589d1dd2b
29
install.pl
29
install.pl
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user