News for hackers. Stuff that matters.
Re:Coming Home to Vim by losvedir on Monday July 09, 2012 @02:23PM (#4219578)
Sigh, I keep seeing this article, and ones like it, and keep thinking maybe I should go back to vim. I'm happy with Sublime, though I like the idea of vim.

I've used vim a great deal in the past and it really is exceptional for editing a given file. The thing that really tipped me to ST2, though, was its management of multiple files in a project. The sidebar and Goto Anything are indispensable. I know vim has command-t, but I just haven't been able to browse a family of related folders as easily. How do others do it?

Also, I just can't get used to the line-by-line scrolling of vim and emacs vs. the pixel scrolling of Sublime, or TextMate, or even TextEdit.

Re:Coming Home to Vim by johncoltrane on Monday July 09, 2012 @03:14PM (#4219865)
CtrlP(1) is a recent alternative to Command-T: you can use it to quickly jump to another buffer, a nearby file, a recently used file… all this with a very consistent interface and a neat feature: you can configure it to look up and up for a .git or .svn or other VCS artefacts and start from there. This makes the whole "open a file in the current project" business an almost seamless experience.

Also what's the point of displaying a third of the height of a line?

(1) https://github.com/kien/ctrlp.vim/

Re:Coming Home to Vim by bcrescimanno on Monday July 09, 2012 @03:45PM (#4220027)
Nice tip on the Ctrl-P link; but I'm curious, is there anywhere that sums up why Ctrl-P would be preferred over Command-T? Aside from being written in pure Vimscript, I haven't seen anything touting any specific advantages or disadvantages in a head-to-head.
Re:Coming Home to Vim by johncoltrane on Monday July 09, 2012 @04:30PM (#4220227)
Just for you:

                                             | Command-T | CtrlP
    -----------------------------------------+-----------+--------------------
     files                                   | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     buffers                                 | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     tags                                    | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     jumps                                   | OK        |                    
    -----------------------------------------+-----------+--------------------
     lines (vimgrep)                         |           | OK                 
    -----------------------------------------+-----------+--------------------
     MRU files                               |           | OK                 
    -----------------------------------------+-----------+--------------------
     mixed                                   |           | OK (new, untested)
    -----------------------------------------+-----------+--------------------
     open in tab                             | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     open in vsplit                          | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     open in hsplit                          | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     open multiple items                     |           | OK                 
    -----------------------------------------+-----------+--------------------
     matches with filenames                  | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     matches with filepaths                  | OK        | OK                 
    -----------------------------------------+-----------+--------------------
     execute command on opened file          |           | OK                 
    -----------------------------------------+-----------+--------------------
     create new file and parent directories  |           | OK                 
    -----------------------------------------+-----------+--------------------
     project root finder based on VCS        |           | OK                 
    -----------------------------------------+-----------+--------------------
I'd say that both are quite close in terms of features. CtrlP's strong points for me are:

* no dependencies

* project root finder

* overall UX

The "lines" feature (fuzzy incremental search across buffers ) is also very nice:

Re:Coming Home to Vim by bcrescimanno on Monday July 09, 2012 @04:35PM (#4220254)
John Coltrane wins the points--way more than I expected (a link to a quick summary would have done fine)--thanks for the detailed look!
Re:Coming Home to Vim by johncoltrane on Monday July 09, 2012 @04:45PM (#4220305)
You are welcome.
Re:Coming Home to Vim by johncoltrane on Friday July 20, 2012 @05:59AM (#4270114)
I should add that CtrlP is getting better and better over time. Some new (to me, at least) features:

* Bookmarking

* Quickfix mode

* Undo mode

* Change mode

* RTS mode

`:CtrlPBufferTag` is a killer.

This plugin seriously rocks.

Re:Coming Home to Vim by nudded on Monday July 09, 2012 @04:20PM (#4220176)
Command-T is known to be quite the pain in setting up.
Re:Coming Home to Vim by bcrescimanno on Monday July 09, 2012 @04:37PM (#4220265)
It's a pain if you don't have a version of Vim compiled with Ruby support; I was just wondering if there was anything beyond the language choice that made is superior (or inferior).
Re:Coming Home to Vim by Watabou on Monday July 09, 2012 @09:08PM (#4221463)
Is it just me or is Ctrl-P really slow for me?

The moment I start Ctrl-P in Vim, it takes about 20 seconds just to index and then when I began to type, the letters I type appear really slow and it takes ages for it to actually type out the whole word. Same when I delete a word by hitting backspace.

Command-T is, I would say, 40% faster for me but there is the same lag when typing/backspacing.

Re:Coming Home to Vim by codebeaker on Tuesday July 10, 2012 @03:43AM (#4222575)
There's a good chance you need to invest in your wildignore or ctrlp ignore settings. I run: https://gist.github.com/67de417c5c38f0ff8093 in the end of my ~/.vimrc to ignore the SCM directory, the tmp directory and my data-dirs (you can adapt as required) - this makes ctrlp really responsive for me. YMMV.
Re:Coming Home to Vim by johncoltrane on Tuesday July 10, 2012 @05:33AM (#4222819)
CtrlP (and other similar plugin)s doesn't have knowledge of your filesystem before you point them to a directory and it has scanned its content. Obviously, this operation can take some time on large/deep directories which will vary between implementations.

Luckily CtrlP gives you a bunch of ways to accelerate the whole thing. See `:h ctrlp`.

Re:Coming Home to Vim by tikhonj on Monday July 09, 2012 @03:26PM (#4219924)
Maybe I'm weird, but I want the scrolling animation to go by pixel, but then I always want my editor window aligned to the nearest line when I'm not scrolling. It's always a little annoying to have a half-obscured line at the bottom, or, even worse, top of my screen. This would just be compounded by the fact that I tend to split my editing window into fairly little blocks for running stuff like shells, so I would have a lot of lines obscured like that.
Re:Coming Home to Vim by johncoltrane on Tuesday July 10, 2012 @05:26AM (#4222799)
You are not weird but you want mutually exclusive things.
Re:Coming Home to Vim by tikhonj on Tuesday July 10, 2012 @05:40AM (#4222831)
Not in the least: I want smooth scrolling that snaps to the nearest line. I don't see how this is mutually exclusive or even unreasonable (at least for a text editor as opposed to something more free-form like a web browser).
Re:Coming Home to Vim by johncoltrane on Tuesday July 10, 2012 @07:14AM (#4223074)
Well, you can't have smooth scrolling without hiding parts of the top and bottom lines.

Smooth scrolling means that, at any point in time, the top of the topmost line of the viewport and the bottom of the lowest line of the viewport may be hidden.

Line-by-line scrolling means that all the lines have some kind preserved visibility.

Re:Coming Home to Vim by Tyr42 on Tuesday July 10, 2012 @01:26PM (#4224986)
He wants the animation to be smooth, but once you finish scrolling, it should be align itself to the nearest line.
Re:Coming Home to Vim by johncoltrane on Tuesday July 10, 2012 @03:06PM (#4225539)
Thanks for clarifying the question.
Re:Coming Home to Vim by pyre on Monday July 09, 2012 @02:33PM (#4219642)
I haven't really used it, but there's NERDTree for a Vim sidebar.
Re:Coming Home to Vim by dmrd on Monday July 09, 2012 @03:14PM (#4219867)
I'm not too familiar with Sublime, but I know that there are a few clones of Goto Anything for vim. Personally, I like CtrlP ( https://github.com/kien/ctrlp.vim/ ) since it is both very usable and written entirely in vimscript (so I can use it on servers without installing anything extra). I think it replicates most of the features of Goto Anything.