
Vim as you IDE - haridas
http://haridas.in/vim-as-your-ide.html
======
kamaal
When will be the day when this sort of a thing gets shipped with the default
vim installation?

The reasons I say this is every time somebody brings up the apparent
ancientness of vim/emacs people point to something like this. I agree that all
this is doable, but you must realize tailoring a vanilla installation with
plugins to do all this is really difficult for most programmers. Especially if
you want newbies to start with using vim.

If people wanted to use an IDE, they would use an IDE- There are plenty
available these days. All it takes is going to go to the eclipse website, and
downloading one. Why in the world would any body spend hours(days?) hunting
all these basic plugins which are must have for today's software development
needs?

Somethings like auto complete in ST2 looks to just give what the user wants.
In vim you would be doomed press ctrl-n as and when you need it, but it
happens automatically with ST2.All these modern GUI based editors are
basically these many tiny optimization on old concepts .There is also that
file browser that gets opened by default on the left hand side. The minimap on
the right hand side. The search functionality using ctrl-p. These are few tiny
yet useful automations that should ship with vim/emacs by default. I see no
reason why they shouldn't. Apart from trying to sell themselves as endlessly
customizable editors, they must also do many of tiny day to day needs by
default.

Things like package managers, a proper good looking GUI et al are must have
things in any software tool these days. Arcane 80's style GUI, default tooling
support for software development needs going two decades back is not going to
fly.

~~~
eupharis

      Why in the world would any body spend hours(days?) hunting all these basic
      plugins which are must have for today's software development needs?
    

These plugins are "must haves" if you are used to using an IDE. But they are
not prerequisities of creating good software. Proof: plenty of good software
has been and is being created without such plugins.

You are used to the file browser on the left, the minimap on the right, the
search function bound just so. So you want that. But not all vim users are
used to that.

The simplicity of vim is what drew me. There aren't a hundred and one "project
files" (whatever those are) added to any bit of code I want to work on. There
aren't a hundred and one buttons everywhere. There is the code on the screen.
Nothing else.

Adding lots of extra file-trees and variable-lists and computer-guessing-what-
you-want-to-do in the default vim install seems like it would scare away more
users from vim than it would draw. For the modern GUI kid (like me and I
assume you), getting used to modes and the vim keybindings was hard enough.
Let the user add windows and features at her own pace, as she gets
comfortable.

One other thing before you write off the "arcane 80's style" editors:

The second fact that drew me to vim is that it was esteemed by men who I
respected.

Look at the powerful minds that have built such beautiful things with vim and
emacs. There are two explanations for their devotion to their editors:

1) They are used to vim/emacs. They like them because they are used to them.

2) They are technologists. They have an innate fascination with the novel, the
bold, the capacity for an innovative idea to change everything. Yet even with
this prejudice, they love truth enough not to sacrifice the old superior tool
for the new, fashionable one.

After the first few frustrated sessions with vim, where I cursed at it for not
behaving like a text editor "should" behave, I believed very strongly that
explanation 1 must be true.

But the power (sorry, that's the right word) I feel when I fire up vim grows
everyday. It grew today after reading this excellent blog post and discovering
some new, wonderful plugins. And everyday I grow more convinced that
explanation 2 drives the loyalty to vim.

~~~
haridas
I got your point. I explained the same thing on my summary portion of my blog.
I left eclipse for Vim was after seeing its advantage of basic mode based
editing. All others are just additions, you can add them when ever required.
Check this out also about my detailed explanation of how did that happen to me
- <http://haridas.in/how-i-came-in-to-vim.html>

~~~
skue
If you're coming from Eclipse, did you check out IntelliJ's VIM plugin?

I'm a decades-old Vim user, but I still fire up IntelliJ for Java Android
development. Java is less painful in an IDE that was designed for it, and with
the IntelliJ plugin it's like having one's cake and eating it too.

~~~
haridas
Cool. Right now I'm not in the java world, but it will be helpful to my
friends.

------
Legion
I think it's a Vim rite of passage to write these posts. Just reading this one
now makes me want to write my own, even though I know everyone has seen them a
million times and has little interest in my Vim special flower.

~~~
s00pcan
Would anyone be interested in a writeup of my setup? Arch Linux + xmonad +
tmux + urxvt + zsh + vim. No desktop environment, just a setup optimized for
reliable web development. I've been building this setup from scratch at work
and at home for the past year, so I've got most of the minor annoyances
figured out.

~~~
david_shaw
First off, I'm sure that with the (recent?) surge in "check out my super
efficient setup" posts, a write up of your config would be fairly well
received.

The _real_ reason I'm responding is to throw in my $0.02 that for those that
want an easy and efficient tiling window manager setup, but don't want to go
through the relative pain of xmonad, `awesome` is a great substitute. I've
used it for years now, and although my office hardware changed from an old-ish
ArchLinux box to a Macbook Pro, I'm still an avid fan of tiling WM's. Even on
OS X, the first app I install is always 'DoublePane' to mimic the
functionality. [1]

As efficient as vim shortcuts can make you while banging out code, I am a
_firm_ believer that most window managers are absolutely and completely
inefficient. Most people whom I convince to give a tiling, scriptable WM a try
never look back.

It's vim efficiency for _everything you do!_

[1] I'm not affiliated with DoublePane in any way, and there are alternatives
out there. That said, for $1.99 (last I checked), it does an incredible job of
increasing my efficiency on my Mac.

~~~
weaksauce
If you like DoublePane you might like size-up better. I use that and cinch but
I am considering a switch to Moom. It has even more interesting features and
combines the size-up features with cinch.

~~~
nilium
I've actually been looking for something like this, and Moom seems to do the
trick. It's got some nice customization, so I can at least set my own
shortcuts for different areas of the screen. It works really well since I
don't like straight 50/50 screen splits (I prefer a sort of pseudo-golden
ratio layout -- Moom can't do it precisely, but it's close enough).

