Thanks to glts, this is the solution:
inoremap <S-Home> <C-\><C-O>vg0<C-G>
inoremap <S-End> <C-\><C-O>vg$<C-G>
According to the help at :h i_CTRL-\_CTRL-O
, CTRL-\ CTRL-O
is "like CTRL-O
but don't move the cursor". It doesn't really explain why CTRL-O
would move the cursor, but it appears to have something to do with the cursor being "beyond the end of the line". I can't claim to understand what that means, but it kind-of supports my suspicion that vim generally treats line endings different than other text editors.