0

(related to How can I tell Notepad++ to always use a particular language with a particular file extension )

I want to have Notepad++ to associate wscript files with the Python language. Is there a way to do this? It has no extension.

Jason S
  • 7,665
  • There is nothing stopping you giving them an extension. vbs for example. vba and js would also be appropriate. – DavidPostill Oct 09 '15 at 16:39
  • No, that is not appropriate. I am using a tool called waf which mandates using a file named wscript with no extension. Please don't assume this is an xy-problem. – Jason S Oct 09 '15 at 16:41
  • I didn't suggest it was. Clearly you have missed important information from the question. – DavidPostill Oct 09 '15 at 16:42
  • "..." ok... I stated the question exactly as I wanted to. – Jason S Oct 09 '15 at 16:43
  • I don't know of any way to do this automatically, but menu > language > python will do want when the wscript file has been opened ... – DavidPostill Oct 09 '15 at 16:46
  • yeah, I do that now, except then I forget when I reopen wscript, then it fails when I start putting tabs my mistake, then I choose Python as the language and replace tabs with spaces to get it working again. (lather rinse repeat) – Jason S Oct 09 '15 at 21:27
  • Why don't you configure Notepad++ to always replace tabs with spaces? – DavidPostill Oct 09 '15 at 22:04
  • because I want to be able to use tabs in other files. – Jason S Oct 09 '15 at 22:27

1 Answers1

1

Create a symlink to the wscript file but give the link the correct extension, e.g.

mklink /H wscript.py wscript

When you edit the wscript.py file you should find that notepad correctly treats it as a Python file.

snowdude
  • 2,888
  • +1 for creativity, but I have a bunch of these directories and I don't want to have to do that in each case. – Jason S Oct 14 '15 at 16:47