20

Finally! A decent text editor for Linux with Windows key bindings.

Posted May 3rd, 2007 in Linux by Damian

I’ve been using Linux for more than 7 years now. The main thing I do on Linux is text editing. Editing configuration files, source files, html files and what not. Initially I used Midnight Commander’s built-in editor (as probably many of you coming from windowed systems). As I became more experienced and geeky I moved to one of the ‘holy editors’: Vim. Vim is an excellent editor with unlimited possibilities but unfortunately mastering it takes unlimited time as well. I used Vim for several years before realising that all this complexity and a user interface from the 70s were not for me anymore. I needed simplicity. I needed something with Ctrl-C, Ctrl-V for clipboard and Ctrl-F for find. I decided to look for another editor.

Here’s what I was looking for:

  • as many windows-like (CUA) key bindings as possible. At least Ctrl-C, Ctrl-V.
  • syntax coloring
  • basic editing functions like search&replace
  • needs to work on a VT as well as a console without rebinding keys
  • minimum configuration

These features are not particularly demanding, are they? Well, I tried at least a dozen various editors and couldn’t find any that would meet these requirements. Not until I stumbled upon Diakonos.

Diakonos is a simple programmer’s editor for the Linux console that I find almost ideal. It’s open-source, it has all I need and it works out of the box. I’m not going into details (you can read about its features on the homepage), just a screenshot and a list of pros and cons.

Pros:

  • very windows-like key bindings (all that I use, I didn’t rebind a single key!)
  • no configuration needed (although you can configure it pretty extensively if you want to)
  • works on a VT as well as console without reconfiguring putty, .inputrc or anything
  • has all the features you would expect in a basic programmers editor (regexps, etc)

Cons:

  • It’s slow. It is really slow when compared to any other editor (even Emacs). It’s written in Ruby, which is an interpreted language. I’m not sure if it is for Ruby or the author’s laziness but I don’t really care. It works sufficiently fast on my hardware. It saves a lot of my time which is more valuable to me than cpu cycles.
  • Syntax coloring has some problems. I think it has something to do with switching contexts. When editing a PHP file with HTML in it, the coloring sometimes gets funny. Well that’s not a major drawback for me too.

To summarise. If you’re frustrated with complexity of Vim and Emacs, try Diakonos.

