Add notification to vim autocomplete toggle

This commit is contained in:
Talia 2023-05-17 16:54:36 +02:00
parent 40f08840bb
commit 33077b64a1
1 changed files with 5 additions and 3 deletions

View File

@ -1,15 +1,17 @@
function s:autocomplete(enabled) function s:autocomplete(enabled)
if a:enabled if a:enabled
let g:autocomplete=1
for letter in (split("abcdefghijklmnopqrstuvwxyz", ".\\zs")) for letter in (split("abcdefghijklmnopqrstuvwxyz", ".\\zs"))
exec "inoremap ".letter." ".letter."" exec "inoremap ".letter." ".letter.""
endfor endfor
let g:autcomplete=1 echo "Autocomplete enabled"
else else
unlet g:autocomplete
for letter in (split("abcdefghijklmnopqrstuvwxyz", ".\\zs")) for letter in (split("abcdefghijklmnopqrstuvwxyz", ".\\zs"))
exec "iunmap ".letter exec "iunmap ".letter
endfor endfor
unlet g:autocomplete echo "Autocomplete disabled"
end endif
endfun endfun
command -nargs=1 Complete call <SID>autocomplete(<q-args> == "on") command -nargs=1 Complete call <SID>autocomplete(<q-args> == "on")