Posts tagged with "macvim"


Text editor "bloodlines"

ZEdit

A discussion on Hacker News about TextMate 2.0 spawned a fascinating general discussion on text editors, specifically what people have replaced TextMate with in its intervening abandonware years. Because I have a blog, I leave my comments here! ^_^

Editor Platform Comment
ZEdit DOS Syntax highlighting, in 1993! Wonderful editor
MS-DOS Edit MS-DOS Mostly in it's QBasic form
IBM E Editor PC DOS Should have been the default for MS-DOS too
Taco HTML OS X Beautiful little editor
Smultron OS X Formally free editor with side tabs
TextMate OS X Great for small projects, but I replaced it with...
MacVim OS X With NERDTree, it's my new favourite editor!
nano Console My first job used this, surprisingly!
Vim Console With vi compatibilty mode set to... off ;)
nvi *BSD Not my first choice, but can use now if need be
Emacs Console Not bad, just not my cup of tea
Kate KDE My favourite graphical *nix editor ^_^
Gedit Gnome Very capable and lightweight
Geany GTK+ More of an IDE, but worth a mention!
C=BASIC Plus/4 Retroactively learned on some 2nd hand hardware ^_*

As a matter of disclosure, this post was created in one of the aforementioned text editors.


TextMate: What's next?

After years of silence, we suddenly got an update on the future of TextMate 2.0 yesterday:

There will be a public alpha release this year, before Christmas, for registered users.

While it's welcome news for Mac developers who love the software, it's too late for me. I painstakingly moved all my TextMate projects over to Vim/Cream/NERDTree, and I also just received my key for Chocolat. Reviews pending!


MacVim.app comes with console Vim!

Shortly after posting my entry about building Vim from source because Homebrew preferred I install MacVim or use OS X's outdated version instead, Ibid commented that MacVim hides regular Vim inside its application bundle. A quick check confirms that it does! This is why I blog, to learn stuff from awesome people :).

My dad asked me once why I was typing "is"

For those who have installed it from the binary disk image:

% ls /Applications/MacVim.app/Contents/MacOS
MacVim* vim*

And from Homebrew, presuming you haven't symlinked it yet (reconstruct onto one line, ls doesn't like multi-line backslash!):

% ls $HOMEBREW_PATH/macvim/[version]
     /MacVim.app/Contents/MacOS
MacVim* vim*

MacVim is the the Cocoa version of Vim we've come to love, and Vim is indeed regular Vim!

Chrome has longer version numbers

At the time of writing, obviously this version of Vim lags a little behind what you'd get from building the source yourself (7.3.107 versus 7.3.108), but that's certainly far newer than the 7.2.x tree we're still on with Snow Leopard by default.

Unlike gvim builds of Vim which can just be called without the -gtk flag to render a regular emulator in the shell, MacVim is thoroughly a Cocoa application, so I presumed launching vanilla Vim wasn't possible. Building from source will give me the latest version, but I'm tempted just to use MacVim's version from now on, if only so then I have one less Vim floating around my system which I otherwise keep meticulously tidy!


Restoring files with MacVim, Vim

MacVim informting me of a file that can be restored

It seems deliriously (some of you might say schadenfreude) ridiculous that I would take so much time to create a follow-up post to my initial MacVim review and include some commentary regarding my forgetful nature... then forget to add something. Can banging your head on a table cause brain damage?

One more reason to consider MacVim if you're looking for an all purpose text editor for Mac is a feature it shares with regular Vim: the ability to restore text files that were lost as a result of the program quitting unexpectedly. If you relaunch MacVim you're asked if you want to restore the text file to the condition it was last in regardless of when you saved it.

As with most Mac applications MacVim has never crashed on me before, but that's not to say I haven't been the victim of an old battery that decides to turn the computer off!

That reminds me, I need to buy a new battery. This one is shot worse than a politically incorrect reference to Dick Cheney. Wow, that was over three years ago already?


Followup to my MacVim review last year

Vim (left) compared to MacVim (right)
Vim (left) compared to MacVim (right)

I try my best to include as much information from personal experience as I can when I do my reviews of software here, but sometimes I forget something critical which later involves me hitting my head on a table or similarly raised flat surface.

In August of last year I wrote up a review of the MacVim text editor which, as you've probably already figured out, is a native Cocoa port of the venerable Vim text editor. Back then I admitted I didn't see the point of using MacVim when Vim was already available in Mac OS X and could easily be accessed from the Terminal [Wikipedia], but I stated I'd started using MacVim anyway.

I thought I'd clear up some ambiguity now that several months have passed: MacVim is the ultimate Mac text editor and I use it exclusively now for everything! It has become such a critical part of my life now that I can't possibly imagine going back to TextMate or TextEdit [Wikipedia]. It's an excellent application that works just as regular Vim does, but with all the benefits of being a native Cocoa application such as native file open and save windows, a broader range of colours for syntax highlighting... plus gosh darn it, it just looks nice!

