Getting Started With the Kate Text Editor: Kate For Coders
In the last two articles (part 1, part 2), I looked at getting started with Kate, and then at some of the more advanced features and configuration options. This final article covers features that you may find useful if you regularly write code or markup.
Syntax highlighting automatically colours different words and lines in your file according to their function. So comments will be shown in a different colour from the main code, quoted strings in a different colour again, and so on. It's incredibly useful if you work with any kind of programming, scripting, or markup language.
Kate's predefined syntax highlighting settings cover the vast majority of programming/scripting languages and markup languages, as well as some configuration file types, diff, LDIF and MySQL, and several assembler types. When you open a file, Kate will attempt to automatically detect and apply the appropriate highlighting setting, or you can apply a setting from the Tools->Highlighting menu.
Just in case your preferred language isn't one of the many provided, you can also define your own syntax highlightings, or if you want to vary the ones that are provided, there's scope for that too. Kate's syntax highlighting rules are XML files containing rules for detecting text, keyword lists, and style definitions: to change the behaviour, edit these files.
The Kate syntax highlighting system aims to use the same colours for the same/similar formats across languages, making them easier for you to understand intuitively. It does this by having a set of default styles (e.g. dsNormal, for normal text, dsComment, and dsError) which are used for these sections of the file. This also makes it easier for you to generate your own styles, should you need to.
If you spend a lot of time typing, it's useful to be able to navigate around a file without having to move your hand to the mouse. Unfortunately, Kate doesn't seem to have any keyboard navigation shortcuts, as far as I could tell, or to support the standard readline ones (e.g. Ctrl-A for beginning of line). Navigation is entirely with arrow keys, and Ctrl-arrow to move a word at a time. This isn't uncommon in graphical text editors, but if you're used to the extensive keyboard navigation options of editors like emacs and vi(m), it can feel a bit clunky.
One nice touch is that using Ctrl + the up/down arrows scrolls the file without moving the insert point – so you can go check a function definition or anything else elsewhere in your file without losing where you're editing.
- 1Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 2Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 3Linux 4.6 Charred Weasel adds USB 3.1 Support
- 4Linux Top 3: OpenIndiana 2016.04, Ubuntu 16.04 and Debian's New Leader
- 5Linux Top 3: KaOS 2016.04, TurnKey 14.1 and pfSense 2.3