Software

The simple things I want in a text editor

A good text editor is the most important tool for me. My favourite text editor, Kate is unfortunately broken after upgrading from Kubuntu 12.04 to 16.04 (several things simply don’t work anymore). I’ve often looked for other text editors, I needed one recently on Mac, but I’m always disappointed by what I find. Here I present some of the key features I want in a text editor.

I use my text editor for programming, writing these articles, and the source for various websites. I’ve previously found Kate to be a great text editor; it’s just unfortunate that recurring defects keep breaking it.

Unicode and proportional fonts

I live in the modern age and need support for the full range of Unicode characters. I need an editor that has proper font support, letting me use whatever characters I want.

This includes supporting proportionally spaced fonts. Mono-spaced fonts are an anachronism as far as I’m concerned; text is easier to read when it’s spaced properly. This is certainly true for my text heavy documents, like this article, but I also prefer to code this way. Spacing became even more important as Unicode became popular: there are simply too many characters that don’t fit well in a mono-spaced font.

I need loading and saving to recognize and use UTF-8.

Basic indentation support and no auto-typing nonsense

For programming I want the editor to maintain my indent position. I press “enter” and it goes to the next line on the indentation level I’m currently on. I don’t want the editor to modify the current line, add new indents, or do any of this annoying behaviour that so many editors love to do now.

Basic block indentation features are expected, possibly with a feature to reindent code on pasting. I would also love to have an indent aware copy: if I copy an indented block all the common indentation is stripped. Currently I use Kate’s block selection mode to do this.

I expect tab to be supported as the indentation mode, with an option to change the visual size of the indent. I think I’ve made my reasons clear before.

I don’t expect any of this to be the “default” in the program. I’m okay with having to go into the preferences and switch some settings. It’s important that I can apply this to all document types though; I dislike editors where every file extension invokes a completely different editing mode.

Extended syntax highlighting

I want my syntax highlighting to be detailed enough to at least distinguish between symbols, operators, and brackets while programming. I’d prefer an editor err on the side of too many categories than too few. If I don’t want to distinguish some categories I can make them the same color.

I want it to be easy to add custom syntax highlighting. I find myself working with my own languages, like Leaf, or markup often, or on projects with custom code. I need a way to highlight these files.

As a nice bonus I’d like a way to copy code with the syntax highlighting. This means I can paste it in email exactly as I see it. In Kate I use the export to HTML feature and copy from the browser — a bit of an indirect approach.

Integrated search and replace

I search through code often while programming. I need to have a decent integrated search and replace tool. It doesn’t need to support a lot, a simple search and regular expression matching. Kate’s current tool is good enough (were it not for never saving any of the settings).

Miscellaneous

Text snippets – There are some characters that don’t exist on the keyboard; I like to create keyboard shortcuts to enter them.

Spell checking – I write a lot of articles in my text editor. Having an integrated spell checker helps me out. If it can distinguish syntax that’s great, but otherwise I can simply filter on my own: just underline, or otherwise highlight, words that look wrong.

Two window layout – I find the best use of my monitor’s HD ratio is to have two text editor windows opened side-by-side. It’s additionally convenient if I can minimize just one of them (to look at a console behind it). I expect the two windows to share open documents (some editors seem to open an entirely new instance instead).

Quick document switch – A quick way to switch between open documents, using just the keyboard, is a nice feature in Kate. Tabs along the top don’t help me since I have too many documents open to see them all, nor can I easily switch to a specific file using the keyboard.

Word wrap – Mainly when I write articles I like to have text naturally wrap at the width of the window. For code I usually turn this off, though lately have been leaving it on.

Cross-platform, or Linux – Something that works on Linux, Mac, and Windows, would be nice, but I’d be happy if it just works on my primary platform Linux.

Line bookmarking – A way to mark a line and then quickly skip between them. I usually use this while debugging or refactoring code.

Keep lines in view – A relatively minor feature, but I want the scrolling to keep X lines in view rather than letting the cursor reach the absolute top/bottom of the view.

Any contenders

If you know of an editor that can do all of this then please tell me. I’d be happy if the errors were fixed in Kate, but I’ll be looking around in the meantime.

