Hacker News new | past | comments | ask | show | jobs | submit login
Sublime Text 2 plugin to show git commit history for selected line(s) of code (github.com/cbumgard)
108 points by chrisbumgardner on Feb 10, 2014 | hide | past | favorite | 44 comments



Disclaimer: I love ST and use it everyday and this is not against this plugin in particular, just the idea of extending your editor to be an IDE.

When people extend their text editor (be it sublime, vim, emacs) with all these (often outdated) plugins i am left wondering why there is still so much hate for IDEs ? I use IDEs from Jetbrains for most of my stuff and they do all these things oob with a consistent UI and are well tested. Why would i want to fiddle together my text editor with one-man plugins that often dont even work 100% ?

I love Sublime etc. for what it does best, which is editing text, but i still use IDEs for most of my coding so i dont have to think about configuring my editor all day.


Extensible editors like Sublime, vim and emacs, amongst others, let you program them easily. As a programmer this is useful.

This plugin is maybe 30 lines of code.

With 1,988 packages and 1,436 authors(in Sublime's case) they turn into customised IDE's that 2.15 million package users are using. If there is a bug, you can submit a patch, or fork a plugin - and people do. This means plugins can be fixed quickly and easily by many people if there is a need. Plugins compete against each other, and cooperate with each other in the same space.

The core stays simple, optimized, highly crafted, and stable. The innovation, and quick implementations of solutions to new problems happen inside plugins. High levels of integration is possible, and does happen within the plugins.

Check out Arduino-like, which turns Sublime into an Arduino IDE https://sublime.wbond.net/packages/Arduino-like%20IDE

An IDE is simply loading all the plugins at once, even the parts you don't need.


Yeah that sounds sweet in theory. In practice i would first have to learn python and get into the ST api before i could build my own plugin or fix existing ones, so that would probably take some time that i dont have. And while there are lots of plugins i found quite a few areas (C# for example) where plugins are there, but haven't been updated in a long time and don't work for certain aspects of the language etc. You can obviously work with them, but they don't exactly make me drop VS.

I also hardly no anyone that works with C#, Java or Objective-C without an IDE, because you lose a lot of productivity. I enjoy working with ST in JS/php and other dynamic languages though where intellisense etc does not matter too much.


I use ST for a Cocoa/OpenGL app, and love it much more than xcode. When you actually know what you are doing, all that auto-voodoo stuff just gets in the way.


Visual studio has to be the best ide I've ever had the pleasure of using. Sadly I'm not much of a fan of Microsoft or its technologies (C# is great if you're into that sort of thing.)

For me its all pretty simple, ides in Linux or Mac get in my way. That is the only reason. Sublime, vim. They take learning, yes you have to spend hours configuring over their lifetime of usage, yes you have to have a core understanding about how they work. But its worth it. They're fast - like blistering fast. Once they're setup to my liking: they get right the fuck out my way and take a back seat to writing code. They do exactly what I expect, and they do it exactly how I told them to do it. (Can you tell I'm a developer yet) They dont bug me about my syntax mid thought, they wait till I'm done and save or consciously call on them for a clean up.

Also as a personal opinion and an anecdotal one at that: eclipse and netbeans are pretty ugly, menu systems and configuration is done in XML. Why would any human want anything to do with that kind of thing? BTW I'd have something to say about xcode but its still loading...


I am a mac user myself and only use VS with Unity3D on Windows. But man, it has really turned my opinion about IDEs. Yes, even Jetbrains IDEs are slow compared to Sublime/vim but every time i have to explore a huge Api or framework to find out how things work i feel crippled by Sublime. For example in PHP i often need to know

- Which classes implement this interface ?

- What was the namespace of that class again ?

- take me to the definition of this (in a different file)

- show me uses of this function across the entire codebase

Yes you can also do all of that with some nifty search action in Sublime, but i don't think its as efficient.

When you work for example with a node or angular project that doesnt matter, i am happy with Sublime there, but i currently built a huge application on top of symfony2 in php with tons of third party libraries and in that case it just doesnt work well.


Sorry took so long to reply.

I hate to be one of those people who say you're doing it wrong but it sort of sounds like it. I manage just fine with cmd+p and large projects.

I would have to suggest installing a few plugins there are quite a lot of "perfect php sublime setup" blog posts around to give you ideas.

We have a large symfony install and a large api I work on and never really feel "I wish I had an ide" I guess to each their own. Sublime and vim are really what you make it. As for any tech, ides included you have to master them before you can get the most out of them.


Its easier to start from a lightweight text editor and add only what you need as opposed to start with an IDE and trim the fat, and pray it won't break.


Counter point: IDEs can provide a better experience for interacting with the myriad different tools we rely on as developers, through a consistent, unified, interface.

Jetbrains do go some way towards addressing the point you raise, with their language specific editors. I use a broad enough cross-section of those languages that I stick with IDEA ultimate, but my experiences with PyCharm, RubyMine and WebStorm have been nothing but positive.

Qualifier: All IDEs, and especially IDE interfaces, are not created equal!


Actually, the first time you start IntelliJ, it will walk you through all the plugins per category. If you don't select anything, you will mostly have the same effect.

Of course, the result won't be as light as Sublime text, because it is already a Java IDE :).

Also, I don't really see the point. I start or restart my IDE (IntelliJ) one time a week. So, it's not really the startup time that matters. Once started, IntelliJ is fast on all my machines (including my work iMac, which still has spinning platters).


> I start or restart my IDE (IntelliJ) one time a week. So, it's not really the startup time that matters.

So I assume you don't use your IDE for modifying local configuration files, or taking random notes, then. Startup time (and having multiple lightweight instances) is important in these cases.

People replace Notepad/vi with Sublime Text, in order to get all the benefits and power they're used to in Sublime Text when editing even the most mundane or ephemeral document. You can't really do that with IntelliJ.


This is my reason for using ST2 as well. I even bought PyCharm last year (the doomsday sale), but it was just too much. It has so many options that even basic ones had steep learning curve (as in "where the hell is this function?").

Note that I'm talking about personal use. If I were a full time developer, I might force myself into an IDE.


(as in "where the hell is this function?").

Command-shift-a, type some letters. Done :). It's pretty much like Command-shift-p in Sublime Text.


>When people extend their text editor (be it sublime, vim, emacs) with all these (often outdated) plugins i am left wondering why there is still so much hate for IDEs ?

Because most (all?) IDE's are slow. I've used Eclipse for years. Have also tried Idea and dabbled with NetBeans. I don't like their slow operation, nor they clunky UIs. And I don't find their speed, even today with an SSD and 8+GB of RAM, good enough. Tolerable might be a better word.

Plus their text-editing abilities leave a lot to be desired too.

>Why would i want to fiddle together my text editor with one-man plugins that often dont even work 100% ?

Well, my experience with IDEs is that their plugins and core functionality is not all roses either.


I can't speak for others, but for me, the main thing that has kept me away from IDEs is lag. Every IDE I've ever used (IDEA, Eclipse, NetBeans, Visual Studio) has always interrupted my workflow on a regular basis in order to recompile something or update some index or other.

In statically typed languages, that's often a tradeoff I'm happy to make; IDEs give you a lot more information than text editors in that case. But in a dynamically typed language, where I'll need to run the program to find errors anyway, the lag is just a nuisance.

As I've primarily worked in dynamic languages for the last several years, I've had no desire to put up with IDE lag for minimal gain.


It seems the main question here is cost/benefit. For me, IDEs provide a lot of useful tools. For example, I love being able to hit a single key to jump to the source definition of a function call. It makes it super easy to trace program flow. ST doesn't do that (ctags plugin doesn't really help).

IDEs can be great when they understand your code well enough to do things like renaming all uses of a function, refactoring, applying code-style formatting, highlighting errors in code (I've caught a lot of errors from co-workers that use ST, while my IDE clearly highlights the bug), etc.

In cases where code is harder to analyze, like JavaScript, IDEs can be far less useful.


IDEs are as good as MS Word is good for text editing. Many are a product of feature packing, not of good design. They pack so much garbage functionality, any feature that could possibly be used gets added. In a clean editor only the ones which are probably going to be used should be available. ST puts us in the management seat, and we choose which features we want on our text editor.


> I love Sublime etc. for what it does best, which is editing text, but i still use IDEs for most of my coding so i dont have to think about configuring my editor all day.

Because Vim ,Emacs or Sublime are easy to extend or hack. Try to extend VisualStudio or any Jetbrain IDE...

Because lightweight editors can open huge files without issues,try to open a 10 mo data/sql file in VS ... no problem with ST or VIM.

Because they run on older hardware.

Now you say some plugins are outdated , but it's easier to fix 20 lines of python than a C# or java project.

To sum up,if I want a new feature in ST or Vim I can code it myself quickly,I dont need to wait/pay for a new version of the editor.


IDE's tend to be very... well, 'integrated', or at least they were in the past. Emacs has worked well for me whatever language I happen to be using at the moment, be it C, Erlang, Ruby, Python, Tcl, SQL, HTML, Java, Javascript, Shell scripts, or PHP (fortunately, not lately).


One of the reasons I dislike IDEs is the same as the reason I dislike things like janus or oh-my-zsh, and the same reason that I removed my employer's 'source ...' from my vimrc at work. Poorly considered collections of nonsense that I don't want to be thrust into.

Furthermore, I select my plugins carefully with future-proofing as my number one priority. This means that I do not use (or at least certainly do not rely on) software that I am not confident will stick around at least until I retire or software that I could not reproduce if necessary. I am confident that Vim will stick around that long and I am confident that the plugins which I use with Vim will either continue to work, become obsolete when Vim absorbs their ideas, or are tools that I could recreate myself should future vim updates ever break them (this has not been happening so far).

In some cases, these constraints prove problematic. One example is web browsers. I have zero confidence that Firefox or Chrome will exist and/or be recognizable in even 10 years. I therefore do not rely on any special Firefox or Chrome functionality, particularly any plugins or extensions. Additionally I split my usage of the browsers evenly between the two in an attempt to ensure that I do not become reliant on Firefox or Chrome specific behavior or abilities that I may lose access to in the future.

My problem with Firefox/Chrome is a problem that I have with IDEs. They come and go, they change and "improve" over time in ways that are not backwards compatible from a UX perspective. I want none of that. A carpenter does not worry about the interface to his tablesaw changing in 10 years, forcing him learn a new set of skills to experience the same functionality. That sort of stability is what I strive for.

Edit: As for text editor plugins typically being out of date... I just checked. The most 'out of date' plugin that I have is actually just my colorscheme, having it's last commit on Fri Mar 2 14:59:51 2012 -0600. All of the rest have had commits in the past 6 months. A quarter of them have had updates in the past month.


I find that take quite interesting considering the rapid pace at which software and computing changes over time. I would expect that by the time I retire in 30 years that nothing that I do right now will exist or be at all relevant.

I use certain software right now for programming that is completely different than what I used even two years ago. I work in completely different technology stacks and completely different tools.

Why would restrict myself to only using a set of tools that I KNOW will existing 20-30 years? What happens when some breakthrough technology comes that comes with it's own stack and toolset? Do you ignore it or adapt?

I actually enjoy switching between various technologies and tools. You get a different perspective, learn new things, get out of the rut and into a new challenge.

I really hope that in 3 years I'm not using the same tools I am using today.


Vi style editing has lasted entire careers already, and provided "programming" remains at it's core a matter of manipulating text files, I see no reason for it to not last mine. The day the industry transitions to "LabView 2: Electric Boogaloo" is the day I tap out of the industry.

> I actually enjoy switching between various [...] tools

I guess that's the difference between you and I. I don't, at all. I find satisfaction in what I do, not how I do it. Learning new tools for no reason other than I picked the wrong one to learn five years ago and the developers of my old tool packed up shop is something that I think is to be avoided at all costs.

And to be clear, I am more than willing to pick up knew technology that I believe will have significant staying power. Git is an example; whatever version control system that will replace it in 10-15 years will look significantly like it. Git's CLI interface is not an example; I know how to do what I need to do in Git, I know how Git works 'under the hood', and I know how to teach myself the rest on demand, but I do not spend time memorizing the intricacies of the various flags to the various git commands. That knowledge will likely become useless in 10 years or less.


My problem with the IDEs I've used is they aren't very good at editing text (especially Eclipse).


> i still use IDEs for most of my coding so i dont have to think about configuring my editor all day.

If coding in a text editor causes you to think about configuring your text editor "all day", then you should definitely use an IDE. (Or see a therapist?)

I tweak my Emacs configuration about once per year.


I'm of the opinion that a well-engineered IDE is almost always better than a simple text editor. I "grew up" using Visual Studio on Windows. That said, I find myself using vim and Sublime Text fairly frequently.

Both are useful because they're universal for all languages, simple, quick, and pretty much are guaranteed to have a high base-line level of quality. vim is also useful because it's available on virtually every Unix machine, meaning I can use it on remote machines I've ssh'd into.

With these editors, I also think there's a certain pleasure in starting from a mostly blank slate and installing only the plugins you're personally interested in. The result feels less bloated because it's optimized for precisely one person: you.


I don't like IDEs because they are monolithic beasts that slow down everything that I want to do. There's a big difference between

* a giant that IDE that wants to own my code and my entire workflow and

* a little plugin for a text editor that shows me "git blame" output

Would you say that I should go without syntax highlighting because that's one step on the road to IDEs? No, of course I can pick the features I want a la carte.

Besides, what's it to you? If you like it, use it, if you don't, don't use it. Why criticise in the first place?


I've tried the last two major versions of PHPStorm and I just can't use it. On my Air with 4GB of RAM it struggles to even open a file. It's slow, sometimes unresponsive, and uses so much memory so my VM can't run on the same machine. If there was a 'Lite' version, I'd love to try it out. But the defacto PHP IDE can not run on my machine, which is why I stick with ST and plugins.


I personally run Sublime Text and an IDE at the same time (for static languages). I use Sublime Text for the majority of text editing and whip out the IDE when I want to explore an API. The IDE is also good for debugging and heck, it gives you a build system for free.


I don't know about your experience with Jetbrains IDEs, but I've found them to have very sluggish interfaces. Quite different from Vim or ST.


It doesn't seem to exist anymore: https://sublime.wbond.net/search/GitCommitMsg or in package control.

Will install it manually, seems a great trick!


In fact it is hasn't yet been accepted: https://github.com/wbond/package_control_channel/pull/2800


Ran into the same issue. Software authors should not put false installation instructions in the README - in this case, should have waited until the package is accepted before claiming it's installable from Package Control. At the very least, added a disclaimer "pending approval of the plugin."


Will this be available for ST 3 too or are there any incompatibilities stopping it from working on ST 3?


I've just tested GitCommitMsg in ST3 and the only problem seems to be the print function. I'll fix this up and send a PR.

Scratch that. There are a couple of API changes I believe, but I should be able to fix these too.

Edit: I can't even get the command to work for me.


Dammit, I was really excited about this too. Here's to hoping somebody reposts about it when the ST3 version is official...


Still going to fix it up?


Someone else has fixed it :)

I was about to push my changes even though the command doesn't work for me.


ST 3 compatibility would indeed be nice, we haven't used 2 for quite some time now.


Anyone have a screenshot of what this looks like in action?


It literally just opens up a new tab and shows you the git blame for the highlighted lines. Actually pretty handy.


There is a plugin (found within the package manager) called simply 'Git' that does this -- you just call Git Blame from the bar (CTRL SHIFT P) and it'll show you a line-by-line history of the whole file or selection.


This reminds me of the layers concept from https://www.destroyallsoftware.com/talks/a-whole-new-world


Hi all, works with ST3 now and is in Package Control. Only thing missing is Windows support (looking into it). Thanks for the comments and pull-requests :)


Does this work w/ Sublime Text 3 too?




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: