5 ms·
Vim as you IDE
- spullara 14y agoIf your IDE doesn't do isomorphic refactorings reliably it is really just an editor.
- kamaal 14y agoWhen 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.
- darkandbrooding 14y agoI guess I'd fall into the "Unix as an IDE" camp, so I'm glad that by default Vim is "just" an editor. I think it's great fun to see how people have tricked out their Vim installations, but I confess I view those custom Vim setups kind of like I do tricked out hot rods, or Burning Man art installations. I hope people never stop producing arbitrarily complex Vim installations, because software can be art.
- nfm 14y agoI respectfully disagree. Choosing to use a graphical IDE or a terminal based editor is a matter of personal preference; it's foolish to proclaim one or the other as universally superior. There are pros and cons to each, and they are fundamentally different in many ways. Yes, vim is old, but it's not a web browser - it's for manipulating text (or in our case, code), the process of which has changed little in the last 30 years. Before writing vim off, pair program with someone who is masterful at it and you'll see some if its many pros first hand. Yes, this may take (quite literally) years of use and customization to achieve, but no, it's certainly not something you can write off as obsolete or inferior.
- deleted 14y ago[deleted]
- kamaal 14y agoThis is the issue, if you a need a vim master and a couple of pair programming session to learn what vim is, you are doing it the wrong way. Why is it wrong to enable auto suggest by default? Or the file browser or minimap by default? Why not enable directory level grep/search by default? Why do you need to learn two decade old arcane 3 fold command sets for simple search-replace. Why aren't line numbers turned on by default? Why not provide tabbing by default? None of what I have mentioned is something uncommon to developers. Every developer needs to this almost everyday with his code. If you see modern day GUI based editors, they are basically designed to solve these daily little recurring annoyances and made available to you out of the box without you have to do to too much of tinkering. Like everything needs of developers change with time. Software usability is a very important aspect of software engineering. My primary concern is in assuming the usage of difficult tools as geeky and cool. By merely learning how to use a two decade difficult to use tool doesn't make a person a great programmer.
- barbs 14y agoI agree. I also prefer the approach of making an IDE "vim-like" by adding vim keybindings and such, rather than going the other way round.
- eupharis 14y agoWhy 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 14y agoI 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 http://haridas.in/how-i-came-in-to-vim.html
- slowpoke 14y ago>tailoring a vanilla installation >newbies to start with using vim. Sorry, but what? The very last thing a newbie programmer should be doing is configuring plugins. A newbie programmer doesn't need plugins. They only serve to confuse. Which is also why the very worst thing you can do to a newbie programmer is to give them an IDE. vim is perfect for newbies. It just works, and the defaults are mostly sane[1]. Yes, there's a slight learning curve, but you can do basic text editing (enough for writing any Hello World program and then some) after taking 20 minutes to do vimtutor, and from then on it just gets more powerful. You can add plugins when you actually need them. A newbie doesn't need plugins. They just need a good text editor - and vim (and Emacs) is the best you can get. No fancy editor or IDE of the week will ever change that. Not Eclipse, not Visual Studio, not ST2, nor whatever else. Another thing: I refuse to take anyone serious who even brings up the "argument" of "arcance 80's style GUIs" and/or "modern GUIs". Why? Because in the overwhelming majority of cases, that means "vim doesn't have drop shadows, it sucks"[2] (or some variation of that). Nobody even knows what a "modern" GUI is supposed to be. It's just a fuzzy way to say "I don't actually have any tangible arguments against $thing so I'm just going to accuse it of not fullfilling unwritten, non-existing standards that no one has ever agreed on.". Or in other words, bullshitting. [1]: Really, the only things I did when I started with vim was to ":set number" and ":syntax on", then put that in the .vimrc. That's it. Everything else was added on demand. [2]: Yes, I actually had someone trying to argue this to me. I closed the comment page and burst into laughter.
- kamaal 14y agoMy god, you make it look as though using vim is a goal for a programmer. While the actual goal is to use something like vim to do a job. The original argument is modern day editors aim to automate most recurring demands of a programmer out of the box. The point in most pro-vim/emacs arguments it to make you take the most difficult route to achieving text manipulation tasks. Hoping that will make you good at text manipulation over time. While the point is you are trying to gain a expertise which you don't need. Going by that argument you don't need any kind of an modern GUI ever. Why ATM's? Why graphically friendly email clients? And you could go like this for nearly everything. You need modern editors because you always need to take steps forward in the usability game.
- Legion 14y agoI 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 14y agoWould 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.
- dllthomas 14y agoI'd be mildly interested; Debian + ratpoison + screen + urxvt + vim, here, so there's bound to be similarities but differences might also be enlightening.
- tammer 14y agoI use precisely the same setup, and love it. Full control over every tool in the whole chain. I'd add one more that I find essential: Pentadactyl. Without it, the context switch when using a browser really disrupts the flow.
- s00pcan 14y agoI use Chromium + Vimium, which makes my entire workflow possible from the keyboard when doing backend development. I somehow managed to go a full productive day at work without touching my mouse (except to move it out of the way at the start of the day) while working on a drag-and-drop feature. Since you're using the same setup, do you have a dotfiles repo so I can take a look? Mine is kind of messed up at the moment, but here's an old revision with everything: https://github.com/chris-ritsen/dotfiles/tree/113442a72ddacb2ee89dc5c408c1b610eb7bfeaf https://github.com/chris-ritsen/dotfiles/tree/113442a72ddacb...
- prpatel 14y agoHAH, vim looks more and more like emacs :)
- rit 14y agoAs 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.
- mhd 14y agoWell, you've got to use your memory above the first 640K for something.
- insertnickname 14y agoI'm sure the article is interesting, but the writing is awful.
- haridas 14y agoThanks 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 14y agoIt's a great article. Assuming English isn't your first language, I think @insertnickname is being unfair.
- haridas 14y agoI feel happy about that. I want to know how I performing :).
- insertnickname 14y agoYou're right. I have apologized to OP.
- insertnickname 14y agoI hope you're not misinterpreting my criticism. I didn't mean to humiliate you or make fun of you, I was just trying to let you know that you should improve your writing skills. I am not a great writer, but I do try to do my best and I am sure you do the best you can too. If I was too harsh in my original comment – which it now seems that I was – I apologize.
- haridas 14y agoNo problem man. I understood that. :)
- tspiteri 14y agoMany times, improvements come from just iterating over the text and rewriting parts of it. Native speakers will need less iterations, and very few people can write really well the first time round.
- saryant 14y agoI'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 https://github.com/carlhuda/janus
- haridas 14y agoI hope this would be helpful to you - https://github.com/sjl https://github.com/sjl
- drivebyacct2 14y agoOr 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).
- bcrescimanno 14y agoWhat I've found with "vim modes" is that I get the wrong 80%. It's really about how you approach development; in my world, it's very editing-centric. For others, it's tool-centric. If I can get 100% of the editing environment I want with 80% of the tools I want, I'm happier than I would be with your suggestion which would be reversed.
- mhd 14y agoOr you can use a few plugins to get 80% of the "missing" features of something like TM2/ST2. Especially if terminal/cross-platform support is an issue. Whatever floats your boat, any half-way decent expandable editor should be able to emulate other editors features with some effort. Corollary: Whatever you do, there still will be some rabid CygnusEd fan complaining.
- Legion 14y ago80%? 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.
- weaksauce 14y agoWhat features do they fail on typically? Have you tried Xvim? It's far from perfect(still alpha) but it's got a lot going for it. It turns out Vim has a lot of features and it takes a while to get to a polished state.
- Derbasti 14y agoThen 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.
- njharman 14y agoIf 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.
- haridas 14y agoYou are absolutely correct. I started to use Vim as main editor (Around 6 Month) only after realizing the easiness of its command based editing, not looking after its plugins. I tried to explain that in the blog summary portion. Then why we need all those plugins ?. It just add extra features, who don't like it ?
- mhd 14y agoThere'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…
- thedeuce 14y agoI've switched FROM vim and all this crap to real IDE's and the productivity is much greater.
- googletron 14y agothis post might be interesting to some looking into zsh + vim + tmux http://www.mahdiyusuf.com/post/24784023641/beautiful-tools http://www.mahdiyusuf.com/post/24784023641/beautiful-tools
- haridas 14y agoI tried zsh for a while after seeing its colorful features. But IMHO it lacks command rendering and auto complete speed compared to bash.
- 3amOpsGuy 14y agoOver 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 14y agoI 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?
- mkmkmmmmm 14y agoI've found vim is the finest code editor I've ever used, but it's a crap IDE in terms of organizing a project, compiling, and debugging all from one software. Disclaimer A: I haven't spent a ton of time trying to make it an IDE, and B: I have the misfortune ;) of being an iPhone dev, and only Xcode plays nice with the devices and simulator. If anyone can prove me wrong, please, please, please do so, because vim is just awesome for editing code.
- terhechte 14y agoNot entirely true. Appcode, an alternative IDE, also works fine with development on devices and the simulator. I haven't heard of an open source plugin to do this yet, though. So no way to do that for vim. (There's a vim plugin for app code though, it's not perfect but ok).
- mkmkmmmmm 14y agoAh; I tried Appcode and hated it too much to get to debugging, but it is nice that someone's figured out how to interoperate.
- sea6ear 14y agoHonestly, 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.
- ww520 14y agoShouldn't it be VIM + Shell as your IDE?
- haridas 14y agoHmm... That make sense. But the title should be a simple one.
- pimentel 14y agoI 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
- mkramlich 14y agoI don't read tutorials written by people with bad English. Life's too short, and too many better alternatives already exist.
- state 14y agoI agree, but also find it hilarious that this title is on the front page.
- petercooper 14y agoYou'd almost think the mods on HN were more interested in screwing up useful titles than fixing ones that are actually broken.
- dpritchett 14y agoI like to tell myself it's a principled protest rather than heartless moderation. http://en.wikipedia.org/wiki/Work-to-rule http://en.wikipedia.org/wiki/Work-to-rule
- haridas 14y agoHa.. ha.. Actually I missed the 'r' while posting it on HN and I noticed it after an hour. No way to change the title. I tried to proof read my article to make it correct as much as possible.
- daviddaviddavid 14y ago"too many better alternatives already exist" This is utterly false. In academia you will find numerous peer-reviewed journals which have high percentages of non-native English speaking authors. You'd probably find many articles in such journals to contain "bad English". But they're often doing totally original research and so, no, better alternatives don't exist. We live in an era where English is the de-facto language of the internet and some of the most brilliant people aren't native speakers of English and so might be considered to have "bad English". Not reading their work seems like a perfect way to miss out on learning things you might not otherwise learn.
- Derbasti 14y agoFunny. 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.
- jcaimbridge 14y agoI 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.
- kayoone 14y agoEverytime 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.
- jacobr 14y agoI really would like ctags to work well with JavaScript, but I'm using require.js and Exuberant ctags really doesn't like that.