Pretty good use of $10, I think, unless I suddenly need that $10 for an
emergency, like beer or coffee or a raw turkey. So, thanks, even if I'm stuck
without a supply of raw turkey for a week.

------
3amOpsGuy
Over the years I seem to have gone full circle with Vim. These days I lean
towards few or even no plugins - snipmate is the last plugin i'm struggling to
eliminate.

This is more than likely a factor of my environment though. I'm frequently
using Vim "away from home" so to speak.

Best approach for this i've found so far is to set a $VIMINIT on remote login
(i.e. an admittedly clunky combination of SendEnv set for Host * in
~/.ssh/config). Still on the lookout for a better way though.

------
SeanDav
I have been so spoiled. I have never been much of a Microsoft fan (except for
Excel, best software ever) but have done most of my development in C, C++, C#
using Microsoft IDE's which as everyone knows are pretty much the dogs
bollocks. I do Java development using Eclipse.

Always wanted to know what to use as a general purpose IDE that is ideally
cross platform and was looking for opinions on whether these VIM layouts might
be suitable?

~~~
sea6ear
Honestly, for an IDE replacement rather than just an editor, I'd suggest Emacs
rather than Vim.

Reasons:

* Emacs plays well with other programs, you can start other shells, language interpreters etc, from within Emacs and interact with them easily. There are some Vim plugins that try to enable this but I've always found them less satisfying.

* Emacs is usable in all the same scenarios as Vim (i.e. cross-platform, over ssh, dual GUI/Terminal ability, screen/tmux/dvtm compatible etc)

Random Thoughts:

Vim is an amazing editor but I've always found that these attempts to add
features to make it into an IDE cause it to start to feel clunky.

Emacs on the other hand, plugins generally work well (except when they don't).

Vim (or at least vi) is installed on basically every Unix install (and
available for install everywhere). Emacs is installable everywhere also but
setup generally takes a bit longer.

If you are going to use Emacs and you are intrigued by Vim style keybindings,
I've found Emacs Evil-mode to be one of the best Vim emulation packages that
I've tried (most Vim emulation packages will eventually cause frustration -
Evil mostly doesn't).

I find that I use Vim more when I'm switching between a lot of different
computers, and Emacs when I'm mostly developing on one stable computer setup.

So my workflow in a particular environment is usually, first install Vim so I
can get work done, and as I use the environment more I'll end up installing
Emacs and gradually switching over to it.

~~~
wildanimal
But if you look at Emacs-as-IDE route taken by EDE/CEDET suite, it's a kludgy
beast... (I don't know how large the EDE/CEDET user community is, but most
people I know forsake it in favor of the simpler facilities in Emacs).

------
njharman
If you're using a language that (practically) requires an IDE, or, you really
want what the modern idea of IDE is. You probably want to look elsewhere.

That, or grok that Unix is the IDE. Vim is just the editor component.

~~~
mhd
There's plenty of middle ground to stand on. By choosing vim alone, you
already deviated from Unix purism (rabid Unix purists aren't that happy with
bog-standard vi, either).

Saving round-trips to she shell ain't necessarily evil. Separate unix tools
are great, but e.g. presenting info in the editor is quite helpful. Ctags does
your parsing, but you can display it with tagbar. Language-specific tools do
linting, but you can display it in the editor with syntastic…

------
jcaimbridge
I love vim and I've used it for many years, but for programming I've found the
"code understanding" features of an IDE to be as valuable as the dexterity
that vim allows in terms of input and navigation. I do not simply mean syntax
checking--a baseline in my opinion, but more of things like inheritance
hierarchy navigation, refactoring of code (e.g. renaming all instances of a
particular local variable, a particular function, etc etc, without the risk of
a simple text substitution), mark occurrences (showing all of the reads and/or
writes of a particular the variable under the cursor in all views), and so on.
It is even better if your IDE can run parts of the compiler on the fly (an
instructor once told me that eclipse does this with java. However, I'm not
sure if it's feasible for something like C++ due to the complexity of the
language). And then you have all of the other features of the IDE at your
fingertips too (e.g. an integrated debugger or profiler).

A few years ago I searched high and low for something satisfactory that
combines the text editing/navigation of vim with the extremely useful features
of an IDE. The closest thing I could find for C++ was Netbeans combined with
the jVi plugin. The VIM functionality provided by such a setup is not _too_
barebones, and the IDE fills in the gaps where other VIM plugins may have been
used. There may be something better now, but I've grown accustomed to this
setup and it takes a substantial amount of time and effort to reroll.

There is also Eclipse CDT and the "eclim" plugin for it (which actually uses
an existing vim process. Since this means that all of the other vim
functionality and vim plugins work in tandem with the IDE, this is the ideal
setup), but I recall that there was much lacking with both Eclipse CDT and
"eclim" itself (I do not recall exactly what, but, again, this was a few years
ago). Things may be different now and I encourage anyone looking for something
similar to take a peek at both Netbeans with the jVi plugin and Eclipse CDT
with the eclim plugin.

------
prpatel
HAH, vim looks more and more like emacs :)

