Sunday, December 20, 2009

entire file view of matching searches.

So I've been using IntelliJ a lot for my Java and groovy development lately and noticed a cool feature of its editor recently. When you do a search, a little tick mark is made along the area of the scroll bar for each match to your search. This is kinda cool as it gives you a general idea of how many matches there are in the file, and a general sense of where they are.

So I was thinking. I wanna do this in Vim. How? Well, if you have +signs support built could do as I did. This is what I got toward:

This works in the same general way: the green hilighted area essentially corresponds to the shows you what part of the whole file you are looking at right now. The little ticks show you where the other matches are in your file.

Anyway, I think its generally a cool idea. I've made a plugin that shows this stuff on the side whenever you have the 'hls' setting on. Whenever you move around the file it automatically updates so its generally correct. Still some bugs, but I'm working on it. You can try it out yourself from github.

General conclusions/thoughts:
  • vim-unit continues to rock. I'm almost to the point of considering going all ruby or all python for serious vim scripting though.
  • It sure would be nice if there were events you could subscribe to when your location changed in Vim. There is something for window sizes changing...but w/o this you're pretty much stuck using the CursorHold type cludges - which just feel like cludges unless you get your handler code really efficient (quit early, do as little as possible, set udpatetime high).
  • I wish MacVim supported images for +signs! I've checked out the MacVim project from git. If I get some free holiday time I'll definitely look into making images to get a more IntelliJ like result -- although I suppose the solution I have now is good in that it'd work on the console. Still.
  • Wouldn't it be sweet if you could have a left gutter +signs support as well as right gutter? IntelliJ really can tell you a lot by making use of them.
  • I'm thinking this +signs thing for code coverage tools would be kinda nice...have to look into that at some point...

Thursday, November 19, 2009

NetRW and MacVim

So since I upgraded to snow leopard I could have sworn that the netrw just stopped working. Every time I tried:

:e scp://somhost/somepath/file.txt

I would get some gobbly gook about not knowing how to handle a BufEnter event or some such thing with regard to "scp://".

I'm using Snapshot 50 since that works better than the last stable build (I recall some repainting issues). Well, it looks like maybe the snapshot doesn't include the netrw plugin. So I just downloaded it and installed it manually and all is good with the world, yeah!

:e ~/Downloads/netrw.vba.gz
:so %

Friday, September 04, 2009

YouTRACK: a bug tracker for the vim-ish?

I got an email yesterday from jetbrains, notifying me that their internal bugtracker YouTRACK has gone beta. "Try it out!", they tell me. Okay, I like jetbrains stuff, so I bit. I'm posting here about it because it kind of reminds me of my learning process with VIM. Back when I first started using VIM I remember that I suffered through the initial arcana: I couldn't do anything at first (it was hard), then I began to cotton on to the general concept (but I couldn't really do it), at last I could do things fast, and finally I wondered why it didn't have all those kitchen sink features other products have. Doesn't this sound sooo reminicent of using VIM?

If you have ever used VIM you probably remember struggling just to frickin...TYPE. Type anything at all. And then once you could actually do that, well - what about saving and exiting? Escape? :wq? Ahh...those first few baby steps. YouTrack totally hit me like that. Of course they provide GUI menus for everything but me being a VIMish user, I wasn't interested in the easy/slow way. I had to figure out how to do everything by hot-key only. After all, the speed what supposedly sets this bugtracker apart. The installation part was easy. Download the WAR, stick it in tomcat, and fire it up. Bam. Its up and running. Copy and paste the demo license from their website and I'm good to go until December 2nd (after which point I'll have to buy a commercial license if I actually like the thing? How much?? Who knows...we'll see).

I setup a couple small projects I'm currently working on (too small for a bug tracker - or rather, too small to be worth the trouble). First impression: interesting. There is a search window with type-ahead keywords that appear as you go. How do I make a new bug? Ah. A hotkey (and by mouse of course, but I'm ignoring that as I said).

I easily entered a couple bugs and a couple projects in the system. I'm working on a project and I want to pull up all the bugs, how do I do that? It takes me a couple minutes stumbling around with the search window to figure out what the syntax is "project: AA" - completion. Nice. So there were are - a couple bugs. How do I get from searching to modifying bugs? Durn durn durn I stumble on this for 20 minutes.

Ahah! ESCAPE! Of course. Wouldn't you know it would be the same key that is such a stumbling block in VIM too. Go figure. Once I figure that out, oh my god. Its the frickin easiest thing to add comments and tag bugs. A breeze. Very snappy. I'm loving that. I can now see myself setting up projects and adding bugs for trivial little projects in no time. Nice. Perhaps even todo lists in general. Quick modification of tab names, batch updates, etc. Power.

Of course, now that I'm enlightened, I have questions. Lots of questions. Kitchen sink type questions. Can I use external java/javascript to make mashups (say burn down charts, remotely add bugs say via my own applications, etc). Whats the best practice for agile delevelopment say? Integrate with other back end bug trackers like bugzilla or trac? As I keep playing with it over the next few weeks I'm sure I'll have more questions and comments. But so far I like it a lot. Just wish I knew what I'm gonna have to pay for the thing once they go commercial with it a few months down the road (ie, once I'm totally addicted).

Wednesday, March 04, 2009

Daniel in Nowhere: Put Searched results into a split window under VIM

Hey this looks pretty cool - every now and then I've wanted to see search results in a nice searchable list. Gonna have to try this plugin out:

Daniel in Nowhere: Put Searched results into a split window under VIM