Skip to content

Commit

Permalink
Update dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
gillchristian committed Feb 7, 2019
1 parent 8d454fb commit 75d7d44
Show file tree
Hide file tree
Showing 12 changed files with 2,720 additions and 234 deletions.
8 changes: 4 additions & 4 deletions alacritty/alacritty.yml
Expand Up @@ -23,14 +23,14 @@ scrolling:

font:
normal:
# family: "Fura Code Nerd Font"
family: "Go Mono Nerd Font"
# family: "Go Mono Nerd Font"
family: "Fura Code Nerd Font"
style: Regular
bold:
family: "Go Mono Nerd Font"
family: "Fura Code Nerd Font"
style: Bold
italic:
family: "Go Mono Nerd Font"
family: "Fura Code Nerd Font"
style: Italic

size: 14.0
Expand Down
1 change: 1 addition & 0 deletions ghc/ghci
@@ -0,0 +1 @@
:set prompt "\ESC[1;34m%s\n\ESC[0;34mλ> \ESC[m"
1 change: 1 addition & 0 deletions haskell/ghci
@@ -0,0 +1 @@
:set prompt "\ESC[1;34m%s\n\ESC[0;34mλ> \ESC[m"
13 changes: 13 additions & 0 deletions haskell/global-stack.yml
@@ -0,0 +1,13 @@
# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project. Settings here do _not_ act as
# defaults for all projects. To change stack's default settings, edit
# '/home/gillchristian/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# http://docs.haskellstack.org/en/stable/yaml_configuration/
#
packages: []
resolver: lts-13.2
extra-deps:
- hindent-5.2.7@sha256:35a1883948d2a2d9b663630d0e5c33fcb303149ac0b1f42a59f5e8fbc88b31e5
- stylish-haskell-0.9.2.1@sha256:9d4257c983b7d717c833b8d0c53c4e7b749ae24d102c640fbe8b3a8e7cd357ec
133 changes: 9 additions & 124 deletions install.sh
Expand Up @@ -16,9 +16,9 @@ function install_PACKAGES {

echo "Installing packages ..."
# general
sudo apt install -y zip ubuntu-restricted-extras unzip rar git vim vim-gnome zsh git-core indicator-multiload
sudo apt install -y zip ubuntu-restricted-extras unzip rar vim vim-gnome zsh git-core indicator-multiload
sudo apt install -y bison curl make binutils gcc build-essential xclip silversearcher-ag asciinema
sudo apt install -y jq git-extras tmux
sudo apt install -y jq git-extras tmux libtinfo-dev

# docker
sudo apt install -y apt-transport-https ca-certificates software-properties-common
Expand All @@ -32,60 +32,6 @@ function install_PACKAGES {
echo ""
}

function install_HASKELL {
# Install Haskell's Stack
echo "Installing Haskell's Stack"
curl -sSL https://get.haskellstack.org/ | sh

echo ""
}

function install_RUST {
# Install Rust
echo "Installing Rust"
curl https://sh.rustup.rs -sSf | sh
echo ""

# https://github.com/BurntSushi/ripgrep
# https://github.com/sharkdp/fd
# https://github.com/sharkdp/bat
# https://github.com/dalance/amber
cargo install ripgrep fd-find bat amber
cargo install --git https://github.com/jwilm/alacritty
link "$DOTFILES_DIR/alacritty/alacritty.yml" "$XDG_CONFIG_HOME/alacritty.yml"
# is 60 enough ?
sudo update-alternatives --install $(which x-terminal-emulator) x-terminal-emulator $(which alacritty) 60

echo ""
}

function install_GOLANG {
# Install Golang
echo "Installing Go"
git clone https://github.com/udhos/update-golang ~/dev/update-golang
cd ~/dev/update-golang
sudo ./update-golang.sh
gitUsername=$(git config --global user.name)
if [ ! -z "$gitUsername" ] ;then
echo "Creating your Github's go directory"
mkdir -p $GOPATH/src/github.com/$gitUsername
fi

mkdir -p ~/dev/go
GOPATH="$HOME/dev/go"
export GO_BIN="$GOPATH/bin:/usr/local/go/bin"

goinstall "Find Unleashed" github.com/kbrgl/fu
goinstall gocode github.com/mdempsky/gocode

# only install td if fetching todos-data is succesful
# since it's a private repo, so only would work for me
git clone git@github.com:gillchristian/todos-data.git ~/.todos
if [ $? -eq 0 ]; then
goinstall Todos github.com/gillchristian/todos/cmd/td
fi
}

function install_VIM {
echo "Adding VIM config"
link "$DOTFILES_DIR/vim" ~/.vim
Expand All @@ -109,15 +55,8 @@ function install_GIT {
echo ""
}

function install_ANTIBODY {
echo "Installing Antibody and adding config"
curl -sL git.io/antibody | sh -s
echo ""

echo "Installing plugins with antibody"
antibody bundle < "$DOTFILES_DIR/zsh/antibodyrc" > ~/.antibody_plugins.sh
antibody update
echo ""
function install_TMUX {
link "$DOTFILES_DIR/tmux/tmux.conf" "$HOME/.tmux.conf"
}

function install_ZSH {
Expand All @@ -131,72 +70,18 @@ function install_ZSH {
echo ""
}

function install_DOCKER_COMPOSE {
# TODO: prompt version
echo "Installing docker-compose"
sudo touch /usr/local/bin/docker-compose
touch /tmp/docker-compose-binary
curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" > /tmp/docker-compose-binary
sudo mv /tmp/docker-compose-binary /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo ""
}

function install_DOCKER {
echo "Installing Docker"
sudo apt remove docker docker-engine docker.io
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "Verifying fingerprint"
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install docker-ce
echo "Verifying Docker installation"
sudo docker run hello-world
sudo groupadd docker
sudo usermod -aG docker $USER
sudo systemctl enable docker

install_DOCKER_COMPOSE

echo "After the installation restart the computer and run \`\$ docker run hello-world\`"
echo ""
}

function install_TMUX {
link "$DOTFILES_DIR/tmux/tmux.conf" "$HOME/.tmux.conf"
}


function install_CONFIG {
install_ZSH

install_ANTIBODY

install_GIT
function main {
install_PACKAGES

install_SSH

install_VIM

install_GOLANG

install_RUST

install_HASKELL

install_DOCKER
install_GIT

install_TMUX
}

function main {
install_PACKAGES

install_CONFIG
install_ZSH
}

install_RUST
main
121 changes: 119 additions & 2 deletions postinstall.sh
Expand Up @@ -6,6 +6,7 @@ source "$DOTFILES_DIR/helpers.sh"

function install_NODE_ENV {
echo "Installing node, nvm & yarn"
# TODO: this doesn't work (nvm is not defined)
nvm install 10
nvm alias default 10
curl -o- -L https://yarnpkg.com/install.sh | bash
Expand Down Expand Up @@ -42,7 +43,7 @@ function install_VIM_PLUGINS {
echo "Installing nerd-fonts"
git clone --depth 1 git@github.com:ryanoasis/nerd-fonts.git ~/dev/nerd-fonts
cd ~/dev/nerd-fonts
./install.sh 'Go-Mono'
./install.sh 'FiraCode'
cd ~
echo ""

Expand All @@ -59,10 +60,126 @@ function install_VIM_PLUGINS {
fi
}

function install_HASKELL {
# Install Haskell's Stack
echo "Installing Haskell's Stack"
curl -sSL https://get.haskellstack.org/ | sh

link "$DOTFILES_DIR/haskell/ghci" ~/.ghci
mkdir -p ~/.stack/global-project
link "$DOTFILES_DIR/haskell/global-stack.yml" ~/.stack/global-project/stack.yaml

chmod go-w ~/.ghci

stack install hlint hfmt

echo ""
}

function install_RUST {
# Install Rust
echo "Installing Rust"
curl https://sh.rustup.rs -sSf | sh
echo ""

# https://github.com/BurntSushi/ripgrep
# https://github.com/sharkdp/fd
# https://github.com/sharkdp/bat
# https://github.com/dalance/amber
cargo install ripgrep fd-find bat amber
cargo install --git https://github.com/jwilm/alacritty
link "$DOTFILES_DIR/alacritty/alacritty.yml" "$XDG_CONFIG_HOME/alacritty.yml"
# is 60 enough ?
sudo update-alternatives --install $(which x-terminal-emulator) x-terminal-emulator $(which alacritty) 60

echo ""
}

function install_GOLANG {
# Install Golang
echo "Installing Go"
git clone https://github.com/udhos/update-golang ~/dev/update-golang
cd ~/dev/update-golang
sudo ./update-golang.sh
gitUsername=$(git config --global user.name)
if [ ! -z "$gitUsername" ] ;then
echo "Creating your Github's go directory"
mkdir -p $GOPATH/src/github.com/$gitUsername
fi

mkdir -p ~/dev/go
GOPATH="$HOME/dev/go"
export GO_BIN="$GOPATH/bin:/usr/local/go/bin"

goinstall "Find Unleashed" github.com/kbrgl/fu
goinstall gocode github.com/mdempsky/gocode

# only install td if fetching todos-data is succesful
# since it's a private repo, so only would work for me
git clone git@github.com:gillchristian/todos-data.git ~/.todos
if [ $? -eq 0 ]; then
goinstall Todos github.com/gillchristian/todos/cmd/td
fi
}

function install_DOCKER_COMPOSE {
# TODO: prompt version
echo "Installing docker-compose"
sudo touch /usr/local/bin/docker-compose
touch /tmp/docker-compose-binary
curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" > /tmp/docker-compose-binary
sudo mv /tmp/docker-compose-binary /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo ""
}

function install_DOCKER {
echo "Installing Docker"
sudo apt remove docker docker-engine docker.io
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "Verifying fingerprint"
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install docker-ce
echo "Verifying Docker installation"
sudo docker run hello-world
sudo groupadd docker
sudo usermod -aG docker $USER
sudo systemctl enable docker

install_DOCKER_COMPOSE

echo "After the installation restart the computer and run \`\$ docker run hello-world\`"
echo ""
}

function install_ANTIBODY {
echo "Installing Antibody and adding config"
curl -sL git.io/antibody | sh -s
echo ""

echo "Installing plugins with antibody"
antibody bundle < "$DOTFILES_DIR/zsh/antibodyrc" > ~/.antibody_plugins.sh
antibody update
echo ""
}

function main {
# install_NODE_ENV
install_NODE_ENV

install_VIM_PLUGINS

install_HASKELL

install_GOLANG

install_DOCKER

install_RUST

# after calling sed to remove something from the
# file that is symlinked the symlink gets broken
Expand Down
5 changes: 4 additions & 1 deletion tmux/tmux.conf
Expand Up @@ -8,6 +8,9 @@ setw -g mouse on

set-window-option -g xterm-keys on

set -g base-index 1
setw -g pane-base-index 1

bind-key C-h select-pane -L
bind-key C-j select-pane -D
bind-key C-k select-pane -U
Expand All @@ -26,4 +29,4 @@ set-option -g status-interval 2
set-option -g status-left-length 60

set-option -g status-left '#[fg=green](#S) #(whoami) '
set-option -g status-right ' #[fg=white]%H:%M #[fg=green]#(tmux-mem-cpu-load --graph-lines 0 --colors --interval 2 --cpu-mode 1)'
set-option -g status-right ' #[fg=white]%H:%M #[fg=green]#(tmux-mem-cpu-load --graph-lines 0 --colors --interval 2)'
6 changes: 5 additions & 1 deletion vim/autoload/plug.vim
Expand Up @@ -2420,7 +2420,11 @@ function! s:diff()
call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:')
for [k, v] in plugs
let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..'
let diff = s:system_chomp('git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')), v.dir)
let cmd = 'git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)'))
if has_key(v, 'rtp')
let cmd .= ' -- '.s:shellesc(v.rtp)
endif
let diff = s:system_chomp(cmd, v.dir)
if !empty(diff)
let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : ''
call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)')))
Expand Down

0 comments on commit 75d7d44

Please sign in to comment.