jschaf / powershell.el

An Emacs mode for editing and running Microsoft PowerShell code.
93 stars 30 forks source link

Extensions definition? #20

Closed JJ closed 7 years ago

JJ commented 7 years ago

I'm completely new to PowerShell. What are the default extensions? If I use .ps PostScript mode comes up (yes, seriously). In general, a bit of documentation about what this mode can and can't do would be nice...

jschaf commented 7 years ago

The major mode variable for powershell is below. So, ps1, psd1, and psm1 are all recognized as powershell files. You'll need to add ps to auto-mode-alist to make it work. I can't add ps to this mode as it would clobber the Emacs' default for PostScript mode (though it's probably not that many users).

(add-to-list 'auto-mode-alist '("\\.ps[dm]?1\\'" . powershell-mode))

Yep, I should eventually get around to documentation, but since I don't have a Windows box anymore, it complicates things.

JJ commented 7 years ago

Thanks!

2017-07-02 11:10 GMT+02:00 Joe Schafer notifications@github.com:

The major mode variable for powershell is below. So, ps1, psd1, and psm1 are all recognized as powershell files. You'll need to add ps to auto-mode-alist to make it work. I can't add ps to this mode as it would clobber the Emacs' default for PostScript mode (though it's probably not that many users).

(add-to-list 'auto-mode-alist '("\.ps[dm]?1\'" . powershell-mode))

Yep, I should eventually get around to documentation, but since I don't have a Windows box anymore, it complicates things.

You can use PowerShell in Linux now, it's been released with an OpenSource license... It's where I'm using it now. :-)