views:

308

answers:

1

I'm editing a network protocol frame stored a file in Unix (\n newlines). I need to insert the carriage return character (U+000D aka \r). When I try to paste it from the clipboard ("+p) or type it using Ctrl+Shift+u-000d, the linefeed is inserted (U+000A).

What is the right way to do it?

+3  A: 

Type: ctrl-v ctrl-m

Ctrl-V tells vi that the next character typed should be inserted literally and ctrl-m is the keystroke for a carriage return.

R Samuel Klatchko
Thanks, this works for me. The help can be found using `:help ins-special-keys`.
Andrey Vlasovskikh
If you're using the default Windows installation then replace CTRL+V by CTRL+Q since CTRL+V is remmaped to 'paste'.
Leonardo Constantino