Question

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?

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top