BBEdit doesn’t do the kind of syntactic analysis that is required for
“smart” indentation to work reliably.
On 14 Feb 2019, at 14:02, Néstor E. Aguilera wrote:
Hi,
Languages such as python need indentation after a colon so as to start
a new block, which some editors will do automatically:
def f(x):
if x > 1:
while x < 5:
etc
so I don't think the suggested clipping would be useful in this case.
Also, notice that instead of using tab in the arguments of the
clipping, you could just use a tab to make the indentation. Remember
that under default settings, the delete key would de-indent one "tab":
When you backspace from the insertion point, BBEdit will
delete a tab stop's worth of spaces if there are only
spaces (and tabs) between the insertion point and the
start of the line on which you're editing. This may be
disabled by an expert preference if desired...
BBEdit also can have tabs converted to spaces automatically, and the
amount of indentation depending on the type of text file (e.g., 2
spaces for .html files, 3 for .txt, 4 for .py).
So perhaps it would be nice to have an automatic indent when you hit
return after some character, say "{" in C or ":" in python.
Best,
Nestor
===============================================
On 13 Feb 2019, at 22:34, Christopher Stone
<[email protected]> wrote:
On 02/12/2019, at 21:30, Ehler <[email protected]>
wrote:
I'm very new to using BBEdit but love a lot of things about it! I'm
hoping to mimic a feature from Sublime Text that increases the
indent contextually based on what you're doing with the code. Here's
an example in JavaScript (I don't claim to know anything)
Hey Ehler,
I doubt we'll see behavior like that from BBEdit any time soon, but
please do make a feature request to the support address (see message
footer).
The first thing to try out is a clipping:
function <#function name#>(<#args#>) {
<#code#>
return false;
}
Paste this into BBEdit – you can then tab between the tokenized
arguments.
(See Clippings in the BBEdit user manual.)
** I'm not sure if BBEdit has JavaScript clippings by default, but I
think it does. Yeah, it's in the BBEdit 9 Default Clippings set.
http://www.barebones.com/support/bbedit/clippings_library.html
http://bbeditextras.org/wiki/index.php?title=Clippings
Type the following:
function betterOffFred(shirt) {Cmd-O, Cmd-O, Cmd-N, Tab,
console.log("I'm too sexy for my" + shirt)
(Cmd-Letter-O - not zero.)
Make sure the Emulate Emacs key bindings setting is ON in the BBEdit
Keyboard Preferences:
<PastedGraphic-1.png>
You may find BBEdit's clippings do the trick.
You may want to create fantastic smart-workflows with AppleScript.
You may want to consider a clippings utility that has GUI
capabilities like Typinator.
In any case – many exciting things are possible.
--
Best Regards,
Chris
--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.