Prepare for nvim

This commit is contained in:
Tobias Reisinger 2023-04-02 19:27:03 +02:00
parent 807818911d
commit 65f913310a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 16 additions and 4 deletions

10
.bin/.e
View file

@ -13,6 +13,8 @@ declare -A mapper=(
["git"]="$HOME/.config/git/config"
["git-ignore"]="$HOME/.config/git/ignore"
["home-manager"]="$HOME/.config/nixpkgs/home.nix"
["nvim"]="$HOME/.config/nvim/"
["nvim.packer"]="$HOME/.config/nvim/lua/user/packer.lua"
["polybar"]="$HOME/.config/polybar"
["qutebrowser"]="$HOME/.config/qutebrowser/common.py"
["starship"]="$HOME/.config/starship.toml"
@ -37,7 +39,13 @@ fi
target="${mapper["$1"]}"
if [ -n "$target" ]
then
$EDITOR "$target"
if [ -d "$target" ]
then
cd "$target"
$EDITOR .
else
$EDITOR "$target"
fi
else
echo "Dotfile not found. Use --list (-l) to show all options."
fi

View file

@ -5,8 +5,9 @@ _autoinstall_base () {
"$HOME/.config/vim/autoload/plug.vim" \
&& [ -x "$(command -v vim)" ] && yes | vim +'PlugInstall --sync' +qa --not-a-term
#_autoinstall_git "https://github.com/AstroNvim/AstroNvim" "$HOME/.config/nvim" \
# && [ -x "$(command -v nvim)" ] && nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
_autoinstall_git "https://github.com/wbthomason/packer.nvim" \
"$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" \
&& [ -x "$(command -v nvim)" ] && nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
[ ! -x "$(command -v starship)" ] \
&& curl -sS "https://starship.rs/install.sh" | BIN_DIR="$HOME/.local/bin" FORCE=1 sh
@ -67,7 +68,7 @@ _autoinstall_git () {
then
echo "Installing repo $1 to $2"
mkdir -p "$2"
git clone "$1" "$2" >/dev/null 2>&1
git clone --depth=1 "$1" "$2" >/dev/null 2>&1
return 0
fi
return 1