#!/usr/bin/env bash declare -A mapper=( [".e"]="$HOME/.bin/.e" ["alacritty"]="$HOME/.config/alacritty/alacritty.yml" ["astronvim"]="$HOME/.config/astronvim/lua/user/init.lua" ["bash"]="$HOME/.bashrc" ["bspwm"]="$HOME/.config/bspwm/bspwmrc" ["environment"]="$HOME/.config/environment" ["environment.local"]="$HOME/.config/environment.local" ["git"]="$HOME/.config/git/config" ["git-ignore"]="$HOME/.config/git/ignore" ["qutebrowser"]="$HOME/.config/qutebrowser/common.py" ["starship"]="$HOME/.config/starship.toml" ["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc" ["vim"]="$HOME/.config/vim/vimrc" ["wakatime"]="$HOME/.config/wakatime/.wakatime.cfg" ["xprofile"]="$HOME/.xprofile" ["zsh"]="$HOME/.config/zsh/.zshrc" ) if [[ -z "$1" ]] then echo "No argument given. Use --list (-l) to show all options." exit fi if [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]] then echo "${!mapper[@]}" exit fi target="${mapper["$1"]}" if [[ -n "$target" ]] then $EDITOR "$target" else echo "Dotfile not found. Use --list (-l) to show all options." fi