2

I'm a pc guy, but I have a programming student who's got a mac. We have been using TextMate, but there are a few features missing that I either can't find, or that are not available in TextMate.

In my beloved Notepad++ I have the following features:

  • vertical gridlines, that help you see how far indented you are
  • when putting your cursor next to a pair of brackets or inside an html tag, the matching bracket or tag will be highlighted, in the case of curly braces the aforementioned gridlines will even be highlighted (so if you have consistently indented code, you'll just have to scan down the highlighted, dotted line, and you'll find the matching bracket)
  • when highlighting a word (which is quick by double clicking on it) all other instances of that same word will be highlighted (where else did i use that function/variable? did i name it consistently?)
  • Commenting multiple lines of text by highlighting and hitting [strg]+[k]
  • Un-Commenting multiple lines of text by highlighting and hitting [strg]+[shift]+[k]
  • Indenting multiple lines of text by highlighting and hitting [strg]+[tab]
  • Un-Indenting multiple lines of text by highlighting and hitting [strg]+[shift]+[tab]
  • the ability to chose how to interpret the file (what language) textmate's interpretation is quite buggy... somethimes you'll open a file and it'll be all white even though it's clearly a .css file or so.
  • function completion, such as parameter hints, closing html tags automatically, and completing brackets, would also be helpful. I love hot notepad++ shows you when you type a variable what variable names you have already used in the document.

Textmate's handling of brackets and quotations rocks: it adds the matching pair for you, but wont advance the cursor, so if it's in your muscle memory to do them at the same time, it won't waste your time. and you can highlight a word and hit quotes or brackets, and it'll wrap the word in brackets. So those would be a bonus, but it's nothing I miss when using Notepad++, however the combination of lacking the above is frustrating.

enter image description here

Does anybody know a free program for Mac with these features?

And while you are at it, could you please point out how to activate and use these features? For example I know TextMate has a way to indent, but the key combination it gives you makes no sense to me...

Thanks for any suggestions!

3

Sublime Text

There are some things worth paying for in life and a solid text editor is, in my opinion, one of them. If it's the tool you use every day, what's a few dollars to ensure that tool is high quality? For me, that editor worth paying for is Sublime Text. I'm still on 2, but 3 is a pretty stable beta and can be had for free for the time being. Both 2 and, when it leaves beta, 3 can be "evaluated" indefinitely if the price and paying for quality software really turns you off.

The upside to Sublime is it has a long and illustrious with a great community behind it. It has an awesome package management system in Package Control that lets you add a ton of features very quickly and easily.

To address your specific feature requests...

vertical gridlines, that help you see how far indented you are

Yes. Add:

"draw_indent_guides": true

to your preferences file.

bracket matching and tag matching when you're inside a tag

The BracketHighligher extension does this and more. There's a snazzy screen shot on its Package Control page that shows off all the ways it can highlight things out of the box.

You can find my Sublime preferences file here which has most of things you desire enabled in it already.

when highlighting a word (which is quick by double clicking on it) all other instances of that same word will be highlighted

Sublime calls this Multiple Selection. Select a word and then press Ctrl+Command+G or Cmd-D to select all occurrences of the word in the file. Typing will replace all occurrences simultaneously. You can do a lot more than that with Sublime. See the aforementioned page for other multiple selection ninja moves you can do.

Commenting multiple lines of text by highlighting and hitting [strg]+[k]

Highlight the block and press Command-/ to toggle comments on and off for the block. You can combine this with multiple selection mentioned above to comment out non-contiguous lines.

Un-Commenting multiple lines of text by highlighting and hitting [strg]+[shift]+[k]

It's Command-/ in Sublime to toggle comments which is easier to remember than an 'add comment' and a separate 'remove comment' action if you ask me. If you don't like the short cut you can reassign key bindings freely in Sublime to map the actions to a preferred combination.

Indenting multiple lines of text by highlighting and hitting [strg]+[tab]

