Is it possible to toggle text to strikethrough text in Visual Studio Code?

user1433365 picture user1433365 · Apr 18, 2018 · Viewed 7k times · Source

I want to keep track of a todo list in Visual Studio Code.

Is it possible to display/toggle strikethrough text:

  • task not yet done
  • ̶t̶a̶s̶k̶ ̶d̶o̶n̶e̶

(used https://www.piliapp.com/cool-text/strikethrough-text/ for the above).

Looking for a solution natively or with an extension. The strike-through text needs to be displayed in the text file (like the functioning of org mode in emacs) and not in some output window (like the rendering of a HTML/Latex/MD document).

Any experts in Visual Studio Code that know if this can be done and how to do it ?

Answer

Alex picture Alex · Apr 18, 2018

You can make strikethrough in vscode with the help of TODO Highlight extension:

"todohighlight.keywordsPattern": "(~~.+?~~)|(✔.+?\n)|(\\[x\\].+\n)",
"todohighlight.defaultStyle": {
    "color": "none",
    "backgroundColor": "none",
    "textDecoration": "line-through"
},

Use patterns that you usually use for done todos. The above works for such:

[x] done
✔ done
~~done~~

After that you can either use plain typing or find some toggling extension or write one yourself.