Go to middle of line in vim

I know 0 goes to the beginning of line and $ goes to the end, but is there something for the middle?


Solution 1:

:call cursor(0, len(getline('.'))/2)

Solution 2:

Typing gm would do it, but it moves by screen lines (see :help gm). In order to get it working with text lines, one can remap this command:

map gm :call cursor(0, virtcol('$')/2)<CR>