On Apr 09, 2016, at 12:31, dp <[email protected]> wrote:
> When Markdown syntax is selected and the current line begins with a dash, is 
> it possible to configure BBEdit to detect that and to begin the next line 
> with a dash when the return key is pressed?
______________________________________________________________________

Hey There,

Afraid not, but such things are easily scripted:

------------------------------------------------------------
tell application "BBEdit"
  tell front text window
    if its source language is "Markdown" then
      set theLine to line (get startLine of selection)
      if (theLine as text) starts with "-" then
        set after theLine to return & "-"
        select insertion point after selection
      end if
    end if
  end tell
end tell
------------------------------------------------------------

This is about as simple as it can get, but all manner of sophistication is 
possible.

Save as an appropriately named AppleScript using the Script Editor.app.

Place in BBEdit's Script Menu: ~/Library/Application Support/BBEdit/Scripts/

Give it an appropriate keyboard shortcut in BBEdit's Menus & Shortcuts prefs.

Such a script can do many things based on the context.

Search BBEdit-Talk for “markdown script”.

Also try searching Google for: “BBEdit AppleScript markdown”

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" 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 [email protected].
To post to this group, send email to [email protected].

Reply via email to