Hello Kate, goodbye vi - gHacks Tech News

Hello Kate, goodbye vi

In my last article I introduced you to Gedit (see "Gedit: No more text-based editor for you!") and, as promised, this time around we will examine the KDE equivalent...Kate. Kate is an interesting beast in that it is comprised of two parts: KatePart (which is the underlying editor that is also used in other KDE components that require an editor) and Kate (the actual text editor). Kate is a complete rewrite of the older kwrite. And, like Gedit, Kate offers a number of outstanding features. In this article I will introduce you to Kate.

Features

For a simple text editor, Kate packs in a lot of features:

  • MDI, window splitting, and window tabbing.
  • Spell check.
  • CR/CRLF/LF newline support.
  • Encoding support.
  • Encoding conversion.
  • Regular expression find/replace support.
  • Syntax highlighting and bracket matching.
  • Code and text folding.
  • Infinite undo/redo.
  • Block selection.
  • Auto indentation.
  • Auto completion.
  • Shell integration.
  • Numerous protocol support (http, ftp, ssh, webdav etc.).
  • Internet transparency.
  • Plugin support.
  • Customizable shortcuts.
  • Integrated command line.
  • Scriptable (JavaScript).

That's no short list for a simple text editor. But how does it stand up to other such tools? Is it the text editor you've been looking for?

Main window

Figure 1

When you open up Kate (click Accessories > Kate) you will see a two-paned window (see Figure 1). The left pane serves as a "tab navigation". Instead of files opening in tabs, as they do in Gedit, they open up in a list on the left pane. In order to switch between open files you simply have to click on the name listed in the left pane to go back to that particular file.

One nifty feature of Kate is session saving. Say you have numerous files open for a project and you need to stop working on the for a bit of time. You can save that session and then, when you're ready to start working again, open that session back up. When you open the session up it will have retained all of the open files for you so you don't have to go back and open them one at a time.

To do this all you have to do is click Sessions > Save and then give your session a name. To open a session click Sessions > Quick Open and then select your session.

Highlighting

Figure 2

And of course, Kate does Syntax highlighting. Figure 1 shows how Kate highlights the same script I illustrated with Gedit. You can easily change the syntax highlight style by clicking Tools > Highlighting and then select the type you want. The type show is Bash.

Embedded terminal

Figure 3

What would a Linux editor be without a terminal included? Well, Kate sure thinks they would be worthless, because she has one built in. If you click on the Terminal button at the bottom of the window you will open the terminal window (see Figure 3) which is a full featured terminal. Just for fun, I opened up the same script in the terminal for you to compare.

Final thoughts

Kate is a very powerful editor that can do handle just about anything any other editor can. give Kate a try, it just might turn out to be one long-term relationship.





  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. Bob Smith said on April 30, 2010 at 6:32 pm
      Reply

      I there something like jarter with tabs?

      1. WindPower said on April 30, 2010 at 9:02 pm
        Reply

        Kate has a tab bar plugin, if that’s what you’re asking.

    2. Bob Smith said on April 30, 2010 at 6:32 pm
      Reply

      I meant jarte

    3. WindPower said on April 30, 2010 at 9:03 pm
      Reply

      Kate also has a vi input mode so you can use it as if it were vi.

    4. lefty.crupps said on April 30, 2010 at 9:17 pm
      Reply

      Kate and KWrite are two separate apps. They were different apps in KDE3 series, and are still different apps in the KDE4 series. They both rock, however.

    5. firma rehberi said on May 1, 2010 at 12:43 am
      Reply

      The Kate project develops two main products: KatePart, the advanced editor component which is used in numerous KDE applications requiring a text editing component, and Kate, a MDI text editor application. In addition, we provide KWrite, a simple SDI editor shell which allows the user to select his/her favourite editor component.

    6. Simon Moon said on May 1, 2010 at 1:24 am
      Reply

      You should have said goodbye to vi a long time ago (as well as the rest of them) and hello to Vim and GVim.

    7. Michael said on May 2, 2010 at 5:07 am
      Reply

      This series of articles seems about 10 years old, back when most of these projects started they might’ve needed some introduction. I imagine most casual users don’t even know what vi is and certainly haven’t been forced to use it (most non-casual users seem to confuse it with vim anyway).

      I’m probably in a shrinking minority in that I still use vi(m) for quick edits and prefer emacs for programming.

    8. Tsiolkovsky said on May 3, 2010 at 2:13 am
      Reply

      Kate is an absolutely wonderful little and powerful editor.. I use it for most of the quick edits I do and even smaller programming jobs. When I need something more advanced for programming I still use Emacs. But lately I’m falling in love with KDevelop. Version KDevelop 4.0 has just been released a few days ago and it has wonderfull support for C++ code navigation and semantic syntax checking. And it’s editor part is also based on KatePart, So it looks like soon I may use Kate for everything.

    9. Caleb Cushing ( xenoterracide ) said on May 4, 2010 at 1:49 am
      Reply

      You mention goodbye vi but you don’t mention kate’s vi mode?

    10. moishz said on May 4, 2010 at 8:43 pm
      Reply

      What other editors are there around that work in ssh except nano and vi?

    11. George said on May 6, 2010 at 8:47 pm
      Reply

      I use vim in ssh (putty). Kate doesn’t quite make it for me, I’ll stick to (g)vim.

    12. hamile giyim said on November 11, 2011 at 6:33 pm
      Reply

      Thanks for sharing with us. this is such a great information. i have just bookmarked your site and waiting for your next post

    Leave a Reply