I have the following lines in my vimrc which work perfectly on Linux, but don't work on OS X or Windows.
set relativenumber
nmap <F5> :set relativenumber! number!<CR>
imap <F5> <ESC>:set relativenumber! number!<CR>
The idea is that pressing F5 will toggle between relative and absolute, but the toggle only works the first time.
I have solved it by means of a function that first checks the state to determine which path to follow: