#!/usr/bin/env bash
sudo apt -y install tldr-py fzf 

TLDR_CONFIG_DIR=${HOME}/.tldr
ALIAS_DIR=".zshrc.d"
mkdir -p ${TLDR_CONFIG_DIR}

cd ${HOME}
git clone http://github.com/tldr-pages/tldr.git .tldr

cat > ${HOME}/${ALIAS_DIR}/003_tldr.zsh <<EOF
if [ -x /usr/bin/tldr ]; then
	alias howto="tldr find"
fi
EOF

cat > ${HOME}/.tldrrc <<EOF
colors:
  command: cyan
  description: blue
  usage: green
platform: linux
repo_directory: ${TLDR_CONFIG_DIR}
EOF

tldr reindex
