Written by Steve Lake Posted on: 05.02.2007 at 11:00am Section: Tutorials
One of the more overlooked, but very useful features of KDE is its text editors. In a full standard install of KDE there are 3 of them. Kate, Kedit, and Kwrite. Each has its advantages, disadvantages, and general uses. Let's look at each of these and what each one offers the end user in terms of features, usability, and functionality. Kate
Kate is somewhat of the all in one "Swiss army knife" of basic text editors. It's got a little bit of everything for everyone that you'd need in a basic text editing interface. The next step up is to go directly to a full blown word processor. There really is a fascinating number of things you can do with Kate, not the least of which is to use it to do basic perl and php coding. A lot of people wouldn't ever consider using it for such a thing as that, mostly because they consider vi or some other editing interface to be superior to a graphical text editor. I used to think the same thing, but after a few days in Kedit, that all changed. But since we're focusing on Kate right now, we'll go over Kedit later in this overview. For now, let's look at what advantages Kate can offer you in a variety of areas, including coding.
The first thing you're greeted with when you open the program is a session chooser. It's a rather uninformative screen that really doesn't explain what it's asking. The "session" in Kate essentially is a snapshot of where you were, what you were doing, what files you had open, and saves them as a session where you can reopen them again at a later date, all with one click, and immediately get to work. Once inside you're greeted with an interface something similar to this: In the example picture above I've opened three documents just to show you what the left side window is for. Essentially what Kate does is it stores all of your open documents in a long list on the left side that tells you if a file is open, has been saved, needs to be saved, its name, and even if it's the active one you're working on. The advantage of this is that Kate allows you to have up to 100 different documents and files open at the same time (I suspect it can do more, but I only dared go up to 100) all in the same window. So you only need to keep track of one window on your desktop, rather than separate windows for each open document. While this can be a blessing for those desiring a clutter free desktop, it may present some issues for some people who prefer to keep each file in a separate window. It could also cause issues for you later on should you want to separate out the documents onto different desktops. To do that you'd need to have separate copies of Kate open on different desktops with each of the different files you need on each desktop, effectively killing one of the benefits of Kate, that being it's "all in one" interface and all the benefits that go along with that. Another thing that makes Kate so appealing is its file system browser. With it you can browse over to any directory on your machine and open a file all without having to click the open dialog. This works well in large directories full of many files you need access to. The tab is available on the left side of the open file window. As you see in the example I've got a directory full of work files. Even though it took me a couple clicks to get there, once I'm in it's only a matter of double clicking each file to open them, or single clicking the black X on the toolbar to close them. You can also "bookmark" that directory, allowing you to instantly browse to it with two quick clicks of your mouse, regardless of where that directory is on your machine. Once you're done, you simply switch back to the "documents" tab on the left and you can then see the list of all the files you currently have open. So some might ask, "alright, so how does this help me with my coding?" The answer to that would be simple. Color coding. Now that might not sound like much, but you'd be amazed at how much easier your coding becomes when all the sections of your code are broken down by color. Subs are one color, variables another, commands another, etc. The above image should give you a general idea of how that's laid out color wise. It allows you to "at a glance" determine what you're looking at and how it relates to your code. It makes finding and debugging, and even raw coding a lot easier than if they weren't color coded. Another thing that can be a blessing or a bane (depending on your preferences) is the word wrap function. And your word wrap can be static or dynamic, or you can turn it completely off. The advantages behind turning it off are most evident when you're coding. I prefer to have it off simply because it allows me to see the code exactly as it exists line upon line in the file itself. Few other text editors do this much in such a small and compact program. But Kate definitely does. It's got a complete cut, copy, paste and basic editing package, a simple export feature (export to HTML or an email), view settings, a long list of tools and a number of other user configurable options that will speed your user experience. Kate also has two other unique features you wouldn't expect in a text editor. It's got a file finder and a built in terminal program. Yes, it's got terminal access built in. That takes some getting used to, but you can run a variety of console commands right from Kate on the fly whenever you need to. It's quite handy for a variety of different things. While Kate isn't my preferred text editor in KDE, it's definitely got a lot to offer everyone. One word of warning though. The way it handles text navigation within the document is a bit weird, so be aware of that. It may suit you just fine once you try it, but it felt clumsy to me. Kedit
In the world of simple text editors, Kedit is about a simple as you can get. Similar in many ways to windows Notepad, it carries the utter simplicity of a basic text editor, with a few extra tools to help you along that Notepad doesn't have. While it's focus is on utter simplicity, it lacks a few things that I find very useful. The extra features do not take away from Kedit's utter simplicity in any way. In fact, their absence is welcome in a way, allowing the simplicity of the program to be maintained. In fact, if you haven't figured it out by now, Kedit was written specifically with that one thing in mind. Simplicity. It's so simple to use that I use it daily for a lot of my note taking because the program goes out of its way NOT to get in my way while doing anything. However, this can have a big disadvantage. For one, it does not color code anything. So using it for coding is not advisable. However, for handling text only documents, config files, or a variety of other things that require a very basic text editor that doesn't add any extra overhead characters, this one is definitely a good choice. Be careful though, because it doesn't like special characters that are non-ascii. But standard ascii characters are handled perfectly. It also comes complete with its own spell check, so that's a bonus for anyone who has a bad habit of fat fingering often or even misspelling a lot of words by accident. Kwrite
And as to be expected, I've saved the best for last. And with that, I introduce Kwrite, which is, in my humble opinion, the best of the three editors. It's text navigation is astounding, its extra features are very good, and it provides you with the best of Kate and the best of Kedit all without many of the disadvantages of either of the other two. I use Kwrite exclusively for my php, mysql, perl and other coding projects simply because it's utterly perfect for that. It's also good for regular text editing and surprisingly it works beautifully over a remote connection. I can remotely open a file on another machine over the network, edit it on my machine, and save it back to the remote machine all with a simple set of keystrokes. Kwrite also includes the ability to color code program code from nearly any common language out there, including PHP, Perl, HTML, XML and many others. If they can be edited in a text editor, Kwrite can handle them and color codes them appropriately. Formatting and text navigation are also much easier and cleaner in Kwrite. It also uses a much more readable default font (this is changeable if you want to use a different default font) that is much easier on the eyes and makes it much easier to use over longer periods of time. I even used it to write this entire site from scratch, and it was used during the debugging period and during the writing of a number of articles too. It's just light weight enough to not get in your way, but feature rich enough to make your work easier. Another thing I really like about it is the infinite undo/redo buttons. While Kedit and Kate have those too, they're much easier to use under Kwrite (in my personal opinion of course, your results may vary). I have found it to be the most comfortable of the three editors to use, period. Conclusion In this quick overview I've covered the three basic text editors in KDE, the strengths and weaknesses of each, and some of the best uses for them. Knowing about, and using these editors will be of important benefit both to new users of KDE who are switching from other OS's (especially windows) to any OS using KDE as its window manager. While these are likely to change over the coming years, I see them as the backbone of simplified text editing in KDE for the foreseeable future. Their versatility and flexibility, combined with their general simplicity, makes them a tool you should never do without. On some newer versions of KDE they've moved from a prominent position in the KDE menu down to the system menu, but they are not gone. So if you can't find them initially in your KDE menu (they're located below the edutainment and/or development menus in the KDE menu in some distributions) keep hunting, because they're still there, just in a slightly different place. While I can recommend one particular editor out of the three (Kwrite in this case), the ultimate choice is up to you. Find the one that works best for you and stick with it. Or just be creative and rotate between the three to keep things fresh. :) |