Saturday, March 08, 2008

Return to Classic template, and by the way, Notepad sucks.

In moving to the new "Layout" version of blogger with drag and drop ability of widgets and stuffage, it seems I lost my blog links. So I added the link widget, which I discovered one cannot edit manually, you have to add and subtract links one at a time. Not only that, but the new templates are in that evil of evils, XML. I have always believed that XML, CSS, DOM, and all that other crap was intentionally added to HTML to take web page creation out of the hands of amateurs and return it to the coder elite, remember Geocities, go.com, Tripod,and Angelfire? Well, I figured I could always edit the template manually and without thinking, saved it and opened it up in Notepad, since I was on Windows at the time. That, of course gave me a jumbled mess, because the file was probably unix-formatted and Notepad isn't XML aware. Which brings me to another point, to edit XML you practically have to have an XML aware editor. Windows by default doesn't have such a thing, and I don't have one installed, I think, So I just ftp'd it over to Linux where I DO have XML aware editors.In fact I have one of the editors that has a long history, vim.

vim (vi iMproved) is a modal terminal based editor descended from the 31 year old vi, that drives non-geeks insane. Modal means you can't just start typing in vim, which starts in "command mode", you have to enter "insert mode first, and then type. To use commands, for example, to save and quit, you have to exit insert mode and enter command mode. However, as you can see it can syntax highlight xml making it much easier to read and parse. The terminal here is mrxvt a version of rxvt with certain enhancements like tabs and TrueType font support.



After taking a look at the XML I realized it used an external call to the Link widget and thus wasn't easily editable to add my links.in so I switched back to the classic template to make it easier on me. That's when I decided to do this post about vim, which also has SL related uses because it can also syntax hightlight LSL (Linden Scripting Language)



As well as autocomplete LSL, type ll and hit Ctrl+n and it will popup a little mini-window.with all the llwhatever functions.



It can do tons of other stuff, like tabbed editing (just like tabbed browsing in Firefox, but even works in the terminal version) but not to worry, there is also a graphical menus n mouses version named gvim that is installed right along with vim.



See, it's not that scary. But even using gvim, the keyboard commands stay the same, like :wq! for "write(save) and quit". So there's a gvim enhancement called cream, that makes gvim act "normal" from a Windows users perspective. Ctrl+S saves for example. But any way you slice it, any version of vim is a better text editor than Notepad.

Windows installer for standard vim and gvim

Cream-ified vim/gvim for Windows installer Very popular among Windows users.

I will not speak of the editor emacs, I don't like it even if you can play Nethack, tetris, adventure and read your e-mail from within it. Yes, I know about viper mode that makes emacs act like vi, but that's the problem, viper mode acts like vi and not vim.

I've heard good things about a Notepad replacement called Notepad++ but I have never used that.

2 comments:

Daria said...

If you want to stay on Windows you could try Scite (http://www.scintilla.org/SciTE.html) - much nicer than notepad =)

There are even syntax files for LSL (http://adammarker.org/shill/), and an older ez version for LSL which I don't think is supported anymore but may still be useful (http://sdfjkl.org/secondlife/scite/).

Anonymous said...

I am not an emacs fan either. I realize all vi, vim, and emacs users are fanatical but I'm w/ you- vim all the way. And I used to use emacs on an our old sun system in college...

-Kesseret Steeplechase