else if( d && ( (d <= b && d <= s) || (!b && !s) )   smallest = d

Consider this piece of code of C++. Can we have bracket matching (highlighting opening bracket when cursor on closing bracket & vice versa)?

  • did you mean set matchbrackets in nanorc?
    – Rinzwind
    Oct 17, 2016 at 17:28
  • yup thanks for hint, I just figured out this and posted answer. Thanks for help
    – owsmmj
    Oct 18, 2016 at 5:38
  • Nano uses regex for highlighting, which, I believe, cannot give such a smart color picking.
    – Multifix
    Jun 7, 2022 at 7:31

1 Answer 1

set brackets ""')>]}"
set matchbrackets "(<[{)>]}"

Update ~/.nanorc (or perhaps /etc/nanorc) with these lines and it works like a charm.

When on any bracket press Meta] (often this will be Alt]) and there you go to the other paired bracket.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .