Announcement

Collapse
No announcement yet.

c++ mode for kate?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    c++ mode for kate?

    I have chosen C-style under indention rules in kate in Kubuntu 7.10. But when I type:

    int main () {


    followed by return and type something I get:

    int main () {
    int a;

    ...
    ...


    Instead of (automatic indention)


    int main () {
    int a;

    ...
    ...


    Is there some better c++ mode for kate that actually make automatic indention?

    I would also be nice it it automatically created the closing bracket:

    int main() {

    } // automatically inserted!



    #2
    Re: c++ mode for kate?

    Also select C++ highlighting then it will all work together. If you save the file as a .cpp file, the indentation and highlighting should automatically take affect.
    Richard Johnson (nixternal)<br />Core Developer :: MOTU :: MOTU Council :: Community Council<br />https://launchpad.net/~nixternal<br />http://www.nixternal.com

    Comment


      #3
      Re: c++ mode for kate?

      Awesome!!!

      I just messed around with Kate, following your post, and found its more powerful than I'd even previously imagined

      You can have it automatically insert ending brackets by going to "Settings -> Configure Kate -> Editor -> Editing -> Auto brackets" (The auto indent feature doesn't seem to work properly with this enabled, though :P ).
      Asus G1S-X3:
      Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

      Comment


        #4
        Re: c++ mode for kate?

        As nixternal said, you have to first save the file as a C++ file before auto-indentation to work. You can, however, manually choose an indentation style before saving a file or override the current one by picking the one you want in Tools -> Indentation.

        If you do a lot of C++ typing in Kate, you can choose the default indentation style to be used at all times, in Settings -> Configure Kate -> Editor -> Indentation. I use the C Style by default myself.
        Jucato&#39;s Data Core

        Comment


          #5
          Re: c++ mode for kate?

          Yes now it works! But as the previous poster said it does not work when enabling auto brackets. But its a step in the right direction.

          Comment

          Working...
          X