

How  SublimeText Bodybags vim+Terminator - ngokevin
http://ngokevin.com/blog/sublime/

======
lloeki
Sublime Text is awesome, but the article falls completely flat by mentioning
stuff that's actually in vim and missing the parts that are not.

    
    
        5. vim compatability!
    

> _With a few tweaks, I was able to make it just like vim as far as I could
> tell_

It took me five seconds to hit walls and off-by-one issues revealing Vintage
mode as a remote simulacrum of Vim. A look at the source confirmed that it's
just a mode emulation and a small bunch of keybindings, a far cry from the
notion of text objects which makes Vim what it is. I am a vim user, but I use
ST _without_ Vintage because the impedance mismatch is too big.

> _minus some :commands_

Author doesn't mention VintageEx. Still thouroughly lacking, even for basic
stuff.

    
    
        4. Powerful Keybindings in JSON and Plugins in Python
    

_:help index_ lists default keybindings _:verbose map_ lists all set
keybindings, what they do and _where they've been set_.

With Vim (vim --version will tell you), depending on compilation options, you
can write plugins in various languages (python, perl, ruby, lua, tcl...), not
just vimscript.

hot-load: _:source ~/.vimrc_ or whatever other file.

    
    
        3. Package Manager and the More Centralized Community
    

vim.org/scripts[0] is the central place to look for.

Pathogen and Vundle fix that. Package Control give you a central, automated
and in-editor _index_ , which I'm not sure is a real plus since I care about
installing plugins once in a blue moon, so that's merely a convenience.
Besides I've had Package Control bork ST more than once on upgrades (either of
ST or of itself), so I'd rather have it outside.

    
    
        2. Project Sessions
    

_:mksession_ is what you want. Bind it to a key[1], or be creative in your
vimrc.

Also, automatic restore[2] when there's one around and you boot with just
_vim_ in the project directory.

    
    
        1. Ctrl+P - GotoAnything:
    

For the function mentioned (fuzzy search for files), there's a plugin of the
same name.

The author again fails to mention what makes Sublime Text supposedly stand
apart: Go To Anything goes to _anything_ , not just files, so symbols (with @
_symbol_ ) and lines (with : _linenum_ ) are reachable from a single shortcut.

I don't want to sound mean, ST rocks and has a number of good things I miss in
Vim, but they're not among this list. In fact it's good enough that I
contemplated doing a real Vim mode with extensible text objects (hence why I
looked at the Vintage source).

[0]: <http://www.vim.org/scripts/index.php>

[1]: <https://github.com/lloeki/vimfiles/blob/master/rc#L158>

[2]: <https://github.com/lloeki/vimfiles/blob/master/rc#L257>

~~~
tvon
Generally speaking (not specific to ST), "vim compatibility" is a vicious
tease.

~~~
d1ab0lic
That is one of my biggest issues when trying another editor, the vim
compatibility is great, until it isn't.

------
randomdrake
Great article.

As a text editor, I can agree that SublimeText is an absolutely gorgeous
product. As a Vim user, it didn't take me long to realize it wasn't for me.

For me, SublimeText still feels like I'm using a program external to the
system I'm developing on. It doesn't feel like it's quite close enough to the
bones of the system to me.

I know that a "feeling" isn't really the best argument, so here are a couple
things that are more concrete to attempt to explain it:

1) I haven't found an implementation of the ease of which it's possible to
split your editor quickly and easily. :split or :vsplit and :tabf are all
commands I use frequently to not only open files when I need them, but browse
the filesystem quickly and easily.

2) Running external commands. While I understand it's possible to run external
commands with a key binding in SublimeText, I can simply drop into a shell
(:sh) or execute a command :! with just a few keystrokes in Vim, whenever I
want.

3) Since Vim runs in the terminal, it means that I can, very easily, perform
many things without having to use the mouse or alt-tab once. Uninterrupted
workflow is extremely important to me as a developer who tinkers with the
entire stack:

SSH into a remote box, manipulate some files and tail a log file for an error,
locate a file, edit it in Vim, hop into PostgreSQL to perform some queries,
fire up a local development server, test an HTTP response, see that it works,
create a quickfix file for all the changes, open them all in Vim, recheck
everything, push my changes up, restart the services, monitor the server with
the changes in place, ensure things are good, and exit.

I can do that all within the comfort of the terminal, where Vim runs for me.

To reiterate: I agree that SublimeText is a beautiful editor, but I don't see
how it could possibly replace the availability of Vim in my workflow.

