Turn on vim spell checking in mutt configuration

This commit is contained in:
Bob Mottram 2016-10-12 11:01:15 +01:00
parent fd7fda6c57
commit 8a63ce92fb
1 changed files with 8 additions and 5 deletions

View File

@ -30,8 +30,11 @@
VARIANTS='full-vim' VARIANTS='full-vim'
vim_variables=(MY_USERNAME)
VIM_TEMP_DIR='.vimtemp' VIM_TEMP_DIR='.vimtemp'
VIM_MUTT_EDITOR='vim \"+set nonumber\" \"+set insertmode\" \"+set spell\" +/^$/ +9'
vim_variables=(MY_USERNAME
VIM_MUTT_EDITOR)
function change_password_vim { function change_password_vim {
echo -n '' echo -n ''
@ -211,18 +214,18 @@ function install_vim {
# add a mutt entry to use Vim to compose emails # add a mutt entry to use Vim to compose emails
if [ -f /etc/Muttrc ]; then if [ -f /etc/Muttrc ]; then
if ! grep -q "set editor=" /etc/Muttrc; then if ! grep -q "set editor=" /etc/Muttrc; then
echo 'set editor="vim"' >> /etc/Muttrc echo "set editor=\"$VIM_MUTT_EDITOR\"" >> /etc/Muttrc
else else
sed -i 's|set editor=.*|set editor="vim"|g' /etc/Muttrc sed -i "s|set editor=.*|set editor=\"$VIM_MUTT_EDITOR\"|g" /etc/Muttrc
fi fi
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
if [ -f /home/$USERNAME/.muttrc ]; then if [ -f /home/$USERNAME/.muttrc ]; then
if ! grep -q "set editor=" /home/$USERNAME/.muttrc; then if ! grep -q "set editor=" /home/$USERNAME/.muttrc; then
echo 'set editor="vim"' >> /home/$USERNAME/.muttrc echo "set editor=\"$VIM_MUTT_EDITOR\"" >> /home/$USERNAME/.muttrc
else else
sed -i 's|set editor=.*|set editor="vim"|g' /home/$USERNAME/.muttrc sed -i "s|set editor=.*|set editor=\"$VIM_MUTT_EDITOR\"|g" /home/$USERNAME/.muttrc
fi fi
fi fi
fi fi