Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3866
    SteveH
    Member

    I thought I would copy a couple of my previous posts over as they were added to the old forum just as it was moved.

    Although I used to loathe smart quotes in Word, I have come to like them when creating text documents in applications such as BBEdit. I would find it useful to have an option to create ‘smart quotes’ automatically when typing. Obviously this is no use when writing code so it would need to be an option applicable to specific configurations.

    In addition menu options to educate quotes or stupefy quotes would also be occasionally useful.

    #3868
    Yutaka Emura
    Keymaster

    Thanks for following up your message. It is not hard for someone to create a plug-in to do smart quotes. Can you please clarify what educate quotes or stupefy quotes mean. Thanks!

    #3871
    SteveH
    Member

    Can you please clarify what educate quotes or stupefy quotes mean.

    Educate quotes would convert selected text such that ‘this’ becomes ‘this’. Selecting text and then stupefy quotes would convert ‘this’ to ‘this’.

    #3873
    Yutaka Emura
    Keymaster

    Actually, You can do those now:

    Select “Replace” on the Search menu (or press CTRL + H), Check “Use Regular Expressions”, and then:

    Eduate Quotes:


    Find: '(.*?)'
    Replace with: ‘1’

    Stupefy Quotes:


    Find:‘(.*?)’
    Replace with: '1'

    Or you can write macros like these (JavaScript):

    Eduate Quotes:


    document.selection.Replace("x27(.*?)x27","‘1’",eeFindNext | eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp);

    Stupefy Quotes:


    document.selection.Replace("‘(.*?)’","x271x27",eeFindNext | eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp);

    I will submit these macros into the library.

    #3874
    SteveH
    Member

    Very nice, thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.