jemnotesversion 2 / featuring this entry or see all/search

May 5
In smartindent mode, vim removes the indent if # is the first character on the line. This is annoying. I’ve tried various solutions that should work but don’t. Here’s one that should, and does:
inoremap # a#<Left><BS><Right>
(Courtesy of this vim tip, but beware; it contains some false information as well.) Use ^v (ctrl+v) to enter the special sequences easily.