You are not logged in.
Pages: 1
Hi,
I'd like vim to set the spelllang variable automatically depending on the recipient of the email I'm about to write. The plan was to do something like the following:
if (grep -q address ~/.vim/foreign_language_speakers)
setlocal spell spelllang=foreign_language
where ~/.vim/foreign_language_speakers is a text file with the e-mail addresses people I communicate with in whatever language and the variable address is obtained from the "To" line in the e-mail. I understand grep within a vim script doesn't work exactely as in bash. I tried redefining the grepprg variable to grep -q &> /dev/null and the do
let bolean = grep address ~/.vim/foreign_language_speakers
and then the if statement, but no luck. vim tells me grep is not a variable. Clearly there's somethiing I haven't understood about assigning variables in vim scripts. I also tried vimgrep but have the same problem assigning the boolean result to a variable.
Any help appreciated
regards
Offline
Pages: 1