• Kate Modeline Editor

    by  • 2011-07-23 • Developers, Users • 9 Comments

    As you may know, Kate supports the concept of document variables, also known as modelines. In short, document variables can be used to set Kate settings local to a file. For instance, this is useful for settings specific indenter options than the ones defined in Kate’s settings dialog. Assume you work on two projects, the first indents with spaces and the second with tabs, then you can simply add a modeline that contains the specific document variables that set the specific indentation properties.

    While the concept is very mighty, it is not intuitive to use: You have to know the exact syntax and correct varialbes and their valid values.

    To improve this for the next KDE release (v4.8?), Kate gained a variable / modeline editor this week:

    If you click the Edit button, a list view pops up showing all valid document variables with the valid values. Right now, this editor is included only in the “Modes & Filetypes” config page. However, the idea is to support it in the context menu over a Kate modeline in the text editor area as well.

    About

    Dominik is a PhD student at the Control Theory and Robotics Lab, TU Darmstadt, as part of the Research Training Group GKMM (GRK1362). My research focuses on state estimation in distributed systems. As hobby, I contribute to the KDE project and work on the Kate application and editor component.

    http://www.kate-editor.org

    9 Responses to Kate Modeline Editor

    1. STiAT
      2011-07-24 at 14:00

      Wow, that looks nice. I wished a lot of configuration dialogs had their options for configuring text, ident and similar like this.

    2. 2011-07-24 at 15:30

      Supreme work, I hope this helps more people to understand the possibilities hidden in the Kate modelines ;)

    3. Eike Hein
      2011-07-24 at 18:36

      That popup desparately needs a proper alpha mask, though :) . Have a look at the code behind KDevelop’s outline popup.

    4. mensoif
      2011-07-25 at 10:01

      Great news, as you are working with modeline could you please have a look at https://bugs.kde.org/show_bug.cgi?id=125974 , a fix seems to exist https://svn.reviewboard.kde.org/r/1915/ but it has not been applied.

    5. Francesco R.
      2011-07-25 at 11:33

      nice, very nice

    6. Peter
      2011-07-25 at 18:31

      as you talk about modelines: there exists a very annoying bug since many years in kate (encoding settings do not work)

      https://bugs.kde.org/show_bug.cgi?id=125974

      • 2011-07-25 at 22:23

        I leave that one for Christoph.

    7. 2011-07-30 at 16:55

      Great news! And there’s even a specification of mode-line variables now (been looking for this for a long time): https://projects.kde.org/projects/kde/kdebase/kate/repository/revisions/b3eb57233bd3504415167669e02c75c92841a98b/entry/part/variableeditor/variablelineedit.cpp

    Leave a Reply

    Your email address will not be published. Required fields are marked *


    *