I am trying to modify the following function:
function! changeNumber() abort
if &nu + &rnu == 0
set nopaste
" how to set normal mode after the function exits?
else
set paste
" how to set insert mode after the function exits?
endif
endfunction
Basically, I'm trying to write a copy-paste helper function that removes the line numbers and enters/exits insert mode when it runs (for the full problem, see: https://stackoverflow.com/a/61952187/651174).