~~~
rit
As I recall, that was always the idea behind Vim. To bring the power and
flexibility the author appreciated in EMACS to the style and interface of Vi.

There's value to be found in taking the best of multiple worlds into one
product.

I for example, cut my teeth on Bill Joy VI, and the keystrokes are burned
permanently and naturally into my brain. I love the extra stuff that Vim gives
me, because it is a natural extension of that toolset that I started with.

------
saryant
I've been content with the Janus[1] extensions for about a year now but I just
added MiniBufExplorer and I'm really enjoying that.

I typically keep three panes open, one of which is NERDTree. Right now my
biggest gripe is the strange highlighting of the Play! framework's template
files. The files are name.scala.html which results in weird highlighting of
the inline Scala. I have yet to find a good solution (admittedly I haven't
looked in a while) to this but if someone knows of one I'd love to hear it.

[1] <https://github.com/carlhuda/janus>

~~~
haridas
I hope this would be helpful to you - <https://github.com/sjl>

------
kayoone
Everytime someone writes a post about vim we see these editor wars emerge
again and there seems no real solution, as it is mostly "use what works best
for you". There are amazing software engineers using vim, and others using
Eclipse with Java on Windows like notch or Visual Studio like John Carmack.
Use whats you feel comfortable with.

Personally i like the simplicity of vim for editing taks, i could see me
writing javascript or any other scripting language with it. But for complex
software i definately would miss the abilities of modern IDEs, be it only for
refactoring.

------
Derbasti
Funny. I was at more or less that point about two years ago. My desire for
more of that lead down a slippery slope that ended in Emacs. And for some
reason I am now coming full circle and realize that I don't actually require a
lot of these plugins any more.

I'm still trying to figure out why I feel that way.

------
spullara
If your IDE doesn't do isomorphic refactorings reliably it is really just an
editor.

------
pimentel
I didn't get how to get syntastic to check PEP8 compliance. I have it along
with pyflakes, and never seen such an error (I don't believe I'm that PEP8
compliant myself)

EDIT: oh, nevermind, just needed pip's flake8 package

------
googletron
this post might be interesting to some looking into zsh + vim + tmux

<http://www.mahdiyusuf.com/post/24784023641/beautiful-tools>

~~~
haridas
I tried zsh for a while after seeing its colorful features. But IMHO it lacks
command rendering and auto complete speed compared to bash.

------
jacobr
I really would like ctags to work well with JavaScript, but I'm using
require.js and Exuberant ctags really doesn't like that.

------
ww520
Shouldn't it be VIM + Shell as your IDE?

~~~
haridas
Hmm... That make sense. But the title should be a simple one.

------
drivebyacct2
Or I can use a text editor like TM2 or ST2 and turn on vim bindings and get
80% of the way there (that's a generous 20% for all of the vim hotkeys that
don't work in the emulated modes).

~~~
Legion
80%? Every attempt I make to use a Vim emulation mode doesn't get 20 seconds
without failing to replicate Vim behavior on even fairly basic things.

~~~
Derbasti
Then check out Evil for Emacs and ViEmu for Visual Studio.

ViEmu even supports something like nnoremap in its .viemurc.

Case in point: My first introduction to Vim was through ViEmu.

~~~
qu4z-2
Alternatively VsVim for Visual Studio. I prefer it, although I couldn't give
any reasons why.

It still fails the "Does it break flow by not implementing some feature or
other?" test fairly frequently though. First thing that comes to mind is that
while it has text objects, it seems to be lacking "tag" though (vit, not vi<).
Which is a shame, as it's quite useful for web dev.

------
mkramlich
I don't read tutorials written by people with bad English. Life's too short,
and too many better alternatives already exist.

~~~
state
I agree, but also find it hilarious that this title is on the front page.

~~~
petercooper
You'd almost think the mods on HN were more interested in screwing up useful
titles than fixing ones that are actually broken.

~~~
dpritchett
I like to tell myself it's a principled protest rather than heartless
moderation.

<http://en.wikipedia.org/wiki/Work-to-rule>

------
insertnickname
I'm sure the article is interesting, but the writing is awful.

~~~
haridas
Thanks for the feed back. Actually I'm not good at explaining things,Sorry
that's not an excuse. I'm always trying to improve my language and
presentation skill.

~~~
jufo
It's a great article. Assuming English isn't your first language, I think
@insertnickname is being unfair.

~~~
haridas
I feel happy about that. I want to know how I performing :).

