I want to make a Python
ftplugin (but other filetypes will also have this option) where, if the previous line has a comment that starts with
#, the next line can be commented via
<Shift><CR>, an insert-mode mapping (
inoremap). How can I code Vimscript so that it checks whether the current line is commented, and subsequently allows the
inoremap to make a new line commented?
And please don't recommend a third-party plugin like
NERD Commenter (which, btw, I respect very much), I want something as close to vanilla-Vim as possible for this.