Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Terminal with parenthesis matching (highlight)

  1. #1
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Terminal with parenthesis matching (highlight)

    Hi all,
    I write a lot of short scripts on the fly at the command line. Basically perl one liners, but I often get carried away and end up having several lines of code. Is there any terminal app out there that can do emacs or vi style parenthesis and brackets highlighting?

  2. #2
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Terminal with parenthesis matching (highlight)

    well why not use vi as your line editing mode (set -o vi)

    then when typing a long command, hit ESC and v brings your line into vi where you can edit to your hearts content (including brace matching) before :wq exits back to the shell and runs your command

  3. #3
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Terminal with parenthesis matching (highlight)

    grrrrr I've managed to stick to emacs and avoid vi for the past decade! You're telling me I have to betray my principles!?? Real programmers use emacs and all that.... Is there a way to do the same with emacs instead?

    In any case, joking apart, thanks for the answer. I'll give it a try.

  4. #4
    Join Date
    Oct 2010
    Location
    France
    Beans
    34
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Terminal with parenthesis matching (highlight)

    Or use one of the shell modes in emacs, shell or eshell. You get parenthesis matching for free, and you can easily move over to a buffer in cperl-mode if you need to.

  5. #5
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Terminal with parenthesis matching (highlight)

    Quote Originally Posted by skillet-thief View Post
    Or use one of the shell modes in emacs, shell or eshell. You get parenthesis matching for free, and you can easily move over to a buffer in cperl-mode if you need to.
    OK, that sounds interesting. I'm not sure what you mean though. Will I need to copy/paste between the terminal and an emacs window? Open a command line emacs? How would I execute the command once I am done writing it?

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Terminal with parenthesis matching (highlight)

    Try this:

    Code:
    set -o emacs
    I don't know if it'll work, but worth a shot, I suppose.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Terminal with parenthesis matching (highlight)

    Well, I tried both set -o vi and emacs and neither seems to be doing anything. Will this work for bash or is it specific to Korn shell?

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Terminal with parenthesis matching (highlight)

    It's a bash shell environment varable as far as I know.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Terminal with parenthesis matching (highlight)

    Actually, set -o vi seems to do something. I seem to be in a vi environment (I had to type i to edit) and :wq got me back to my command. Ok, so far so good, but there was no brace matching.

    set -o emacs got me back to my (normal?) mode, where Ctrl+K kills a line, Ctrl=W a word etc etc.

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Terminal with parenthesis matching (highlight)

    So.. is that.. good?

    I stick to vi mostly, since I'm not fond of emacs.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •