Entry
-
Having professionally(!) been programming for a while now, I've run into this situation where I'm actually putting quite precise requirements on the tools I use to develop, both professionally (C++) and at home (CoffeeScript with NodeJS). Thus, after having seen some of the amazing benefits of big clunky IDE's for C++ (keypress to go to declaration/implementation) as well as some of its atrocious drawbacks (what slow, badly designed monolithic beasts of programs they are - but you have to use them with big C++ codebases because of the benefits), I have been hunting for good features for my home web development setup.

I have tried the clunky IDE plugin route through NetBeans, and a whole lot of simpler ones, because lets face it, CoffeeScript probably isn't going to get full IDE type jump-to-function support soon, so your aim should be the best possible editor with syntax highlighting - and it should be correct syntax highlighting (the gedit plugin fails on regexes for instance). NetBeans does have a CoffeeScript plugin. In addition to syntax highlighting it does regular compiles to help you quickly spot errors, and it tells you intelligently. The program on the other hand is terribly slow, and if you exceed 8 tabs, you have to scroll through them in the slowest possible way ever.
After realizing that the big beast of a program route may not be the best I went through an assortment of simple editors. None of them really impressed me, so I'll just skip right to the point of this post; the editor that actually works well.
textadept. In fact, it not only just works well, it is amazing. I can work with it completely without a mouse, which is an essential when you want to do laptop work with a choice of either the useless mouse replacement, or the replacement that's too rude to mention in polite company.

buffers and compile view
Good features
1. Buffers instead of tabs. Instead of finding the file you want in a huge list of tabs (that you might have to additionally scroll), you press ctrl-b to open the buffer list and you start typing its name. It autocompletes between the list of file you have open and it's super quick - I mean, you already have your hands on the keyboard anyway since you are coding!
2. Easily extensible. There are modules you can hook in for most popular languages. I added my own shortcut key using a few lines of Lua, and I customized the coffeescript module to be able to build and run inside the editor easily with a simple keystroke.
3. Snippets. For instance in CoffeeScript, a default snippet is the shortcut for console.log; c. It doesn't intrusively popup, but it fills in what you didn't write when you press tab. A very sensible autocomplete. There are also some even more amazing ones to do quick for loops: forr + tab will give you for %1(name) in [%2(start)..%3(finish)]%4( by %5(step)). And you simply write name start finish and optionally step by tabbing between the numbered areas. Super, super quick.
4. Autocompletable recent file list. [i.e. open recent essentially becomes another type of ctrl-b]
5. Settings saved in a backupable folder.
6. Super fast. But really, if your text editor isn't why are you even attempting to use it?
Install Guide
1. Get the latest textadept version (the .tgz one, not source, it is pre-built) + the modules pack that is also in that download list.
2. Get the javascript module
3. Get the coffeescript module
4. Extract the textadept folder somewhere you feel comfortable with and put the modules archive on top of it.
5. Create a 'javascript' folder under this module folder and put the contents of the javascript module in there.
6. Create a shortcut on wherever you put shortcuts / or symlink it to /usr/bin. (Note that you should always start textadept without a second (file) parameter as you want it to remember your session). Start it once to auto-generate a .textadept folder in you /home/username folder.
7. Create a file without an extension inside aforementioned .textadept folder called 'theme'. Inside it, simply put the text 'dark'.
8. Create the directory structure .textadept/modules/coffeescript and put the contents of the coffeescript module in there. Think it has to be in here rather than under the application path because it relies on the javascript one.
9. Edit your init.lua file under .textadept/ insert the following at the bottom:
This is because when you try to run or compile your code it changes to split view mode to show the output from stdout. You want close (with ctrl-w) to take you back to unsplit view, and for the program to keep you in the right file. Unless you like working with split views, you will find this annoying, and you will need this step.keys.cw = { function() if buffer._type then buffer:close() gui.goto_view(-1, false) view:unsplit() else buffer:close() end end }
10. Edit the init.lua file under ./textadept/modules/coffeescript and search for m_run. There is only one command at the moment and it is wrong. Remove that line and put these two there instead:
m_run.run_command.coffee = 'coffee %(filename)' m_run.compile_command.coffee = 'coffee -pb %(filename)'
You want -b because that's how it's used before it's passed to node, so you will be able to more accurately determine what line numbers in the corresponding javascript that is being talked about in the stacktraces.
Addendum: In above step; take out the lua function that binds a shortcut to ctrl-j for inserting raw javascript (if messes up goto line shortcut)
That's all!
A bit complicated, but it sure is worth it! 4.0 just came out, so this felt like a worthy celebration of an editor that gets surprisingly little attention. Check it out. It's worth it.
poopiter
