Vim Replace String 256 with <T_CO>

What was your first text editor when you started using Linux/Unix? Mine was pico. It was very easy to get started with and quite similar to nano. Then I moved to emacs and sticked with it for a long while. Eventually, I’ve switched to vim (or neovim), and that’s what I have been using until now. Well, the thing about text editor or may be this also applies to many other things, you’re only familiar with features that you constantly use....

May 9, 2021 · 2 min · 320 words · kenno

How to remove Ctrl-M characters from files

A short while back, after exporting my blog from WordPress to Hugo I noticed that there were some weird ^M characters in some files as shown in the following screenshot in blue. This is a special character, CTRL+M and can be removed using sed or vim. Using vim we can replace/substitute a text with the following command: %s/MATCH-TEXT/WITH-NEW-TEXT/g Therefore, we should be able to replace ^M, by typing CTRL+V then CTRL+M, with an empty space as so:...

January 6, 2019 · 1 min · 133 words · kenno