Since my initial review I've also learned more regarding execution from the Terminal. I've broken the post up into three sections, to pretend I'm organised.

1. The mvim script

Terminal.app iconPaulo posted a question on my original review and answered it before I even could! If you're reading this Paulo, do you have a website you want me to link to?

Thanks for sharing this! One question thou: I’ve used ports install MacVim and I can’t find the mvim script that is supposed to be shipped with it. Am I missing something?

[...]

Figured that you need to get the version from the project’s web site at http://code.google.com/p/macvim/

2. Using an ampersand to stay in the shell

Terminal.app iconThis is something I already knew given I use FreeBSD so heavily now, but I realised others might not. If you want to execute MacVim in a directory from the Terminal but you still want to work in that directory, you can append an ampersand to the command:

% mvim [filename] &

This is really useful if you want to edit source code in MacVim and compile it in the Terminal.

3. Command aliases for the absent minded

Terminal.app iconAnother tip from Unix is adding aliases to your profile shell script so if you're like me and you absent mindedly type vim or vi when you meant mvim you'll execute the right thing! First check which shell you're running:

% echo $SHELL

Then append these lines to your appropriate file. Leopard uses bash by default but given I'm a FreeBSD guy I still prefer tcsh.

For bash, ~/.profile, ~/.bash_profile or ~/.bashrc:
alias vim="mvim"
alias vi="mvim"

For tcsh, ~/.tcshrc or ~/.cshrc:
alias vim "mvim"
alias vi "mvim"


A revisited MacVim editor review

About a week ago I posted (amongst other ramblings) that I had successfully moved over to the Vim text editor for most of my day to day... editing. I mentioned how I loved the syntax highlighting and how much it improved the readability of code, and how I had got used to the two mode operation and most of what I would consider to be the basic and intermediate commands.

MacVim icon
MacVim in the /Applications folder

Unfortunately I also said that I had installed Vim from MacPorts on my MacBook Pro to use in the Terminal and that I failed to see what the point would be of installing the dedicated graphical MacVim application. I've since been proven wrong and have even started using MacVim as my primary editor for everything I do on this machine, and I love it!

ASIDE: Despite what you may think, I was not paid any money to create this post. Isn't it a sad state of affairs these days when you have to go on record saying that you're not being paid off? Sheez Lousie!

My incorrect assessment stemmed from my own misunderstanding of what MacVim was capable of; I assumed that it was just an Aqua version of GVim, or in English a Mac OS X native version of graphical Vim that didn't need X11. While this is true, it does have features that put it far ahead of the simple Terminal based Vim I was advocating before.

Firstly, the syntax highlighting which what made me fall in love with Vim from the beginning is far richer in MacVim because it supports full 16bit colour, not 16 colours. Below is a comparison of a simple Ruby script I wrote shown in MacVim and Vim:

Vim (left) compared to MacVim (right)
Vim (left) compared to MacVim (right)

Now obviously I could go into my Terminal.app preferences to get the same background colour and font size, but the colours definitely look nicer in MacVim. I'm one of those fruitjobs who sees their code as poetry, and as with all art it looks far nicer when presented in a nice frame :-).

Another feature of MacVim given that it's a native Mac OS X Aqua application is that along with the regular [esc]+[:]+command Vim commands, it also supports native Mac shortcuts. This means to open a file I can enter :o ~/Documents/MyFile.rb or just as easily enter [Command]+[O] and use a regular Mac OS X dialog box.

Then there are the little things that perhaps don't improve usability in the traditional sense, but make the program nicer to use such as native, Safrai like tabs, the utilisation of the Mac menu bar and a native Mac toolbar you can collapse. It also throws errors using native Mac windows:

Mac-like error message
Mac-like error message

My final concern with using a graphical MacVim application instead of the command line Vim was that I spend most of my life in the Terminal and would hate to have to move to the Dock, click the application icon and navigate to the file I want when I might already be there in the Terminal. Fortunately in the MacVim archive you download there's also a small mvim script you can put in any folder in your shell's $path which will automagically launch the MacVim application whenever you enter mvim filename from the Terminal, just as with TextMate. I chose to put my mvim file in /usr/local/bin given I'm also a FreeBSD guy.

Having used MacVim for just over a week now, I can confidently say it has really made my life much easier. If you're on the hunt for a text editor for Mac OS X and don't like the idea of shelling out an arm and a leg for shareware that isn't even as good anyway, give it a try! I love it so much I'm going to make a donation this afternoon: after all I would think paying for something you don't need to pay for is much higher praise than being told you have to pay or it will cease to work, right?

MacVim is available from it's Google Code project page.