On Thursday, 13 October 2016 08:25:14 UTC+2, Christopher Stone wrote:
>
> On Oct 12, 2016, at 10:15, Johan Sölve <johan...@gmail.com <javascript:>> 
> wrote:
>
> Since I work in the middle of an ongoing indentation war (you know, tabs 
> vs. spaces) I have a need for auto-detecting the indentation mode when 
> opening …
>
> I'm not even sure if it's possible to hook a script into opening files, no 
> matter how a file was opened.
>
> ------------------------------
>
> Hey Johan,
>
> Look for “Document attachment points” in the BBEdit manual and 
> “documentDidOpen”.
>
> [...] 
>
I've done stuff like this before and don't really recommend it as an 
> automated process.  I've had too many instances where something fairly 
> critical got changed unexpectedly.
>

Thanks for the pointer. Chris!

I did not intend to have the script make any changes, just set the 
indentation setting to match what is detected in the opened file. 


On Thursday, 13 October 2016 14:07:14 UTC+2, Dave wrote:
>
> I work on different projects with their own conventions, so I face similar 
> challeneges. One thing that has helped has been convincing people to use 
> EditorConfig, which BBEdit and most IDEs and editors support. It allows you 
> to configure indentation formats for different languages, so they can use 
> two-space indenting for YAML and 4 spaces for JavaScript. So you can leave 
> your global defaults set to your own preferences and still comply with the 
> arbitrary and often hare-brained demands of the people you sometimes have 
> to work with.
>

Dave, this is excellent! I tried .editorconfig and it works exactly how I 
want, just by adding the file to projects where it is missing (that would 
be just about every project for now). 
I'll go for this solution. I'll just try to convince my PHPstorm colleagues 
to install the plugin needed for that IDE. 

Even better would be if all developers agreed that that spaces are for 
alignment and tabs are for indentation (win/win), but that is obviously not 
going to happen.

(better still would be if BBEdit supported elastic tab stops; then we could 
use tabs also for alignment... http://nickgravgaard.com/elastic-tabstops/ )

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to