
Show HN: Subvim – Vim customized to be like SublimeText - farslan
https://github.com/fatih/subvim
======
njoh
The most awesome feature of SublimeText for me is multiple-cursor editing
(Ctrl-D on a word). It only bothers me when I can't skip next occurrences
easily (It's possible, but it's hard)

It surprises me how users of other major editors don't use multiple cursors in
their day to day editing tasks. It'd be awesome if subvim included the best
solution vim community has to offer in this regard.

~~~
efnx
Vim has block editing mode (ctrl v - select, shift i, write text, esc) and the
ability to record macros. With those two features you can do everything
multiple cursors does and more!

~~~
weaksauce
I love vim but I don't think that block editing mode does what they want to do
quite as well. Do you have an example where they excluded a line or lines from
block editing?

an example:

    
    
       class="item"
       class="item"
       class="item" 
       class="item"
    

st2 would be able to select the second and fourth line item and be able to
change those to "item odd" without touching the first and the third ones.
similarly they could do the same and add even to the other two.

    
    
       class="item"
       class="item odd"
       class="item" 
       class="item odd"
    

this blog post shows it in action:

[http://www.sublimetext.com/blog/articles/sublime-
text-2-0-re...](http://www.sublimetext.com/blog/articles/sublime-
text-2-0-released)

~~~
Keyneston
I'm probably being very defensive but I use macros for this.

qa$i odd^[jjq

and then '4@a' to run it on all the lines. In a simple case like this is it a
bit more complicated than something like multiword editing but I've used this
technique in cases that are far more complex then what from my understanding,
multiline editing can handle.

For example I turned a spreadsheet of data into a complicated dhcpd.conf file
using a couple macros.

~~~
weaksauce
Oh I agree that macros are a daily use thing for me and I haven't used
sublimetext more than a handful of times; I was merely playing devils advocate
to see if vim had an interesting feature I was unaware of that I could use in
my day to day editing.

------
phreeza
slightly off topic, but I think a thing that is sorely needed is a kind of
libvim that provides proper vim functionality, which can then be linke

~~~
andyl
yes agreed - JetBrains has IdeaVim, but it is so lame compared to the real
thing.

~~~
hack_edu
How is the speed? Last time I tried it, about 6 months ago, there was a very
noticeable lag when switching between modes. I ran into the maintainer of
IdeaVim at PyCon and he said it should be better but my trial period expired
and I never got a chance to try it again.

~~~
tomlu
They just released an update a week ago that was supposed to have fixed the
problem. It does seem better, but I haven't used it for long enough to
properly verify that.

------
tomschlick
This is awesome. As a Sublime user I'm going to put this on my dev server for
those times when I have to SSH in and make an emergency code change without my
primary machine handy.

~~~
cseelus
Did that too

Love this project. Sublime Text's awesomeness makes it hard to completely
switch back to VIM, but this looks like a good approach to bring features we
have grown to love back to VIM, without all the hazzle.

------
lucisferre
Wonder how this compares to SPF13, which I've been using lately.
<https://github.com/spf13/spf13-vim>

~~~
farslan
OP here. SPF13 itself is really nice. But the main difference here is first I
try to emulate ST2, second I'm really picky which plugins are integrated. I
also don't use vundle (because It should always have the same feature
regardless of the state of plugin), instead of I'm using pathogen (which I
like more). With time I will update the plugins myself, but only if they have
bugfixes or features that are necessary to be added.

Some of plugins (like ctrlp) is modified in order to use the ctags binary I'm
bundling and installing. There is also pre-compiled version of YCM in subvim.
Together it means autocompletion and goto features are really working. You
really don't install anything.

The plugins settings are modified in order to emulate ST2 like behavior, like
accepting autocomplete entry via enter, creating a newline after
braces,quotes,etc.., opening a new tabs whenever you call cmd+p (but not if
you call cmd+r for using goto), closing the application and starting again
brings all you tabs/files again and so on..

They are many things I'm trying to improve, like adding snippet system, more
improved installation procedure, multiplatform support (linux and windows).
SPF13 is much better on these terms.

I hope with time it will get better :)

------
efnx
This seems rad, my only 2cents is that using modifier keys is not very vimmy.
But altogether really cool. Nice work.

~~~
farslan
The whole point is for people who want to switch from ST to Vim or for people
who used to use VIM, but loves ST. There are still cases that should be
handled trough. But I will add an entry to the FAQ, that explains the target
user. This is IMO not for everybody.

------
skopp
Vim reminds me of this white powder my mother used to use to clean drains or
something. Weird.

------
namtrac
Looks lovely!

Though I would appreciate non-Mac shortcuts too (I am guessing ctrl- can be
used instead of cmd-)

~~~
swdunlop
Agreed. I got excited, because it looked like a way to get Sublime-friendly
features in a remote terminal, but all the macvim-centric bindings look like a
blocker. Still, it's a great reference for Vim plugins that can bring Vim
closer to Sublime.

------
nu2ycombinator
Seriously why do we need this?

~~~
eksith
Because we can do it.

I understand the saying "just because you can do something, doesn't mean you
should", but really, we do anything because it can be done (or someone said it
couldn't be and we had to prove them wrong). Within sane limits, it's amusing,
without sane limits...

Meanwhile, I'm enjoying my life living away from a cave thanks to this same
delightful aspect of human nature.

------
QuantumGuy
I have got to ask the obvious here, why not just switch?

~~~
farslan
Because i love Vim :) Then there was Sublime that really changed the way of
editing in some way. I first tried vintage and make it vim-like. However it
was slow and not much was I wanted. Thus finally creates this project. For Vim
users who like Sublime.

~~~
jQueryIsAwesome
ST3 will be released soon and is supposedly going go fully support all vim
commands in vintage mode with better performance.

~~~
adamors
You mean the vintage mode that comes with ST?

Because I didn't see anything being announced regarding vintage mode. Some
guys forked the ST vintage package but that's 3rd party.

------
cachemeifyoucan
Good work! Love the color scheme.

~~~
farslan
Thanks! I've made some hacks to the original molokai (like the background on
the numbers).

------
bisu-shield
too bad CtrlP is crap compared to sublime's fuzzy searching

~~~
farslan
I tweaked the settings. It's a little better than with the default settings.
Just give try :)

