News for hackers. Stuff that matters.
Re:From TextMate to Vim by mcantor on Monday August 03, 2009 @04:58PM (#740094)
Disclosure: I'm a lifestyle vimmer, and have often made additions to my .vimrc in the dead of night, having awakened in a feverish panic from a hypnagogic vision of some most excellent new macro that I absolutely MUST map to <Leader>k RIGHT NOW, before I forget how much it'll help when I'm trying to replace CamelCase variables in HTML files but only when I load their buffers on alternating Tuesdays and I'm in diff mode...

This article is a reasonable assessment of vim, with what I consider to be some novel surprises. For example, he apparently found its configuration simpler than emacs: maybe he just hasn't tried it yet! Also, he considers it less distracting. I found this interesting as well, because he mentioned expertise in emacs as a journey rather than a destination. I have found this to be patently true for vim.

Still, I'm glad there are still people out there who are converting to vim. I'm puzzled by this particular blogger's experience, but maybe he'll find the traditional gotchas in due course as he continues to use it.

Re:From TextMate to Vim by oliverkofoed on Monday August 03, 2009 @05:02PM (#740097)
Vim is nice, MacVim is nicer. It'd be perfect if it had the the project drawer from textmate on the side, instead of wierd-textmode treecontrols which i never quite master.
Re:From TextMate to Vim by systems on Monday August 03, 2009 @05:39PM (#740161)
If you are referring to NERDTree, NERDTree is awesome!

  *C* (that's capital C), to switch the folder under the point to root
  *r* to refresh
  *m* to perform (or pick) a file system command
  *cursor-keys* to move up and down
  *?* for help
How can you not master that! Vim is awesome!
Re:From TextMate to Vim by jamongkad on Monday August 03, 2009 @07:56PM (#740357)
I second that, another useful plugin is taglist.vim, just make sure you have exuberant ctags installed first!
Re:From TextMate to Vim by travisjeffery on Monday August 03, 2009 @06:09PM (#740195)
NERDTree is ridiculously awesome.
Re:From TextMate to Vim by aaronblohowiak on Monday August 03, 2009 @06:18PM (#740201)
Try vimmate.. it is easy to install on ubuntu ;)
Re:From TextMate to Vim by mhansen on Monday August 03, 2009 @09:40PM (#740465)
Try the vim plugin "fuzzyfinder_textmate"
Re:From TextMate to Vim by pauljonas on Monday August 03, 2009 @07:21PM (#740304)
Since discovering MacVim, have totally switched back over from TextMate.

Especially since I upgraded to Ruby 1.9 and many bundle actions no longer work in TextMate.

MacVim won me over (as I never really totally departed from Vi/Vim) as with MacVim, now I can have (a) full color color schemes (never could get more than 8/16 colors on OSX terminal session), (b) fullscreen (no menu bar, dock) editing, (c) OS X hotkeys (i.e, Cmd-W, Cmd-O, Cmd-N, etc.…) and (d) printing (which is fubared in TextMate)

Re:From TextMate to Vim by godDLL on Tuesday August 04, 2009 @04:24AM (#740845)
If you're into unsupported ways of extending OS X you may find Ciarán Walsh’s "TerminalColors" SIMBL bundle useful.

http://ciaranwal.sh/2008/02/12/terminal-plug-in-updates

Re:From TextMate to Vim by pauljonas on Monday August 10, 2009 @02:18PM (#753612)
Never could get that to work properly on my OS X box(es).

Might have been a legacy hangover from saved terminal setups dating back to Jaguar days…

Re:From TextMate to Vim by bonaldi on Monday August 03, 2009 @06:34PM (#740219)
It's slightly ironic that BBEdit is dismissed as "lost in the pre-OS X" world by someone who went on to evaluate emacs and plumped for Vim•. Especially since BBEdit solves all the problems he had with TextMate.

(• This isn't a diss of Vim or Emacs, btw, just that they're both rather less "OS X era" than either BBEdit or Textmate -- but that's often a strength)

Re:From TextMate to Vim by lallysingh on Monday August 03, 2009 @08:56PM (#740427)
Indeed; outside of emacs, it's my favorite editor.

It is (IMHO) exactly how a GUI-based text editor should act. Simple and unintrusive in normal use, with enough power under the hood (and accessible via UI) to do the tougher stuff. I still miss some of the things I could do easily in it, even with emacs 23.

As for the article's comments on emacs, the mistake is in assuming emacs is an application. It's not. It's a lisp environment that's been shaped for text editing. The configuration interface is terrible because you're not really supposed to use it. Instead, you shove programmatic commands into .emacs to bend it to your will.

Friends and I brag about the length, complexity, and age of our .emacs files... maybe we should get out more... but you get the idea.

Re:From TextMate to Vim by pyre on Monday August 03, 2009 @10:27PM (#740526)
Even configuring Emacs through the .emacs file I find that it treats things different enough from Vim that it's painful to try and switch. Every once in a while I get excited that maybe I'll switch, but then I pretty quickly fall back to Vim.

There are so many things in Vim that 'just make sense', at least to my way of thinking. Things like tabs. Why is it that in Emacs you can't just define a soft tabstop of 4 spaces? Why do I have to define a list of column numbers? Don't get me wrong, the idea that I could manually define a bunch of column numbers so that the tabstops were uneven for a particular application would is cool... by why can't I just say "every 4th column is a tabstop" and have Emacs apply that until infinity columns? And there is the lack of things like Vim's ":set list" mode to quickly visualize if a bunch of spacing consists of tabs, spaces or a mixture (and to quickly figure out where trailing whitespaces are).

These are all things that I can get on default Vim without any configuration. I'm sure these are all programmable in Emacs -- it is a full-on lisp engine afterall -- but it's too steep of a climb for me (or at least has been thus far) when I'm already productive with Vim.

Re:From TextMate to Vim by lallysingh on Monday August 03, 2009 @10:53PM (#740560)
(assuming cc-mode) Set c-basic-offset to 4.

Even better, if you don't like the way anything's indented, move the cursor to that spot and hit C-c C-o and it'll tell you why it's indented that line that way, and you can adjust those parts as you wish.

If you're not in cc-mode, then.. it's lisp. Repeating sequences of multiples of 4 are pretty easy to write in a function that generates them.

Re:From TextMate to Vim by pyre on Monday August 03, 2009 @11:04PM (#740574)
Not being a huge lisp person, are there lazy-evaluating lists in lisp? So that I could define the tabstop sequence to be a list that would continually be evaluated, but only as far as the calling function was asking for (like Haskell)? Otherwise, there is still a finite end to the list even if I can easily generate a ridiculously long sequence automatically.
Re:From TextMate to Vim by ekiru on Monday August 03, 2009 @11:32PM (#740605)
I don't believe there's anything in the Common Lisp standard for it, but I think lazy lists should be implementable with macros.
Re:From TextMate to Vim by lallysingh on Monday August 03, 2009 @11:20PM (#740588)
Nope, strict eval only. Just define a max, and if you hit it, raise it.
Re:From TextMate to Vim by amix on Monday August 03, 2009 @06:46PM (#740242)
I have been a hardcore Vi(m) user for the past many years. Over the years I have learnt the mastery of Vi editing and I love editing in Vi. But one thing is for sure: Vim (at least for Mac) sucks badly. The scripting language is a joke, the development is stalled (or really slow), the syntax highlighting is a joke and the implementation is really slow for some things. There is nothing worse than being slowed down by lags in the text editor. I have tried to switch over to Emacs for at least 4 times now, but unsuccessfully, since the editing is not that natural for me. (I know at least one other Vim hacker that has done and tried the same switch).

If I was to invest shit loads of hours into learning to use a text editor I would pick Emacs - - simply because the environment that Emacs offers is amazing (Vim environment looks good, but the more you customize, the slower things get and the more you look around, the more issues you find).

Re:From TextMate to Vim by rv77ax on Monday August 03, 2009 @10:41PM (#740541)
vim can give you more advantages if you have a wider screen. tab in tab, editing two file in the same tab, etc. it's very flexible. http://journal.kilabit.org/?p=81.
Re:From TextMate to Vim by carbon8 on Monday August 03, 2009 @05:18PM (#740130)
I switch back and forth between TextMate and MacVim. MacVim is slightly, annoyingly slow; TextMate feels more natural (including smooth, fast block editing without modes); TextMate doesn't have split view or buffers. To be honest, I'm not that happy with either. I've tried emacs a few times because Aquamacs is a nice app, but emacs makes my vim-trained brain hurt and I end up wresting with it and giving up.
Re:From TextMate to Vim by Locke1689 on Monday August 03, 2009 @05:35PM (#740154)
MacVim is slow? Since when?
Re:From TextMate to Vim by jsober on Monday August 03, 2009 @10:11PM (#740509)
Compared to `xterm -e vim`, yes. By that measure, so is gvim and every other GUI vim wrapper. MacVim just comes with quite a few plugins, which may explain the commenter's experience.
Re:From TextMate to Vim by Locke1689 on Monday August 03, 2009 @10:15PM (#740513)
Yeah but he was comparing it to TextMate.
Re:From TextMate to Vim by epall on Monday August 03, 2009 @06:58PM (#740263)
I've been using Vim for work all summer, and returning to TextMate is a bit of a challenge for me. I guess it's time to make the leap to pure Vim!
Re:From TextMate to Vim by forsaken on Monday August 03, 2009 @05:14PM (#740119)
I recommend checking out Komodo Edit. It has a really great vim emulation, and has all the nice IDE features that are useful (projects, file browsing, remote file editing). It has most of the nice things from Textmate (the Cmd+t quick open), extensions, and much more. Plus it's own snippet system as well.
Re:From TextMate to Vim by jamesbritt on Monday August 03, 2009 @05:23PM (#740139)
"It has a really great vim emulation"

Will it read in my .vimrc file and my custom scripts? That's the big win with vi for me, that I can customize and automate things.

Re:From TextMate to Vim by blasdel on Monday August 03, 2009 @06:19PM (#740203)
That's absolutely the opposite of everything I love about vi -- that I neither need nor want to customize it!

I can sit down at a new Unix box 25 years in the past or future, and not be frustrated editing a file.

Re:From TextMate to Vim by pyre on Monday August 03, 2009 @07:26PM (#740314)
Usually people don't customize the 'core' bindings/functionality. It's usually about complementing it with things that make your life easier.
Re:From TextMate to Vim by jamesbritt on Monday August 03, 2009 @07:52PM (#740351)
Exactly. I want :w and such to always do what they do. But I also want my assorted helper macros and mappings so I can avoid typing boilerplate code and so on.

NetBeans has a vi plugin, which isn't bad, but I'm forever trying to do things that are only defined in my resource files and plugins, so I end up editing code in vi and using NetBeans for specific tasks (GUI editing, usually).

Re:From TextMate to Vim by bmj on Tuesday August 04, 2009 @07:29AM (#741001)
I tried Komodo Edit about six months ago. I really wanted to like it, but it was really just too slow (on Windows).
Re:From TextMate to Vim by jsober on Monday August 03, 2009 @10:08PM (#740506)
On OSX, at least, Komodo Edit was not a very polished experience for me.
Re:From TextMate to Vim by jpcx01 on Tuesday August 04, 2009 @08:15AM (#741049)
After seeing Textmate crash for the thousandth time, I also made the jump back to VIM. Seems like a bit of a regression, but at least its stable and I dont have to worry that opening a large will crash every project I have open.
Re:From TextMate to Vim by gasull on Tuesday August 04, 2009 @01:20AM (#740695)
TextMate-like snippets in Vim:

SnippetsEmu http://www.vim.org/scripts/script.php?script_id=1318

Re:From TextMate to Vim by mcav on Monday August 03, 2009 @04:57PM (#740088)
Lots of success stories from TextMate to Vim/Emacs lately. That's on my list too; I just need to force myself to make the jump (and allow for the short-term productivity hit).
Re:From TextMate to Vim by oliverkofoed on Monday August 03, 2009 @05:05PM (#740101)
It's worth it.

I did it last year, and it took almost two weeks before i felt like i was even somewhat productive again. However, now, i feel exactly the same way when trying to use an editor without a VIM mode. What? I have to use the arrow keys to move the cursor? But, i'll have to move my hands! sigh

Re:From TextMate to Vim by bdotdub on Monday August 03, 2009 @06:31PM (#740216)
Amen. Once you get the hang of it, you won't know how you lived without it :)

In fact, it'll start taking over in how you interact with your whole coputer. I find that I type "<ESC>:wq" in chat windows, comment boxes, etc..

Re:From TextMate to Vim by 321abc on Monday August 03, 2009 @06:43PM (#740238)
Tip: Instead of :wq you can just type ZZ
Re:From TextMate to Vim by mechanical_fish on Monday August 03, 2009 @08:38PM (#740403)
I learned ZZ first. That turned out to be a mistake, because thinking of it as :wq crams more knowledge into one mnemonic. Because you can take it apart: you can just do :w, or you can just do :q, or you can do useful variations like :q!

And you can probably do all kinds of other powerful stuff that I don't understand, because I'm an emacs user who only uses vim on occasion. ;)

Re:From TextMate to Vim by 321abc on Monday August 03, 2009 @10:34PM (#740530)
Yes, when learning it it is useful to know that :wq can be decomposed in to :w and :q and combined in to :wq! and :w! and :q!

But once you know that I think it's simpler to just type ZZ

Re:From TextMate to Vim by 321abc on Monday August 03, 2009 @06:41PM (#740235)
When you start, be sure to first go through the vimtutor (just type "vimtutor" in your shell).

Then, if you have questions, come to #vim on freenode. There are lots of very, very experienced and knowledgeable people there that will be happy to help you learn.

Then, if you still need more, there's:

Vim tips wiki: http://vim.wikia.com/wiki/Main_Page

The best collection of vim scripts: http://www.vim.org