~~~
graue
> _3) Since Vim runs in the terminal, it means that I can, very easily,
> perform many things without having to use the mouse or alt-tab once.
> Uninterrupted workflow is extremely important to me as a developer who
> tinkers with the entire stack:_

I have a stupid, but related question for the smart people of HN.

I find myself using Vim in the terminal, instead of GVim, for the same reason:
Ctrl-Z works, Ctrl-PgDn to the next terminal tab (and back: Ctrl-PgUp) works,
it doesn't pop up a new window when I run it, etc.

But GVim has much nicer colors (I picked my favorite out of about 50 themes),
and I can't get Vim in a terminal to look more than halfway decent. In the
terminal, colors are more distracting and hard on the eyes.

Is anyone aware of a way to get the best of both worlds, i.e. true-color
colorschemes in Vim in a terminal? To partially answer my own question, KDE's
Konsole seems to support true color[1], but before I install it I'd be curious
to know if Vim even works with that feature, and if there are any other,
preferably GTK-based, true-color terminals out there.

[1]: [https://github.com/robertknight/konsole/blob/master/user-
doc...](https://github.com/robertknight/konsole/blob/master/user-
doc/README.moreColors)

~~~
bigboehmboy
Check out
[http://www.reddit.com/r/vim/comments/17941z/is_there_any_way...](http://www.reddit.com/r/vim/comments/17941z/is_there_any_way_to_display_a_gui_colorscheme/)

~~~
graue
Thanks! This is the only response that actually answers the question. I'll try
Konsole with the linked vim patch.

------
terhechte
I've tried Sublime Text several times, but each time I went back to Vim. The
Vintage plugin just does not cut it for me; there're too many things that Vim
does, that Sublime cannot do. I couldn't live with EasyMotion, RelativeNumber,
the fantastic split window support, Gundo (Undo Tree), and much more.

Regarding the plugins he mentions, I see nothing special, all of that is also
available as Vim plugins:

5\. Vim Compatibility (Obviously in there)

4\. Keybindings in JSON are indeed nice, though imap / and friends in Vimrc
are ok, too. Using Vim+Python, one can also write Vim plugins in Python
(import vim).

3\. Vundle (<https://github.com/gmarik/vundle>) is a fantastic package manager
and reads GitHub repositories like<https://github.com/vim-scripts>. Adding a
new package is as simple as doing :Bundle 'vim-scripts/YankRing.vim'
:BundleInstall or :BundleSearch foo to find what's available.

The listed plugins: Git -> try Fugitive.vim it is awesome Emmett -> Also
available for Vim SublimeLinter -> Syntastic SublimeCodeIntel -> Clang
Complete

2\. Vim has built-in support for sessions via the :mksession command. Or, just
use the session.vim (<https://github.com/xolox/vim-session>) plugin, because
it makes it even easier.

1\. There's CommandT (<https://github.com/wincent/Command-T>), CtrlP
(<https://github.com/kien/ctrlp.vim>), Waldo
(<https://github.com/jtaby/Waldo>), FuzzyFinder (<https://github.com/vim-
scripts/FuzzyFinder>). And most offer much more functionality than just file,
directory, or buffer search.

I recently made the switch from Xcode to Vim (I mostly do Objective-C these
days) by getting Clang Complete running ([http://appventure.me/2013/01/use-
vim-as-xcode-alternative-io...](http://appventure.me/2013/01/use-vim-as-xcode-
alternative-ios-mac-cocoa.html)) so that I can use Vim full time and not only
for web and python stuff. I couldn't be happier.

~~~
lightyrs
Just installed this new EasyMotion plugin. Works well!

<https://github.com/tednaleid/sublime-EasyMotion>

~~~
tednaleid
Thanks, glad you like it!

------
spacelizard
I still have only used sublime text once, but I might try it out again soon
just to get a better idea of what these features are that make it so much
better. And them I'm going to add them into vim.

I think that it is a serious problem that sublime text is proprietary. While
it does support plugins, the one time I did use it I remember seeing several
messages from plugin authors complaining that the sublime API does not support
certain features that they wanted it to support, and that the sublime text
authors refused to implement them. So to that effect I really think there is
no benefit to using a proprietary text editor, no matter how many flashy
features it has. I would rather just improve vim (and encourage others to do
so) so that it is better than sublime text.

It also seems somewhat strange that sublime is proprietary considering how lax
their licensing policy is. It doesn't seem to me like there is any financial
or practical reason for it to be proprietary. To channel Stallman, the only
thing I can reasonably conclude is that the author intends to attack his own
users. It really disappoints me to see that this kind of project is being
promoted as a replacement for free software editors.

------
steevdave
I don't want to be "that guy" but the only thing really stopping me from
switching is the lack of an ARM Linux client. Heck, I'd even be willing to do
the work on it, but until I can use the same editor across all my machines,
I'll stick with vim. It ain't perfect but I can put it on all my machines (and
the Chromebook even comes with it, just have to switch to developer mode to
get access to it.)

But ST does look quite nice, I've played with it a few times, but never really
seriously looked at it.

~~~
quarterto
This. I'd love Sublime on a Raspberry Pi (or on my phone, once it's running
Ubuntu).

------
binderbizingdos
it's funny how people praise Sublime Text when plain old Emacs can do most of
the things that Sublime Text can:

> 5\. vim compatability!

evil-mode - a very advanced vi layer for emacs, probably much better than
vintage, I hear only good things about it although I use the standard emacs
mode

> 4\. Powerful Keybindings in JSON and Plugins in Python

powerful keybindings

    
    
      (global-set-key (kbd "<f2>") 'split-window-vertically)
      (global-set-key (kbd "<f3>") 'split-window-horizontally)
      (global-set-key (kbd "<f4>") 'delete-window)
      (global-set-key (kbd "<f5>") 'delete-other-windows)
    

and modes (plugins) in Elisp

> 3\. Package Manager and the More Centralized Community

since Emacs 24 a package manager is included and there are awesome repos for
all of your needs:

    
    
        (setq package-archives '((     "elpa" . "http://elpa.gnu.org/packages/")
                                 ("marmalade" . "http://marmalade-repo.org/packages/")
                                 (    "melpa" . "http://melpa.milkbox.net/packages/")))
    

after that run

    
    
        M-x list-packages
    

and choose from around 1000 packages

> 2\. Project Sessions

there are many modes that support that if you want it. I personally don't like
it though. "projectile" is pretty nice though:
<https://github.com/bbatsov/projectile>

> 1\. Ctrl+P - GotoAnything:

helm is what you would use on Emacs: <https://github.com/emacs-helm/helm>

it's awesome

~~~
martinced
That's my biggest issue with Emacs: there are more than one million lines of
elisp in circulation.

There isn't going to be any text editor come anywhere close to that.

I need something "programmable" so I'm "stuck" with Emacs.

I'm a bit bitter because sometimes (often actually) I wish Emacs was multi-
threaded, easier to interface with externals tools (to make it a bit more like
an IDE) -- that is, able to quickly invoke external tools without blocking
everything etc.

But I realize that Emacs is soooo big that it's probably going to take a long
time before we see a "modern" Emacs.

~~~
binderbizingdos
> I'm a bit bitter because sometimes (often actually) I wish Emacs was multi-
> threaded

Tony> \- Is multi-threading coming to emacs 25?

I don't know about Emacs 25, but I did manage to merge trunk to the
concurrency branch today. If you're interested you could try it out.

[http://lists.gnu.org/archive/html/emacs-
devel/2012-12/msg004...](http://lists.gnu.org/archive/html/emacs-
devel/2012-12/msg00465.html)

it looks like Emacs should soon (?) support concurrency

------
wting
I think trying to convert vim users is pretty futile. /r/vim/ brought up a lot
of issues with Sublime's vintage mode:

[http://www.reddit.com/r/vim/comments/17i5ps/from_a_vim_persp...](http://www.reddit.com/r/vim/comments/17i5ps/from_a_vim_perspective_what_do_you_think_about/c85p4wd)

------
coley
I don't think these current features + plugins 'body bag' vim. For instance,
is all of this vim 'body bagging' goodness available to you over SSH?

~~~
deltasquared
I agree, work over ssh or go home.

I am pretty sure I will be using Vim when Sublime goes the way of Textmate and
SlickEdit.

------
johncoltrane
So… we have a guy with what looks like a limited experience of tools A and B
writing an article full of hyperbole and factually wrong on how tool B kills
tool A.

Yes, tool B is a good tool. However I can't imagine a single reason why
anybody with a sizeable experience of tool A switch to tool B.

Newcomers who turned to tool A because it was trendy last year but never got
the hang of it, on the other hand…

------
klibertp
Is this supposed to be funny or what? I don't know Sublime, it probably has
some unique features but I don't see even a single feature like that in this
list. It's all - including point 5, VIM emulation mode - pretty much expected
from any modern editor. The last thing I used before switching to VIM was
Komodo IDE, which had everything mentioned in this list (and more because of
the "IDE" part, but that's irrelevant). I don't know for sure, but I suspect
things like Eclipse or Visual Studio these days have all these features too.

Really, we should stop saying that one particular tree is especially great
because it has green leaves. I sincerely believe that there ARE innovative,
interesting features added to many editors but I just don't have the time to
dig through tons of obvious things to read about the single feature that sets
given editor apart. I'm glad and happy that your editor does syntax
highlighting, code folding, autocompletes words and has a plugin system, it's
obvious, now can we move to the interesting part?

------
TallboyOne
No, these are not things that 'bodybag' vim at all.

~~~
visarga
But isn't it interesting that people talk like this, even if they are wrong?
Whoever talked about UltraEdit or BareBones in this fasion?

------
griffindy
Other than the central repository (which vim does lack, there are quite a few
plugins I'll admit), I don't see anything too different from vim, or am I just
missing something. not trying to be mean spirited, just curious.

~~~
lukeholder
You have almost everything VIM is awesome at + nicer non terminal based UI
niceties. Plus its really really fast. You get the code wall, really good
window manager, better project management and its also cross platform.

~~~
mayanksinghal

      Non Terminal Based UI Niceties: Use Gvim
      Cross Platform: So is vim/gvim. I use vim on Mac/Linux/Windows.
    

I love both vim and Sublime, so I would call 'Bodybagging' is flame-bait at
best.

~~~
sirclueless
Gvim has a lot of awkward hangups, in my opinion. Selecting text is still
weird, there's no context menu, etc. It's vim outside of a terminal, which is
great, but most full-fledged graphical editors take better advantage of their
environment than Gvim does.

~~~
_delirium
I agree with gvim being a bit basic. If you're on OSX, I think MacVim
(<http://code.google.com/p/macvim/>) is a much better choice. On Linux, I use
terminal vim and rely on the terminal for environmental integration: you can
choose from a dozen X terminals that will do almost anything you want.

------
speg
And just wait until Sublime 3 is ready.

<http://www.sublimetext.com/3>

~~~
ChikkaChiChi
Which negates all plugins until they are updated.

I've been a pico/pine user for almost 20 years and on OSX ST2 has been my
editor of choice for the past couple. I decided just this past week to force
myself into getting to know vim better because I hear how powerful it is.

Once you get a decent .vimrc going, it can be configured to be as good/better
than ST2. Its free. Its cross platform. Its easily usable over SSH.

So at least for me, vim > st2/st3.

~~~
kfinley
If you are just staring with VIM, I recommend taking a look at spf13-vim
(<https://github.com/spf13/spf13-vim>)

~~~
crazydiamond
I have been using vi/vim since 1989, and I found spf13 to be a totally
frustrating experience. Twice I tried it out and quit. It messes with settings
of neocomplcache (issues reported and verified with authors), it installs
plugins like autocomplete (??) which can also be frustrating. I had hunt
through the source of some 20 or more plugins to figure out the offending ones
and remove them.

However, that's just my experience. I'd suggest he try a clean vim and add
plugins as he needs them. There are plenty of links suggesting great plugins
for developers. "sjl" (steve losh) has an article which was linked here
(Coming Home to Vim) that mentions some good plugins.

~~~
kfinley
The reason that I suggest spf13, is because it shows what's possible. I spent
nearly a year building up a set of plugins and settings only to discover that
95% of what I had "discovered" was included.

I'm sure it has it's problems, but you can easily remove all of the included
bundles. I think at the very least it provides a well structured foundation to
built upon.

~~~
ChikkaChiChi
Thanks for the tips!

I've been studying other's .vimrc files in an effort to understand what all
vim vanilla is capable of. Once I get that dialed in, I'll look into plugins
for my local box; I just want to make sure that I can use it effectively just
by firing up any new VM.

Also, I'm being sacrilegious and setting myself up for primarily --INSERT--
mode, since its the most like a GUI text editor. Its making the barrier of
entry slightly more endurable!

~~~
crazydiamond
Sooner or later someone is going to tell you to put this in your .vimrc:

    
    
        inoremap  <Up>     <NOP>
        inoremap  <Down>   <NOP>
        inoremap  <Left>   <NOP>
        inoremap  <Right>  <NOP>
        noremap   <Up>     <NOP>
        noremap   <Down>   <NOP>
        noremap   <Left>   <NOP>
        noremap   <Right>  <NOP>
    

This will get you to stop using the arrow keys for moving around, use either
hjkl, or faster combinations such as "f" "t". Hope you get out of insert mode
soon!

------
DaNmarner
However "X" body bags Vim, I will never switch.

------
coca
:%s/SublimeText/Sublime Text/g

