It’s been quite a while since I wrote something in the Bits and Pieces category. I’m forgetting that the goal of this blog was partly documenting my own knowledge for my own use.Definitely need to hide this category from the front page and use it often. Or even better, make it a category on the wiki.
^M is how vim shows the
0xD character, which in Windows is a newline character. A more complete list of such characters is here: http://vimdoc.sourceforge.net/htmldoc/digraph.html#digraph-table
One way to insert such characters would be:
^M is entered by holding down Ctrl and typing v followed by m, and then releasing Ctrl. 1https://stackoverflow.com/a/5843561/3597501
Interestingly enough, the keys above are represented via the tag, which apparently is a thing:2 https://developer.mozilla.org/ru/docs/Web/HTML/Element/kbd
<kbd>element represents user input and produces an inline element displayed in the browser’s default monospace font.
Vim removing empty lines & executing a command on lines matching a regex
:g will execute a command on lines which match a regex. The regex is ‘blank line’ and the command is
:d (delete) 3 https://stackoverflow.com/questions/706076/vim-delete-blank-lines
Also interesting is the distinction between blank lines and empty lines. They could be defined as just
'\n' and as a line with various spaces, but on visible content.
Footnotes [ + ]