 |
 |
BBEdit Indentation
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Does anybody know how to get BBEdit to automatically create indents in a document of source code to indicate the beginning and ending of a function? I know that emacs does this, but I'm sure there must be a way to do this in BBEdit too....
Anybody?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2003
Status:
Offline
|
|
I've never used emacs, so I'm not really sure what exactly you're asking... But BBEdit has an auto-indent option, that for example if the line you are on is indented 5 tabs, pressing enter will take you to the next line, pre-indented 5 tabs. I'm not sure if this is what you mean or not.
|
|
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by madmacgames
I've never used emacs, so I'm not really sure what exactly you're asking... But BBEdit has an auto-indent option, that for example if the line you are on is indented 5 tabs, pressing enter will take you to the next line, pre-indented 5 tabs. I'm not sure if this is what you mean or not.
Not exactly.. what I"m looking for is a feature that will take a document like this:
[php]
myfunction () {
for ($x=0; $x < 20; $x++) {
print "hello";
}
}
[/php]
and transform it to:
[php]
myfunction () {
for ($x=0; $x < 20; $x++) {
print "hello";
}
}
[/php]
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Hanover, NH, USA
Status:
Offline
|
|
I don't think BBEdit supports syntax-aware indenting, at least I never figured out how to do it. But then, I haven't used the latest version of BBEdit since I switched to TextWrangler when became free.
One thing you could do is write a perl or python script that does it. BBEdit allows scripts to be run on the current selection or the entire file and it pastes the script's output back to the file.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status:
Offline
|
|
Other than checking the "auto indent" checkbox?
Or does that not do what you're after?
|
|
The Lord said 'Peter, I can see your house from here.'
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2003
Status:
Offline
|
|
>> Or does that not do what you're after?
No, it doesn't, though I don't really see why not having the feature would be a problem if you indent while coding, which most people do.
The only time I could see maybe needing it would be if you downloaded a PHP file that the programmer did not indent, which in my 3+ years of working with PHP has been never.
|
|
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status:
Offline
|
|
|
|
|
The Lord said 'Peter, I can see your house from here.'
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status:
Offline
|
|
BBEdit has tidy built in. Not sure what kind of code you can run it on other than HTML/XML.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|