Like Salman said, you could define a user-comand W executing just w ;
but the reason your nmap didn't work is that by the time you'tr typing
the W, you aren't in Normal mode anymore, but in Command-line mode;
OTOH you don't want any W in the middle of a command's parameters to
always lowercased; so another possibility is a command-mode
abbreviation, as follows:
:cabbrev <expr> W ((getcmdtype() == ':' && getcmdpos() <= 4)? 'w' : 'W')
Testing getcmdtype() avoids lowercasing the W in a search command, and
testing getcmdpos() allows doing it only near the left margin. A
user-command is more elegant however; but in order to make it behave
like the w command you may want to define that :W command with the
appropriate parameters, as follows (untested):
:command -nargs=* -complete=file -range=% -bang -bar W
<line1>,<line2>w<bang> <args>
which, after all, makes it somewhat less elegant; so you may choose a
command or an abbrev to suit youor taste.
Best regards,
Tony.