Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 263
user1433365 Avatar asked Apr 18 '18 12:04

user1433365


People also ask

How do you toggle lines in VSCode?

Open up your VSCode keybindings. You'll notice that my keybinding is CMD + L. You can choose whatever you want, as long as it's not already taken. Save your file, and now you should be able to toggle line numbers on/off with whatever keybinding you added in your keybindings file.

Can you put a strikethrough text?

Select the text you want to strikethrough. Press Ctrl + D. The Font dialog box appears. Press Alt + K to select Strikethrough (note that k is the underlined letter).


1 Answers

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.

like image 198
Alex Avatar answered Nov 15 '22 10:11

Alex