diff --git a/.gitignore b/.gitignore index d3ddc045..1b2ca5e4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .vim/.netrwhist .vim/bundle/* !.vim/bundle/Vundle.vim +setup*.exe +*mirror*cygwin*/ diff --git a/.vimrc.common.epilogue b/.vimrc.common.epilogue index ee21d921..178bdf81 100644 --- a/.vimrc.common.epilogue +++ b/.vimrc.common.epilogue @@ -9,7 +9,11 @@ set t_Co=256 syntax enable set background=dark highlight clear SignColumn -colorscheme solarized +try + colorscheme solarized +catch /^Vim\%((\a\+)\)\=:E185/ + colorscheme desert +endtry " plugins: airline let g:bufferline_echo = 0 diff --git a/appveyor.yml b/appveyor.yml index 58c4c013..8e792dbd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,2 +1,2 @@ -install: powershell -NoProfile -ExecutionPolicy Bypass -Command "windows_cygwin\bootstrap.ps1" -build_script: windows_cygwin\build.bat +install: powershell -NoProfile -ExecutionPolicy Bypass -Command "windows\bootstrap.ps1" +build_script: windows\build.bat diff --git a/common/configure_fresh_system b/common/configure_fresh_system index 5221339b..c5bb9f70 100755 --- a/common/configure_fresh_system +++ b/common/configure_fresh_system @@ -18,7 +18,7 @@ if [[ -z $DONT_CHANGE_SHELL ]]; then chsh -s `which zsh` $USER fi -CURL="curl -sSf" +CURL="curl -sSfL" jobs_count=`nproc` if [[ -z $DIR ]]; then @@ -105,9 +105,33 @@ set +e set -e fi +set +e +echo "Querying for gpg2 path" +gpg2_path=`which gpg2` +echo "Got $gpg2_path for gpg2 path" +set -e +if [[ -x "$gpg2_path" ]]; then + echo "Using gpg2" + GPG=gpg2 +else + echo "WARNING using gpg instead of gpg2" + GPG=gpg +fi + if [[ -z $NORUBY ]]; then - gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 - curl -sSL https://get.rvm.io | bash -s stable --ruby + set +e + $GPG --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 + set -e + $GPG --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 + echo "Downloading RVM..." + $CURL https://get.rvm.io | bash + set +e + echo "Sourcing RVM..." + source /usr/local/rvm/scripts/rvm + source ~/.rvm/scripts/rvm + set -e + echo "Installing Ruby..." + rvm install 2.3.1 --disable-binary fi if [[ -z $NOVIM ]]; then @@ -118,9 +142,13 @@ if [[ -z $NOVIM ]]; then git pull git submodule update --init --recursive fi + echo "Installing fzf" ~/.fzf/install --64 --all + echo "Installing Vim plugins" echo "\n" | vim +PluginInstall +qa + if [[ -z $NOYCM ]]; then + echo "configuring YouCompleteMe" cd ~/.vim/bundle/YouCompleteMe if [[ -z $NOPYTHON3 ]]; then @@ -139,18 +167,28 @@ if [[ -z $NO_GO ]]; then go get -u github.com/exercism/cli/exercism fi +echo "Installing Reveal-md" # talks: reveal-md $SUDO npm install -g reveal-md +echo "Installing fancy differ" $SUDO npm install -g diff-so-fancy if [[ -z $NOPYTHON3 ]]; then - PIP=pip3 -else - PIP=pip + set +e + pip3_path=`which pip3` + set -e + echo "pip3 path is $pip3_path" + if [[ -x "$pip3_path" ]]; then + echo "Choosing pip3 for pip" + PIP=pip3 + else + echo "Choosing pip" + PIP=pip + fi + echo "Installing Nikola" + $SUDO $PIP install pygments-style-solarized ws4py watchdog webassets Nikola fi -$SUDO $PIP install pygments-style-solarized ws4py watchdog webassets Nikola - if [[ -z $USER ]]; then USER=`whoami` fi diff --git a/conemu.xml b/conemu.xml new file mode 100644 index 00000000..580acd19 --- /dev/null +++ b/conemu.xml @@ -0,0 +1,700 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows_cygwin/.minttyrc b/windows/.minttyrc similarity index 100% rename from windows_cygwin/.minttyrc rename to windows/.minttyrc diff --git a/windows_cygwin/README.md b/windows/README.md similarity index 81% rename from windows_cygwin/README.md rename to windows/README.md index cc3c8bb3..0e0e215b 100644 --- a/windows_cygwin/README.md +++ b/windows/README.md @@ -1,6 +1,6 @@ Bootstrap from cmd.exe running as Administrator: - @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cyplo/dotfiles/master/windows_cygwin/bootstrap.ps1'))" + @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cyplo/dotfiles/master/windows/bootstrap.ps1'))" launch a normal user's cmd.exe and: @@ -15,5 +15,5 @@ launch a normal user's cmd.exe and: launch new cmd.exe as Administrator and: cd %HOMEPATH%\dev\dotfiles - windows_cygwin\build.bat + windows\build.bat diff --git a/windows_cygwin/bootstrap.ps1 b/windows/bootstrap.ps1 similarity index 100% rename from windows_cygwin/bootstrap.ps1 rename to windows/bootstrap.ps1 diff --git a/windows_cygwin/build.bat b/windows/build.bat old mode 100755 new mode 100644 similarity index 66% rename from windows_cygwin/build.bat rename to windows/build.bat index 500e58d8..9860213a --- a/windows_cygwin/build.bat +++ b/windows/build.bat @@ -1,9 +1,11 @@ @echo on -choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode microsoft-build-tools visualstudio2015community p4merge dotnet4.5 ruby nodejs.install stylecop +choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang call refreshenv wget -c https://cygwin.com/setup-x86_64.exe -setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher +setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel + +copy /Y conemu.xml %appdata%\Roaming\ConEmu.xml set script_path=%~dp0 set repo_path=%script_path%\..\ diff --git a/windows_cygwin/build_insider.sh b/windows/build_insider.sh old mode 100755 new mode 100644 similarity index 51% rename from windows_cygwin/build_insider.sh rename to windows/build_insider.sh index 976f703e..2d6bc0f1 --- a/windows_cygwin/build_insider.sh +++ b/windows/build_insider.sh @@ -1,18 +1,31 @@ #!/bin/bash +set -e + DOTFILES_PATH="$HOME/dev/dotfiles" mkdir -pv $HOME/dev/ -rm -fr $DOTFILES_PATH +ln -vfs "$OUTER_CLONE/.gitconfig.cygwin" $HOME/.gitconfig +if [[ ! -d $DOTFILES_PATH ]]; then + git clone "$OUTER_CLONE" "$DOTFILES_PATH" +fi -git clone "$OUTER_CLONE" "$DOTFILES_PATH" cd "$DOTFILES_PATH" -git remote set-url origin git@github.com:cyplo/dotfiles.git +git remote set-url origin https://github.com/cyplo/dotfiles.git +git fetch -p git checkout $branch +set +e +git pull +set -e +git remote set-url origin git@github.com:cyplo/dotfiles.git +# might fail on CI where there are no secret keys +set +e +git pull +set -e +unset branch export NOSUDO=true export DONT_CHANGE_SHELL=true export NORUST=true -export NORUBY=true export NO_GO=true export DIR=$DOTFILES_PATH export NOYCM=true @@ -20,11 +33,15 @@ export NOYCM=true curl https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py python /tmp/get-pip.py +# expose all the binaries fetched during the outer build +export PATH="$OUTER_CLONE:$PATH" + $DIR/common/configure_fresh_system ln -vfs $DIR/windows_cygwin/.minttyrc $HOME/ -ln -vfs $DIR/.gitconfig.cygwin $HOME/.gitconfig +ln -vfs "$DOTFILES_PATH/.gitconfig.cygwin" $HOME/.gitconfig ln -vfs $DIR/.vimrc.cygwin $HOME/.vimrc # reinstall plugins with the new vimrc +echo "Reinstalling Vim plugins with the correct plugin list" echo "\n" | vim +PluginInstall +qa