That works exactly how you want: select the lines, TAB to indent, Shift-TAB to un-indent.

Un-Indenting multiple lines of text by highlighting and hitting [strg]+[shift]+[tab]

It's just Shift-TAB in Sublime.

the ability to chose how to interpret the file (what language)

You can override Sublime's language guess using the View > Syntax... menu. Pick the language you want it to be instead of the one Sublime guessed. Sublime's guessing is much better than TextMate's though IMO.

function completion, such as parameter hints, closing html tags automatically, and completing brackets, would also be helpful.

Absolutely -- they're called Snippets in Sublime's parlance. It ships with a bunch of defaults for some common languages like CSS, HTML, Ruby and Python that are useful. You can add your own snippets and you can find more language support and snippets in Package Control.

2

Atom

Atom is the new kid on the block. Completely free and open source, it's a text editor that started out as a closed-source project at GitHub but is now being extended by folks around the world. It has grown in popularity and capabilities very quickly. It's still a bit young so it's changing rapidly and there are some rough edges, but it's showing a lot of promise and you sure can't beat the speed at which issues get addressed in the project when they do arise.

They borrowed a lot from TextMate and Sublime so it would feel familiar to people -- both of those editors were and are very popular with OS X-based developers. Smart to start on the shoulders of giants and try standing from there, right?

Here is a great comparison between Atom and Sublime Text.

To address your specific feature requests...

vertical gridlines, that help you see how far indented you are

Yes. In the Core Settings preferences window, scroll to the bottom and check Show Indent Guide to see guides.

bracket matching and tag matching when you're inside a tag

It has the atom/bracket-matcher plugin that ships with it by default.

when highlighting a word (which is quick by double clicking on it) all other instances of that same word will be highlighted

Yes. Highlight a word or phrase and press Cmd-D and it will select all instances of that pattern in the file.

Commenting multiple lines of text by highlighting and hitting [strg]+[k]

Highlight the block and press Command-/ to toggle comments on and off for the block. You can combine this with multiple selection mentioned above to comment out non-contiguous lines.

Un-Commenting multiple lines of text by highlighting and hitting [strg]+[shift]+[k]

It's Command-/ in Atom to toggle comments which is easier to remember than an 'add comment' and a separate 'remove comment' action if you ask me. If you don't like the short cut you can reassign key bindings freely in Atom to map the actions to a preferred combination.

Indenting multiple lines of text by highlighting and hitting [strg]+[tab]

That works exactly how you want: select the lines, TAB to indent, Shift-TAB to unindent.

Un-Indenting multiple lines of text by highlighting and hitting [strg]+[shift]+[tab]

It's just Shift-TAB in Atom.

the ability to chose how to interpret the file (what language)

Press Ctrl-Shift-l to opent the file type selector and reassign the language or file type for a specific file.

function completion, such as parameter hints, closing html tags automatically, and completing brackets, would also be helpful.

I'm sorry. I'm not sure how you do this and I can't find any great documentation on it. Maybe someone can annotate the answer? I'd be surprised if Atom couldn't do this.

1

TextMate's controls are configurable, and they're dependent on separate macro "bundles" for the currently active language, but the standards are:

  • Cmd-/ for commenting and uncommenting selected blocks
  • Cmd-] for indenting selected blocks and Cmd-[ for dedenting
  • Esc to autocomplete a word, but it works strictly by looking for the nearest matching word in the current document; it doesn't know anything about the current language's standard library, or words in other documents.

At the bottom of the TextMate screen you should have a footer that tells you the current line and column, the current language (so if it's mistaken about the language, fix it there), how tabs are configured, and so on.

I believe a .css bundle comes pre-installed, so I'm not sure why it wouldn't auto-identify .css.

  • It actually didn't identify JavaScript. At least not right away... Will look at that footer next time it happens, thx! – olli Jun 4 '14 at 9:52
0

sublime text should suit most of your needs, also it has tons of plugins that you can use to customize it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .