Getting Started With the Kate Text Editor: Kate For Coders - page 2
One very useful function is the comment/uncomment feature. Select the text you want to comment out with the cursor, hit Ctrl-D, and Kate will automatically comment that text out using whatever form of comment is appropriate for the automatically-detected type of file. (If Kate can't tell what type of file this is, or doesn't have a comment type defined for this file, the function doesn't operate.) Select it again and hit Ctrl-Shift-D, and it's uncommented again. Very useful when debugging!
There's an automatic indent function, but its styles are limited. It's turned off by default; turn it on either from the Tools menu, or from the command line with indent STRING (options are "none", "normal", "cstyle", "csands", "python", "xml", and "variable"). Normal indenting will maintain the indent of the previous line whenever you hit return or a line wraps onto the next line (and will indicate the latter case with a crossed-out highlight.
There's also automatic indenting for C and a couple of other languages, but not for Perl or HTML. So Kate won't, for example, automatically reduce the indentation one level when it sees , as some editors are able to. It does, however, indent back a level when it sees }, even in 'normal' indent style.
You can turn on automatic bracket insertion with the auto-brackets: true setting from the command line (or as a document variable – see previous article).
Finally, there's code folding. This feature looks for certain sections of code, and shows a folding marker beside them. If you click the folding marker, this section of code will be temporarily hidden. This can be useful when looking through large sections of code, as it can help you get a grasp of the overall structure. This is only available in some formats. You can also manually define foldable regions – this is done in the highlight definition files, so if Kate doesn't support code folding for your preferred language, you can add it yourself.
Finally, there are a few external tools available via the Tools -> External Tools menu. The provided tools are to run the script you're currently editing (in an external terminal, unfortunately, rather than in the Terminal section of Kate), and to email a CVS diff of the file you're editing. You can also write your own external tools, so you're limited only by your own scripting ability! Similarly, as discussed in the last article, Kate offers a variety of plugins, but you can also write your own.
If you're already a power user of one of the popular terminal-based text editors like emacs or vim, you'll probably find Kate a little limited. However, if what you want is an easy-to-use graphical text editor with some powerful and useful functions both for plaintext and for code, give Kate a try.
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: RHEL 6.7, BackBox Linux 4.3 and RoboLinux 8.1
- 2Linux Top 3: SLES 11 SP4, Chromixium OS 1.5 and Canonical Licensing
- 3Linux Top 3: VirtualBox 5, Point Linux 3.0 and OpenSUSE Leap 42.x
- 4Linux Top 3: Linux 4.2 rc1, 4MLinux 13 and antiX15
- 5Linux Top 3: Linux Mint Rafaela, OpenMandriva Lx 2014.2 and VectorLinux 7.1