Is there a way in vi(m) to target one specific line in a file for a string substitution?
I need to frequently add SSL SHA fingerprints from Web servers to my Mercurial .hgrc. I can grab the required signature from Chrome pretty easily by double-clicking the padlock and looking at the certificate details, but I get the sig with space delimiters rather than the colon delimiters desired by Mercurial
06 32 1C C5 8A 49 77 85 C5 89 6F 67 75 96 F0 43 77 96 EB 90
Example from Google Code.
Is there a way to:
- Copy said fingerprint to my clipboard
- Edit my .hgrc with vi(m)
- Go into insert mode to paste said fingerprint
Target just that line with a
:s/ /:/g
Save the file
Right now I can paste the fingerprint into a new file, do the substitution, and pull it into my .hgrc with a :r filename, but that's an extra step that I wouldn't mind skipping.