You may want to try the MMAtsuiRenderer of MacVim (search this group
archives if you haven't heard about them), it basically use the same text
rendering code as vim-cocoa, which supposed to be faster than the existing
NSTextView based approach.
For vim-cocoa, I do have some plans to update it recently, consider it's
simpler code base (and I know it well enough since I'm the only developer
currently), I may do some more aggressive technical experiments on it's
code, and some of them may end up showing in MacVim when they're matured
enough.
I wish I could have enough time to add other missing features too, and
finish the MMAtsuiRenderer code I promised long time ago (sorry bjorn!),
but as a student I have to put my school work a higher priority. I hope
I can have more time spending on vim development after this semester.
- Jiang
here's a list of things that MacVim does which vim-cocoa doesn't. In
short, MacVim offers more OS X integration and has many "small things"
that make life easier (at least for me).
* MacVim supports the keyboard shortcuts you'd expect in an OS X app
Saving a file is ⌘S, closing a buffer is ⌘W, cut/copy/paste is ⌘X/
⌘C/⌘V, select all is ⌘A, undo/redo is ⌘Z/⇧⌘Z, new tab is
⌘T, switching tabs is ⇧⌘[ and ⇧⌘], and many more. The vim
commands for the same commands still work too. Some of these shortcuts
could be added to vim-cocoa by adding a few mappings to your _vimrc,
but some need special code changes and are not possible in vim-cocoa
(see below). Furthermore, MacVim displays the keyboard shortcuts for
menu items in the menu and "blinks" the menu if you hit a shortcut
that is listed in a menu -- just like other mac apps.
* MacVim can have multiple vim windows in one process
That means you can hit ⌘N to open a new window, ⌘` to switch
between your vim windows, hit F10 to see them all in exposé. ⌘O
opens a file in a new window like in other mac apps (you can still use
`:e bla` to open a file in your current window, or you can hit ⇧⌘T
to open a file with a gui browser in a new tab).
* MacVim looks better by default
MacVim includes its own font (well, the open source DejaVu Mono font)
that has an italic version, so italic text can be displayed. OS X'
default fixed width font Monaco cannot display italic text. This font
is used as default if you don't set one in your _vimrc. Furthermore,
MacVim includes its own colorscheme which is used as default if you
don't set one in your _vimrc (`:colo macvim`). If you prefer a dark
background, the macvim colorscheme has a dark variant too (`:colo
macvim | set bg=dark`). The colorscheme doesn't use a pink completion
menu among other things ;-) MacVim has gui tabs that look just like in
Terminal (at least on Leopard). You can drag-reorder the tabs. If
you're into transparent windows, you can make MacVim windows
transparent by doing `:set transparency=10`.
* MacVim has more OS integration
MacVim offers more system integration than vim-cocoa.
Examples:
You can hit ⌃⌘D to show the dictionary definition of the currently
highlighted word, just like in Safari, Mail or TextEdit or nearly
every other program on your Mac.
If you open the font selection dialog and select another font, the
new font is shown immediately; in vim-cocoa, it is only shown after
you close the font selection dialog. You can quickly change the font
size in MacVim with ⌘=/⌘-.
OS X has a find pasteboard shared by all applications: You can hit
⌘G in one app to copy the currently highlighted text to the find
pasteboard, and hit ⌘E/⇧⌘E in any app to search for the text in
the find pasteboard. The find pasteboard is supported in MacVim, with
the expected keyboard shortcuts. If you search for something in
Spotlight and open the file you're searching for in MacVim, MacVim
will automatically jump to the first occurrence of the text you
searched for (just like Preview does).
You can ⌥-click scrollbars to jump to the position where you've
clicked (this works in vim-cocoa too, but it's a nice feature
anyways ;-) )
If you hit ⌘Q by accident (you really wanted to hit ⌘W, but the
keys are right next to each other), MacVim will warn you if multiple
windows or multiple tabs are open, so that you don't lose flow by
accident. Safari does this too, and it's incredibly handy if you have
clumsy fingers like I have.
Trackpad scrolling is force-sensitive in MacVim.
* MacVim includes Sparkle
MacVim includes the Sparkle update framework. This means that MacVim
will notify you if updates are available and offer to download a new
version (just like Adium, Colloquy, or just about any non-Apple app).
Since MacVim merges the official vim changes quite often, you're
always running a somewhat up-to-date vim this way too.
* MacVim has great Unicode support
MacVim can display characters outside of the basic multilingual pane
(ie. characters that need more than 16 bits), and it offers basic
input methods. vim-cocoa might be even better in this category, but
both are way better than carbon vim (and, I guess, the vims on other
platforms). MacVim defaults to using utf8, so unicode should "just
work" (most of the time :-P).
* MacVim has support for remote commands
MacVim supports vim's remote commands. You can enter `mvim --remote-
tab file` to open 'file' in a running vim in a new tab. See `:h
remote` in any vim for a description of this feature.
* MacVim supports the ODB protocol
The ODB protocol is the de-facto standard for text editors on OS X how
other applications can interact with them. For example, you can choose
"Edit with ODB capable editor" in Cyberduck (an FTP program) to send
the currently selected file to MacVim. When MacVim saves the file,
Cyberduck can discover that through ODB and upload the file again
(since vim supports FTP itself, this example is not too convincing.
But perhaps you like to use a GUI FTP client).
* MacVim lets you edit mails in vim
MacVim includes an InputManager ("evil hack that could break your
system") that adds an "Edit in MacVim…" menu item to the edit menu of
every (well, nearly every) application that you run. When you select
this item, the text in the currently active text field is copied to a
new MacVim window where you can edit the text. When you're done
editing, you can save the file in MacVim and the text is automatically
copied back to the text field. You can use this to write mails from
Mail.app in MacVim, or to edit wikipedia pages in vim, or … (Since
Safari 3.1, you have to hit ⌘A in Mail when replying to a mail before
you hit that menu item, otherwise the text is not copied. This will
hopefully be fixed). To install this, open MacVim, open its
preferences (⌘,), choose the "integration" tab, and hit "Install".
It's that simple ;-) If you want, you can even use this input manager
with other editors that support the ODB protocol.
* MacVim has a fullscreen mode
If you like the "distraction-free writing" pitch of WriteRoom ( http://hogbaysoftware.com/products/writeroom
), you will be happy to hear that MacVim includes a fullscreen mode.
Hit ⇧⌘F to toggle fullscreen mode.
* MacVim includes extensive help
You can hit `:h macvim` in MacVim to display a description of the
options and commands it added. Other help files were also changed to
describe mac-specific differences.
That's all I can think of right now. So, which one is right for you,
MacVim or vim-cocoa? vim-cocoa will probably feel faster than MacVim
for quite some time to come. Most of the time (for me, all of the
time), MacVim is still fast enough, though. It really depends if you
like any of the features listed above.
The central feature of MacVim is that it supports several vim windows
in one process. The rest could (in theory) be added to vim-cocoa as
well. In practice, MacVim is worked on more as far as I can tell, and
all the features listed above are available in MacVim today.
HTH,
Nico
ps: Nobody really likes the toolbar and there are plans to change it.
However, we couldn't agree on _how_ to change it, so progress is slow
( http://groups.google.com/group/vim_mac/browse_thread/thread/32ac3e19364b2bd8/cf4902d5af38668c?#cf4902d5af38668c
). I'm currently simply hiding it (`:set guioptions-=T` in my
_gvimrc).
> here's a list of things that MacVim does which vim-cocoa doesn't. In
> short, MacVim offers more OS X integration and has many "small things"
> that make life easier (at least for me).
>
Thanks a lot for that, Nico. I too wondered what I was missing by
using vim-cocoa (and now I know what to call it, too).
Just one thing: vim-cocoa does support copying and pasting between
applications with ⌘C and ⌘V. As a Mac app, it probably doesn't have
any choice.
There's one other thing you neglected to point out that vim-cocoa is
missing: you (and others like you) who give such great support.
///ark
> but as a student I have to put my school work a higher priority. I
> hope
> I can have more time spending on vim development after this semester.
There's nothing special about students, in this regard. Except for the
independently wealthy, -everyone- who donates their time to producing
free software has other work to do. And in the case of the employed,
that work often supports other people.
My hat is off to anyone who -everyone- who works on free software,
that so benefits the rest of us!
///ark
First: How can I get the ⌘S, and the like, to print on my printer?
I read the mail with Mutt, and the ⌘ shows up fine on the screen, but
prints (from Mutt) as a strange combination (not in front of me at the
moment). I saved the text as a text file, opened in mvim, and everything
is fine on the screen, but when I print it, the ⌘ prints as an upside down
question mark.
Second: Sparkle. I don't recall ever seeing a notice of upgrade. I
installed my MacVim on Feb 13, 2008, from the snapshot on code.google.com
on (or about :-) ) Feb 13. Is this because there is nothing to update
since then, or due to something in my installation?
Anyway, thanks for all the hard work in putting together and maintaining
and continuously improving MacVim.
Best,
John Velman
On Sun, Apr 20, 2008 at 11:49:32AM +0200, Nico Weber wrote:
[snip]
> First: How can I get the ⌘S, and the like, to print on my printer?
⌘ is a character from the "private use area" of unicode, so it
depends on the mercy of your printer fonts. If you choose a font that
supports it and select "send font to printer" (or uncheck "use printer
fonts"), it might work. I don't have a printer, so I don't really know.
> Second: Sparkle. I don't recall ever seeing a notice of upgrade. I
> installed my MacVim on Feb 13, 2008, from the snapshot on
> code.google.com
> on (or about :-) ) Feb 13. Is this because there is nothing to
> update
> since then, or due to something in my installation?
Sparkle support has been included since snapshot 20, which was
released on Feb 03. Since then, 6 new snapshots have appeared
(snapshot 26 was released on April 11), so you should have got a
notice. Do you have "Check for updates…" in your MacVim menu (right
below "About MacVim")? If not, you're using a version without sparkle.
Else, if you click "Check for updates…", what happens?
Nico
I like the Mac way of doing things, but there is a lot to get used to after
many many years of Linux and (ugh) MSWindows.
Best,
John V.
> How well does it play in commandline "vim" mode?
works fine, just start it as /some/path/MacVim.app/Contents/MacOS/Vim
from Terminal.app. But if you want to use vim in Terminal only, you
can use the vim that ships with OS X just as well.
Nico