浏览代码

Turn on vim spell checking in mutt configuration

Bob Mottram 9 年前
父节点
当前提交
8a63ce92fb
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8
    5
      src/freedombone-app-vim

+ 8
- 5
src/freedombone-app-vim 查看文件

30
 
30
 
31
 VARIANTS='full-vim'
31
 VARIANTS='full-vim'
32
 
32
 
33
-vim_variables=(MY_USERNAME)
34
 VIM_TEMP_DIR='.vimtemp'
33
 VIM_TEMP_DIR='.vimtemp'
34
+VIM_MUTT_EDITOR='vim \"+set nonumber\" \"+set insertmode\" \"+set spell\" +/^$/ +9'
35
+
36
+vim_variables=(MY_USERNAME
37
+               VIM_MUTT_EDITOR)
35
 
38
 
36
 function change_password_vim {
39
 function change_password_vim {
37
     echo -n ''
40
     echo -n ''
211
     # add a mutt entry to use Vim to compose emails
214
     # add a mutt entry to use Vim to compose emails
212
     if [ -f /etc/Muttrc ]; then
215
     if [ -f /etc/Muttrc ]; then
213
         if ! grep -q "set editor=" /etc/Muttrc; then
216
         if ! grep -q "set editor=" /etc/Muttrc; then
214
-            echo 'set editor="vim"' >> /etc/Muttrc
217
+            echo "set editor=\"$VIM_MUTT_EDITOR\"" >> /etc/Muttrc
215
         else
218
         else
216
-            sed -i 's|set editor=.*|set editor="vim"|g' /etc/Muttrc
219
+            sed -i "s|set editor=.*|set editor=\"$VIM_MUTT_EDITOR\"|g" /etc/Muttrc
217
         fi
220
         fi
218
         for d in /home/*/ ; do
221
         for d in /home/*/ ; do
219
             USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
222
             USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
220
             if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
223
             if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
221
                 if [ -f /home/$USERNAME/.muttrc ]; then
224
                 if [ -f /home/$USERNAME/.muttrc ]; then
222
                     if ! grep -q "set editor=" /home/$USERNAME/.muttrc; then
225
                     if ! grep -q "set editor=" /home/$USERNAME/.muttrc; then
223
-                        echo 'set editor="vim"' >> /home/$USERNAME/.muttrc
226
+                        echo "set editor=\"$VIM_MUTT_EDITOR\"" >> /home/$USERNAME/.muttrc
224
                     else
227
                     else
225
-                        sed -i 's|set editor=.*|set editor="vim"|g' /home/$USERNAME/.muttrc
228
+                        sed -i "s|set editor=.*|set editor=\"$VIM_MUTT_EDITOR\"|g" /home/$USERNAME/.muttrc
226
                     fi
229
                     fi
227
                 fi
230
                 fi
228
             fi
231
             fi