3

Kdevelop has separate commands for commenting (ctrl+d) and uncommenting (ctrl+shift+d).

Is there a way of using a single shortcut to toggle both?

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742

2 Answers2

3

In my version of kdevelop / kate (v. 4.6.0 / 3.13.3 using KDE 4.13.3, from Ubuntu 14.04) there are two different entries in Settings / Configure Shortcuts... and they are both located under Kate Part grouping:

  • The first one is spelled 'Toggle comment' and always tries to use the HTML/XML style comments <!-- -->;
  • The second one, spelled 'Toggle Comment' has a context specific behavior, and it is probably what you would like to assign the shortcut to.

Maybe it would be a good idea to request some developers to assign it by default to Ctrl + /, which is somewhat the most used one to the best of my knowledge.

norok2
  • 25,683
  • 4
  • 73
  • 99
1

Yes. Use Settings->Configure Shortcuts and enter comment in the search box.

You will see a line Toggle Comment, which you can assign a keyboard shortcut.

In this same list of results you'll see Comment and Uncomment which you may like to unassign bindings from.

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
  • When I use this "toggle comment" shortcut, my Kdevelop inserts the xml style comment ``, even if I'm working in a C++ file. But the "comment/uncomment" shortcut gives the desired `/* */`. Where can I config this setting? – Neo1989 Jan 14 '15 at 12:26