Author Topic: How to navigate matching #if and #endif using keyboard shortcut  (Read 9084 times)

KentZo

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
How to navigate matching #if and #endif using keyboard shortcut
« on: September 23, 2010, 02:27:19 am »
Hi:

I was trying to find a keyboard short cut to navigate forward and backward for a matching pair of #if and #endif in C/C++ codes.

I have enabled highlighting of the matching #if and #endif. But this is not enough for me. Because sometimes the matching #if and #endif are too far apart from each other and hence I could not see them at the same time within the screen.And I don't want to use mouse to scroll downward and upward just to find the matchin pair. I need a keybaord shorcut key that can bring me straight to the matching #if/#endif

Btw, I am using Emac emulation keybaord.

Any suggestion will be much appreciated.

Thanks

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: How to navigate matching #if and #endif using keyboard shortcut
« Reply #1 on: September 23, 2010, 08:09:07 am »
The command is 'find-matching-paren'. You should check/customize your keybindings accordingly and you are fine.
HS2

KentZo

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: How to navigate matching #if and #endif using keyboard shortcut
« Reply #2 on: October 01, 2010, 06:30:18 am »
ok...thanks for you info. It default to Ctrl+].