20 Responses so far.

  1. kuzux says:

    try kate.i use it and it’s pretty fast.c++ ftw!! :p
    http://www.kate-editor.org/

    • John Bowling says:

      I used kate for years back in KDE 3.x days. It now has problems with
      KDE 4.x. The spelling check wants to correct numbers that are in digit
      form. It also can no longer highlight (and ignore in the spelling
      checker) keywords with any programming language.

      So it’s now useless!

      Also, the windows-like key bindings that were referred to and not
      windows. They are origionally from the Mac definitions which Apple
      published back before MS had any windowing software. And when they did
      they copied and with their typical MS ‘invented here’ screwed up several
      of them.

  2. kuzux, I gave up using Linux on my desktop some time ago so Kate is not an option for me. I needed a console-only editor for editing stuff using putty.

  3. LimitedMage says:

    Try nano, a really easy to use console editor. It’s installed by default on all distros, I think, and it’s fast as hell.

  4. LimitedMage, speed and availability were not my primary concerns. Windows-like key bindings were. Nano may be fast but you can’t change its key bindings.

  5. Pistos says:

    Hi, Damian. Thank you for the positive review of Diakonos! :) I’m glad you were pleased by my “it just works” approach to designing and developing Diakonos. Indeed, my experiences with emacs and vi were frustrating, so I decided to take a stab at rolling my own editor.

    I’ll be the first to confess that Diakonos is not fast [yet]. I will take 95% of the blame for that, and leave 5% for Ruby and other things. There are various algorithms and internal process approaches which could stand for refactoring. See this wiki page for tips on how to speed Diakonos up, though: http://wiki.purepistos.net/doku.php?id=Diakonos:Tips-and-Tricks:Speeding-Up-Diakonos

    The multi-lingual syntax highlighting is a known issue. As a workaround, you can temporarily change the highlight language of the whole file with Alt-Shift-T. Change to ‘php’ or ‘java’ (for Javascript) when those are your embedded languages. Also, try playing with larger values for the view.lookback setting. This will make more demands on your hardware, but it may solve the highlighting problem in more cases than not.

    If you have any feature requests or anything, feel free to drop me a line, either in IRC (chat.freenode.net #mathetes; or http://chat.purepistos.net ) or by e-mail at the e-mail address I used here on your blog. User interest and feedback always motivates me, and I value user feedback.

    Thanks again for trying and using Diakonos!

  6. Alex says:

    I think Minimum Profit 5 (mp-5) is better.
    It has all the windows keys bindings (ctrl-o, ctrl-s, ctrl-c, ctrl-v …) it pretty fast, scriptable, and work with GTK and also with Ncursesw (console based).

    home page: http://www.triptico.com/software/mp.html

  7. Maarten says:

    if you use windows but still like to use kate, gedit, geany or some other graphical linux editor, just install XmingW , a free X window manager for windows. If you then log in using PuTTY,a nd check ‘ enable X forwarding’ option (same as using ssh -X ), you can start GUI-enabled programs from the putty console and they’ll show up as application windows in your MS WIndows session.

  8. john j. says:

    > Finally!

    Finally? Have a look at sue right here

    http://ibiblio.org/pub/linux/apps/editors/

    Windows keybindings in the text console, quick and a few years older than Diakonos.

  9. Leo says:

    Sorry, but I don’t understand you, since I started with vim (few years ago) I’m looking for graphical IDE with vim keybindings. Why are you trying to go back to M$ Windows style?

  10. Shaunak De says:

    I use Bluefish [http://bluefish.openoffice.nl/]
    Its geared towards web development.

  11. Greg Laden says:

    Well, it doesn’t wrap text out of the box. That puts it in the same category as emacs: Very mid 20th century.

  12. Vim Tip says:

    just thought you might like to know, that vim does actually support windows keybindings. There should be an mswin.vim file on your system, which you can load to get ctrl-x, ctrl-v etc. You may just owe me a White Russian

  13. kievite says:

    FTE is another good Windows key binding editor for Linux.

    http://fte.sourceforge.net/

    Very caoble

    Syntax highlighting and syntax-aware autoindent for many languages / file formats, including C(++), Java, Perl, Sh, Pascal, SQL, Assembly, PHP, Python, REXX, Ada, Fortran, IDL, LinuxDoc, TeX, TeXInfo, HTML, diffs, emails and makefiles
    User-definable syntax highlighting using a configurable state machine
    Parenthesis matching
    Parsing of compiler output (jump to file/line of error, jump to prev/next error)
    Parsing of “grep” output (jump to file/line of match)
    Simple handling of several open files / directory views
    Several variations of the “copy’n'paste” mechanism (including “Copy-Append”, “Paste column”, “Paste line”
    Many Line transformation operations (split, join, center, toupper, tolower, togglecase, rot13, delete-to-end, …)
    An ASCII table (“insert this funny char”)
    Many block selection operations (mark stream/rectangle/line(s), insert stream/rectangle/line(s) from file, write selection to file, print selection)
    Operations on selections (toupper, tolower, rot13, user defined translates, indent entire block, sort, …)
    Several navigation operations (search string, bookmark stack, goto line, goto matching parenthesis, go to next/prev similar word, …)
    Search and replace optionally using regular expressions
    Folds, including “create by regexp”, “create by routines”, nested folds
    Interfacing to compiler/make, grep, shell, ispell
    Routine/Function list for several languages
    … Many more

  14. Brian says:

    Sorry, even Kate doesn’t cut it. I should know– I’ve been using it as my text editor for months now. It’s been wonderful.

    But right now, I’m fighting with it because it can’t remember my settings for tabs. I’ve had this problem with it before. I hoped they would have fixed it by now, but it looks like the developers have better things to do.

    They’re probably hamming it up with the gedit people that can’t fix the bug where pasting, every now and then, pastes into some obscure area a page or two away from the cursor. And you think, oh, that’s weird, and you paste again and it works, and you don’t find out about the other area until it’s time to compile, and you have to repair the damage your f’ing TEXT EDITOR caused.

    HOW HARD IS THIS, PEOPLE?

    • John Bowling says:

      I have used kate for years, and now find that is just another piece of
      the crap that is KDE 4.x.

      It does not highlight any language’s syntax, and wants to correct them
      when doing spelling checking. It also wants to correct digit numbers
      with the spelling checker.

  15. Aneesh says:

    Marteen,
    Thanks for the tip. I installed xming and now I can export the display to my Windows host and use any GUI based text editors. I tried gEdit, Diakonos, nedit and finally settled with Geany. I liked Geany very much. The key mappings are completely customizable. Also the built in tag support and console are very handy for my work.

  16. confusious says:

    I’ll try this for console. I’ve been using vi for years (because it’s on all *nix systems), but I find the dual mode text/command entry very tiresome in practice. Vim is so much better (anyone still using old vi should install vim right away, there is no reason cursor keys should screw up text entry). Still, I’ve always wanted a more sane editor, I will try diakonos since it is in my repository.

    For graphical editor, I highly recommend medit – I’ve completely replaced gedit with medit and it does everyone I want. Gedit word navigation and find/replace bugs are a thing of the past now. Syntax highlighting is great too.

  17. Marcus Rhodes says:

    I know this is old, but I just found it.

    nano’s syntax highlighting and keybindings are highly configurable.

    I used a little-known (these days) language called, Pick, or DataBasic, so I always have to create my own syntax-highlighting profiles for whatever editor I’m using, if supported, and nano proved to fit my needs. But, it’s standard keybindings were anything but industry standard. A little googling quickly turned up both the solution to my problem, but yours, as well.

    For syntax highlighting, just create a lang.nanorc file for your particular needs in the same folder as the other .nanorc files, using them as a guide to configure your own, then add it to /etc/nanorc, which also contains the keybindings, details of which can be found on-line or in the man pages.

Leave a Reply