I use :r !uuidgen frequently to insert a new uuid into the buffer. This works, but I am generally attempting to insert the uuid between quotes, and :r !uuidgen prints the uuid on a new line.To get around this issue, I am currently using a simple keymap:nnoremap <C-u> mm:r!uuidgen<CR>dW_dd`mpThis macro sets the mark mm, inserts the uuid r!uuidgen, deletes the inserted uuid dW, deletes the extra line _dd, goes back to the mark BACKTICKm, and finally paste the uuid p.Is there a way to :r right after the cursor without this macro/keybinding that wastes a register?
:read after cursor instead of after line
external command
You can use the expression register = and system():<C-r>=system(uuidgen | tr -d '\n')<CR>It would look like that in an insert mode mapping:inoremap <key> <C-r>=system(uuidgen | tr -d '\n')<CR>or, with an expression mapping:inoremap <expr> <key> system(uuidgen \| tr -d '\n')