69 lines
2.0 KiB
Bash
Executable File
69 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
manager=nvchad
|
|
|
|
function nvchad_setup() {
|
|
nvchad_git='https://github.com/NvChad/NvChad'
|
|
config_root="${nvim_data[config_dir]}"
|
|
custom="${config_root}/lua"
|
|
git clone "$nvchad_git" "$config_root" --depth 1
|
|
if [[ $? != 0 ]]; then
|
|
printf 'Failed to clone\n' >&2
|
|
exit 1
|
|
fi
|
|
printf 'nvchad is cloned into %s\n' "$config_root"
|
|
if ! type gclone &>/dev/null; then
|
|
printf 'manually clone nvchad config into %s\n' "$custom" >&2
|
|
exit 1
|
|
fi
|
|
cd "$custom"
|
|
gclone nvchad
|
|
ln -s nvchad custom
|
|
printf 'Config should be cloned into %s, linked to %s\n' \
|
|
"${custom}/nvchad" \
|
|
"${custom}/config"
|
|
# nvim --headless -c 'autocmd User MesonInstallAll quitall' -c 'PackerSync'
|
|
deps=( goimports-reviser gofumpt lldb delve )
|
|
printf 'requires: %s' "${deps[@]}\n"
|
|
printf 'goimports-reviser: go install -v github.com/incu6us/goimports-reviser/v3@latest\n'
|
|
printf 'gofumpt: go install mvdan.cc/gofumpt@latest\n'
|
|
printf 'delve: go install github.com/go-delve/delve/cmd/dlv@latest\n'
|
|
printf 'y\n' | nvim -es --headless +'TSInstall bash' +'q!' -
|
|
}
|
|
|
|
function paq_setup() {
|
|
git clone --depth=1 https://github.com/savq/paq-nvim.git \
|
|
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim
|
|
cp paq_files/temp_init.lua "${nvim_data[config_dir]}/init.lua"
|
|
nvim --headless -c 'PaqInstall' -c q
|
|
rm "${nvim_data[config_dir]}/init.lua"
|
|
cp paq_files/temp_init2.lua "${nvim_data[config_dir]}/init.lua"
|
|
}
|
|
|
|
function packer_setup() {
|
|
git clone --depth 1 'https://github.com/wbthomason/packer.nvim' \
|
|
"${HOME}/.local/share/nvim/site/pack/packer/start/packer.nvim"
|
|
cp packer_files/temp.lua "${nvim_data[config_dir]}/init.lua"
|
|
cp packer_files/packer_compiled.lua "${nvim_data[config_dir]}/plugin"
|
|
|
|
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
|
rm "${nvim_data[config_dir]}/init.lua"
|
|
}
|
|
|
|
# Start
|
|
. nvim_data
|
|
./remove_all
|
|
mkdir -p "${nvim_data[config_dir]}"
|
|
|
|
case "$manager" in
|
|
paq)
|
|
paq_setup
|
|
;;
|
|
packer)
|
|
packer_setup
|
|
;;
|
|
nvchad)
|
|
nvchad_setup
|
|
;;
|
|
esac
|