Does Vim (with or without a plugin - I don't care) support strikethrough text at all? I've found myself keeping a running list of "TO-DO's" in it, and would like to be able to "cross off" my done items, via strikethrough text.
Thanks!
You can put this in your .vimrc
map _ a<C-V>u0336<Esc><Space>
and then the underscore character will "strikout-ize" whatever is under the cursor, analogous to how ~ (tilde) changes the case.
It works like this:
a
- starts to append after the character under the cursor<C-V>u0336
(stands for Control-V followed by u0336) - the strikout overlay combining character<Esc>
- exists append mode<Space>
- advances the cursor past the strikeout character
Vim assigns another meaning to the Underscore (_) character (see :help _) so you might want to choose another character (or sequence of multiple characters).
Going for a highlighting simpler solution, I would use a Vim custom syntax highlighting rule so that, for example, text marked like this:
~~ text ~~
is displayed in a different color (eg. a darker text color if you have a dark background, or as dark reversed colors). Which would be, in vimrc:
au BufRead,BufNewFile *.txt syntax match StrikeoutMatch /\~\~.*\~\~/
hi def StrikeoutColor ctermbg=darkblue ctermfg=black guibg=darkblue guifg=blue
hi link StrikeoutMatch StrikeoutColor
(where the au command is used to apply the rule to filetype .txt files only)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With