VIM - Config

From Wiki.IT-Arts.net
Revision as of 06:12, 8 April 2024 by imported>Z (Created page with "Category:Post-It == Script File == <nowiki> #!/bin/sh # # To run after VIM installation ##### Test pre-existent config file echo "/root/.vimrc test..." if [ -e ~/.v...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



Script File

#!/bin/sh
#
# To run after VIM installation


##### Test pre-existent config file
echo "/root/.vimrc test..."
if [ -e ~/.vimrc ]
then
	echo "# A previous Vim config file is present!" &&

	# Backup previous config file
	echo "# Backup before updating..." &&
	cp -v ~/.vimrc ~/.vimrc.BACKUP &&
	
	# Append new conf to file
	echo "# Updating config file..." &&
	echo "\" Remove auto VISUAL mode on mouse selection" >> ~/.vimrc &&
	echo "set mouse-=a" >> ~/.vimrc &&

	echo "Success!!!" &&
	exit 0
else
	echo "# No previous Vim config file found, creating it..." &&
	touch ~/.vimrc &&

	# Append new conf to file
        echo "# Updating config file..." &&
        echo "\" Remove auto VISUAL mode on mouse selection" >> ~/.vimrc &&
        echo "set mouse-=a" >> ~/.vimrc &&

        echo "Success!!!" &&
        exit 0
fi

exit 0