Browse code

Correction vimrc spell autocompletion

schardon authored on 21/04/2020 00:55:52
Showing 2 changed files
... ...
@@ -25,6 +25,7 @@ https://github.com/mmozuras/vimfiles/blob/master/vimrc
25 25
 https://borntocode.fr/ameliorer-votre-productivite-avec-vim/
26 26
 https://github.com/JakobGM/dotfiles/blob/master/config/nvim/init.vim
27 27
 https://gist.github.com/millermedeiros/1262085
28
+https://github.com/changemewtf/dotfiles/blob/master/vim/.vimrc
28 29
 
29 30
 https://www.youtube.com/watch?v=XA2WjJbmmoM
30 31
 
... ...
@@ -227,12 +227,15 @@ function! Smart_TabComplete()
227 227
 
228 228
   " CORRECTION : MODE ORTHOGRAPHE
229 229
   if(&spell)
230
-
231
-    let substr = strpart(line, col('.') - 1, 1)
232
-    if substr == "" | return "\<C-N>" | endif
233
-    if substr == " " | return "\<C-N>" | endif
234
-    return "\<c-o>z="
235
-
230
+    let substr = strpart(line, col('.') -2, 1)
231
+    if( match(substr, "[a-zA-Z]") < 0 )
232
+      return "\<tab>"
233
+    else
234
+      let substr = strpart(line, col('.') - 1, 1)
235
+      if substr == "" | return "\<C-N>" | endif
236
+      if substr == " " | return "\<C-N>" | endif
237
+      return "\<c-o>z="
238
+    endif
236 239
 
237 240
 
238 241
   " CORRECTION : MODE CODE