Filetype for rc files?

34 views
Skip to first unread message

@lbutlr

unread,
May 14, 2020, 9:30:43 AM5/14/20
to BBEdit Talk
I’ve been using the “Unix Shell script” for rc files (like .vimrc, .slrnrc, .zshrc, etc) but I have to set it manually for each file. Can I make this automatic somehow?

Also, can I teach BBEdit that lines that start with % in my slrnrc are comments? (I know they’re comments in some other files as well, but I can’t remember which)

Or maybe someone already has a language module for "Unix Config Files”?

I did look on https://www.barebones.com/support/bbedit/plugin_library.html but nothing there jumped out as appropriate.

I’m sure this was discussed at some point in the last… erm, 15 years… but I can’t find it in my archives.

(“Unix Shell Script” Is… OK for many rc files, but not all, though it is not great for actual shell scripts.)


--
Against stupidity the gods themselves contend in vain.


Darren Duncan

unread,
May 14, 2020, 4:59:25 PM5/14/20
to bbe...@googlegroups.com
If the filenames have distinct extensions then the solution is easy.

Go to the BBEdit main Preferences, into the Languages panel, and add an item to
"Custom filename extension mappings" for each filename extension like ".vimrc"
or whatever.

That should make BBEdit use the corresponding language module for it by default.

-- Darren

@lbutlr

unread,
May 18, 2020, 8:25:33 AM5/18/20
to BBEdit Talk
On 14 May 2020, at 14:56, Darren Duncan <dar...@darrenduncan.net> wrote:
> If the filenames have distinct extensions then the solution is easy.

The do not have any extensions at all.



--
Life is raw. Everybody medicates. — Quentin


Patrick Woolsey

unread,
May 18, 2020, 10:18:18 AM5/18/20
to bbe...@googlegroups.com
On 5/14/20 at 9:30 AM, kre...@kreme.com (@lbutlr) wrote:

>I’ve been using the “Unix Shell script” for rc files (like .vimrc, .slrnrc, .zshrc, etc) but I have to set it manually for each file. Can I make this automatic somehow?
>

Once you have set a file's language type, BBEdit should
henceforth remember that choice, though alternatively you could
add an Emacs mode line (as detailed in the handy manual :-),
e.g. for "Unix Shell Script":

# -*-mode: unix-shell-script; -*-


>Also, can I teach BBEdit that lines that start with % in my slrnrc are comments? (I know they're comments in some other files as well, but I can’t remember which)
>

I regret that is not possible (and by extension, you may find
such a file is not the best candidate for treatment as a "Unix
Shell Script").


>Or maybe someone already has a language module for "Unix Config Files”?

Could be, though I'm not currently aware of any (and per your
above question about comments, such files' syntax is not
necessarily consistent).


>("Unix Shell Script" Is… OK for many rc files, but not all, though it is not great for actual shell scripts.)
>

As always :-) if you have any specific concerns or requests,
please direct 'em to tech support <sup...@barebones.com>.


Regards

Patrick Woolsey
==
Bare Bones Software, Inc. <https://www.barebones.com/>

Reply all
Reply to author
Forward
0 new messages