39 replies »

  1. I personally use Sublime Text. It’s multi-platform so I get the same environment whether I’m home or at work, you can tweak pretty much everything very easily and if there’s something missing, I can pretty get it from the Package Control. It doesn’t get much time to get used to, and can also be used as a simple text editor (I use it for translation as well, for example).

    The only thing I hate about it is that it doesn’t let you write Japanese directly from the IME (it allows copy-paste, though). I didn’t really look into it, maybe I’m doing something wrong. But as a worker in a japanese company, it can get annoying from time to time.

    • I just tried Sublime Text. Great look’n’feel, lots of options, gentle on resources, sophisticated searching engine. I immediately felt in love with it. And then after some 10 minutes of playing around I discovered that it did not understand SQL quotes and escape characters. When you have a string in your SQL code with a backslash in it, the whole syntax highlighting goes bananas. Well, not too good as for a premium product…

    • Could you give me an example of query? If I understand correctly, you tried something like that: SELECT * FROM TEST WHERE A = ‘HEL\’O\’O’; I don’t have any syntax highlighting problem with that.

    • Well, try to concatenate two string variables with a backslash between them: SELECT @varA + ‘\’ + @varB

    • Indeed it breaks. Although it doesn’t seem to be a standard SQL feature.

    • Are you suggesting that concatenating strings is not a standard SQL feature? Just checking…

    • I meant, declaring a “@ variable” and using that inside a SELECT. It looks like MS-SQL stuff from the results I get back from Google. But I could be completely wrong.

    • Ah, right. I get narrow-minded occasionally. Of course this is syntax specific to MSSQL, my main working environment. But SELECT ‘ABC’ + ‘\’ + ‘DEF’ FROM DUAL should work in Oracle as well and would also cause an issue with syntax highlighting in Sublime. Btw I use native apps for editing SQL code, enriched with 3rd party plugins (SSMS + RedGate SQL Prompt + ApexSQL suite) but every now and then I need to use a plain text file editor and my choice for the moment is Notepad++.

    • I use Sublime on OSX. It seems like an okay editor, but the price tag is quite hefty compared to its feature set. The lack of preferences dialogs (I couldn’t find any) is quite troublesome. I don’t like digging through docs to figure out what config file entry I must set to modify basic settings. For example, I don’t see a way to keep 5 lines in view at the top/bottom of a document, but maybe the feature is there and I just don’t know the name. I also have no idea how to modify the editor colors: it’s quite nasty if I have to do this without a preview and color picker.

      It’s support for Fonts does however seem nice (once I figured out how to use another font).

    • I have to admit, the preferences dialog would be a needed feature. For the colors, there are some packages that do that but it’s true they should just make that standard. I never thought of that, I use the default colors…

  2. You should take a look at Atom (open-source text editor by GitHub)
    https://atom.io/

    fully customizable and cross-platform.
    I used to work with vi and emacs, but i’m force to work with windows 10 now…
    so i looked for something open source (not like Sublim Text, who’s amazing but close)
    and i found Atom.
    Hope that can help (and sry for my english)

    • I’ve looked at Atom before. I don’t recall how the fonts worked, I think they were okay. Lot’s of potential…

      …but it suffered from a very complex configuration system. It’s also one of those that treats all file extensions as fundamentally different files, so I had no option to make global configuration.

    • What do you mean by global configuration?
      ctrl+, should give you the basic global settings
      Atom rly improved this yeah, maybe you should take a look again see if it’s now better for you.
      But, yeah, if you really want to improved some atom use, you need to “hask” it (i mean not using GUI but some conf files.

    • When I tried atom it seemed that every file type I opened would invoke a different set of settings. I had no way to configure how indenting worked for all files. Obviously I like being able to modify some things on a per-type basis, but I need the basics of editing to be consistent.

    • Well, i work with atom for 6 months now, and i don’t these differents set of settings (well i could but i’m not using it)
      Maybe you should try the last version, i think it’s worth the hour needed to try it.

  3. With some plugins all you want can be achieved with Vim, GVim and/or Neovim.

    I use Vim for writing code, blogs and papers in various languages and on various machines.

    • VIM (and it’s variants) do not support proportionally spaced fonts. Sure, you can select a proportional font, but it sticks it fixed sized cells anyways.

      I also don’t like the editting modes system used by vim. With a decent keyboard, mouse, and windowing interface, I don’t think the modes system is required anymore.

      I should note that VIM is nonetheless my editor of choice in the console or over a SSH connection.

    • Some people will defend editing modes at all cost ;) It is matter of being used to certain things.

    • If editing modes are what make you productive, then by all means use them. I don’t want to take them away from you (some editors, like Kate, even offer a Vim-interface for people that like modes). They just aren’t for me however.

    • Oh, I wasn’t referring to myself. I come from Windows world so I would probably chop my arm off with a chisel rather than used vi again.

      On another topic, I am just giving Kate a try. Looks ugly but the functionality is promising, plus it recognizes all my SQL scripts correctly. We’ll see.

    • Kate, like all KDE apps, blends into the KDE desktop well. If you aren’t using that I have no idea where it’s appearance comes from, and is likely quite jarring (like when I used it on OSX).

      If they can’t get the rendering defect bug fixed though I’ll really need to find something else. Komodo so far is the best contender.

  4. Why not give Emacs a shot? Requires a bit of work to learn, but then you will not need anything else for your text editing needs ever again.

  5. Since you’re on Macs, and I love Emacs, you could probably try AquaMacs. Although I am guessing you have tried Emacs before and did not care for all the flexibility of an operating system.

    • A long time ago I tried to use Emacs. I used it roughly for a year, and tried to configure it to my liking. In the end I wasn’t satisfied. It didn’t support proportional fonts (maybe the windowed versions do now?). It also suffered from not being able to create a global configuration: all file types had slightly different modes, which I find annoying.

  6. Just pick either Emacs or Vim, ya doofus! To make an argument for the Emacs side: it’s a Lisp VM geared towards text editing. You grow and mold it into exactly the editor you want it to be. Dream up some new editing paradigm? Hammer it out with a bit of Elisp and give it a shot. The longer you use it, the less it’s Emacs and the more it’s your own personal Emacs-like editor.

    • As I mentioned in the other comments, these older console based editors just don’t support proportional fonts. This is a critical requirement for me. I also prefer something that fits within my desktop. I know both VIM and Emacs have windowed equivalents, but they never felt truly integrated, more of a thin wrapper around the console version.

    • I just tried it briefly. It seems like an okay basic editor. It supports proportional fonts okay (on OSX at least, but it clips some descenders slightly). I can’t figure out how to get rid of the active line highlighting nor modify the individual highlighting colors. I can’t find an option to open a second window or split the view.

  7. Emacs with proportional font:

    But if I hear you right, you are not comfortable using Emacs or VIM, you need something more point and click friendly.

    • That’s nice to see! :)

      I haven’t used Emacs in a long time; I assume it’s improved since then. Though I like pointing-and-clicking for uncommonly used features, I primarily use the keyboard in my text editor.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s