Better Python Editing in Kate
posted by brian at 03:53 PM
Perhaps this will damage my hacker credibility, but I use KDE's Kate Editor as my development environment. For a while I used KDevelop, but then I realized the only features I was using were Kate's (note to KDevelop developers: having to decide on a location and filename immediately when I hit New File is extremely annoying. Give me an Untitled!)
The included python.xml (the file that tells Kate how to categorize tokens for highlighting) is a bit insufficient for Python programmers: no differentiation of class definitions, function definitions, or decorators. I've added these and some other minor improvements to my own python.xml and packaged it up with a custom color scheme in kate_colors.tar.gz. If you extract this to your home directory, it will replace a few Kate-specific files. Your configuration options will be kept, but I think any custom colors you've set will be replaced (Kate lacks a way to split these up to make sharing easy). If you select "exogen - Dark" as the default schema in Fonts & Colors, your HTML, CSS, JavaScript, and Python files will look pretty:
Of course, you don't have to use the included schema. The enhanced syntax highlighter is the biggest improvement, giving you several more contexts under Text Highlighting Styles.
I shared these changes with Adrian Holovaty at PyCon, who I noticed also uses Kate. I guess he couldn't get used to the high contrast color scheme, but here's hoping the new syntax file is serving him well. ;)
(I also recommend the Tab Bar Extension, the Word Completion Plugin, and learning to use those double arrows in the Filesystem Browser panel.)
Comments
Hey Brian,
Just wanted to drop you a note: the email newsletter I edit is sending out the sucks/rocks link to our New York readership tomorrow morning. It's an invaluable service, and more people should know about it. Thanks,
David Blend
Looks good, but you've neglected to set a colour for highlighted text, making it impossible to see selections. I like #777777 myself.
Also, try Andale Mono 11pt.
Jim: Strange, it looks okay for me, maybe the selection color is stored differently.
I'm a big fan of the Bitstream Vera family, but I'll give Andale a try. :)
Does your Andale Mono have a Bold face? Mine doesn't seem to; I like using that for keywords and definitions and such.
Just thought I'd add in a recommendation for Komodo Edit. Recently released by ActiveState, I think they've done a real nice job if you're just looking for an editor. I've been a fan of the Komodo IDE for a while although its always had its fits and starts. They've now released Edit as a free standalone product and it has great syntax coloring support for all kinds of different language and markup files. They also do a pretty good job with autocomplete/intellisense type features that can save you some keystrokes.
Hello,
I am also using Kate with Python and enjoy it. Do you know if there is a way to have an auto completion as in VS for python language ? It will incredibly useful. And with python introspection features, maybe it will not be difficult to implement such a thing.
In fact I realize that it's a huge task to do a good completion tool. Because this tool must get the type of an object.