From 37337175073df1d6cee589460bdf4b42f3e5b55f Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 26 Apr 2019 15:07:03 +0200 Subject: [PATCH] Preparing configuration of neovim --- tforgione.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tforgione.sh b/tforgione.sh index 777e116..1eefbee 100755 --- a/tforgione.sh +++ b/tforgione.sh @@ -84,7 +84,7 @@ configure_zsh() { yes_no_ask "do you wish to install and configure zsh ?" if [ $? -ne 0 ]; then - info "exiting" + info "not installing zsh" return fi @@ -165,6 +165,32 @@ configure_zsh() { fi } +configure_neovim() { + test_command nvim + if [ $? -ne 0 ] && [ $sudo_available -ne 0 ]; then + warn "you don't have neither sudo nor neovim, skipping neovim configuration" + return + fi + + yes_no_ask "do you wish to install and configure neovim ?" + + if [ $? -ne 0 ]; then + info "not installing neovim" + return + fi + + test_command nvim + if [ $? -ne 0 ]; then + info "installing neovim" + install neovim + fi + + mkdir -p $HOME/.config/nvim $HOME/.nvim/backups $HOME/.nvim/swp $HOME/.nvim/undo + ln -s $HOME/.config/dotfiles/init.vim $HOME/.config/nvim/init.vim + + nvim +qa +} + main() { echo_green "=== WELCOME TO TFORGIONE'S CONFIG INSTALLER ===" @@ -173,6 +199,7 @@ main() { sudo_available=$? configure_zsh + configure_neovim } main < /dev/tty