----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Thursday, September 22, 2005 10:22 AM
Subject: Function behaviour problem
> I don't understand why does this happends. Cursor is in the middle of
> documentWhen I map a key like this:
> nmap <F12> :color morning<CR>
> it works ok. Changes my colorscheme. But when I do it like this:
> nmap <F12> :exec ToggleColors()<CR>
> function! ToggleColors()
> color adaryn
> it changes colorscheme... and moves cursor to first line. Why is that?
> Thanks in advance
> Tomasz Kalkosinski
":exec" takes as argument an Ex-command, not a function. To run a function
from the command-line, use ":call functionname()" or ":echo functionname()".
The latter displays the return value of the function, or 0 if ":return"
wasn't used or was used without an argument.