Add .e command and completionsrc
This commit is contained in:
parent
5c1bfe5b3c
commit
0dbe93759a
5 changed files with 46 additions and 5 deletions
29
.bin/.e
Executable file
29
.bin/.e
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
declare -A mapper=(
|
||||
["bash"]="$HOME/.bashrc"
|
||||
["bspwm"]="$HOME/.config/bspwm/bspwmrc"
|
||||
["qb"]="$HOME/.config/qutebrowser/config.py"
|
||||
["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
|
||||
["vim"]="$HOME/.config/vim/vimrc"
|
||||
["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
|
Loading…
Add table
Add a link
Reference in a new issue