Skip to main content

Mobomo webinars-now on demand! | learn more.

Our developers tend to have interesting conversations throughout the day in Socialspring Stream, our communication and collaboration application. It occurred to me today that it would make sense to take some of the useful tidbits of information that surface there and share them with the rest of the development community! After all, the conversations are captured already - all I need to do is bundle up the relevant bits of information and serve them to you via our blog; in other words, expect more quick posts of tips and tricks here!

Fast Project Searching With Ack

You can set ack to be grep within vim, in order to make searching within your project faster and more effective. It’s a great programmer search tool. Here’s how:

  • Install ack (instructions found here)
  • Then in your .vimrc file “set grepprg=ack”.
  • Then whenever you “:grep ” vim will use ack instead of grep!

Why would you do this? Because its so much faster! BetterThanGrep cites these reasons (among others) in this list on their site (full list here):

Top 10 reasons to use ack instead of grep
  • It's blazingly fast because it only searches the stuff you want searched
  • ack is pure Perl, so it runs on Windows just fine. It has no dependencies other than Perl 5.
  • Searches recursively through directories by default, while ignoring .svn, CVS and other VCS directories.
  • Ignoring .svn directories means that ack is faster than grep for searching through trees.
  • Which would you rather type?
    • $ grep pattern $(find . -type f | grep -v '.svn')
    • $ ack pattern
  • ack ignores most of the crap you don't want to search
    • VCS directories
    • blib, the Perl build directory
    • backup files like foo~ and #foo#
    • binary files, core dumps, etc

Today's Vim tip was brought to you by Adam Bair, who was giving another developer advice on grepping over a project directory. Check back often for more tips, or follow us on Twitter for timely notifications about similar tips and tricks!

Categories
Author

Every Friday at 4:00 pm, the Intridea team takes pause from the pressing tasks in which we are immersed. For an hour we set aside open tickets, bug fixes, running tests, reading code, and writing emails, except for the most urgent requests. From different parts of the country we pick up the phone and join one another in what we call, “Coffee Hour.”

While not everyone that joins in on the call is necessarily drinking a cup of coffee, the term “coffee hour” embodies the spirit of what happens during that hour. The format is not rigid and no one is mandated to be there. Team members jump in on the call as they can; often times Coffee Hour starts out with only a couple of people and then grows in size throughout the hour, especially if someone is engaging us with an interesting topic of discussion. Flip is usually the one to ping people in Presently throughout the week for topic ideas, and by Friday morning there are generally 2-3 talking points setup for that afternoon’s Coffee Hour.

One of the most popular Coffee Hour sessions was in February when Michael and Potsiadlo shared their techniques for logo creation. Michael created a logo on the fly and talked us through his process for creating it; he covered previewing fonts, how to do font selection for a logo, how to create shapes and modify them, and how to apply subtle effects to enhance an image.

Afterward, Potsiadlo showed us how he designs a logo; he starts off with an idea and branches off of that idea multiple times until the perfect design emerges. When he is finished, you can see the entire ancestry of his design in the same document.

During another Coffee Hour, Flip presented Oria, an open source key-value store that he wrote in Ruby. The following week, Pradeep presented on Apache Camel and Llama, his implementation of Camel in Ruby. The next week Michael presented on NoSQL, Redis, CouchDB, and Cassandra.

We didn’t have anything scheduled for last Friday’s Coffee Hour and only a few people were able to attend. Adam started talking about screen and then showed us how to use it on a remote box using SSH. This got Flip (a Textmate user) asking about Vim so Adam took the opportunity to explain the hype. Adam showed us screen splits, movements, how to navigate through a project, basic usage of ctags, gave a quick demo of the NERD_tree plugin, a demo of NERD_commenter, a demo of fugitive for git, a little rails.vim, block editing, explained tabs and buffers and their differences and gave a rundown of Vim configuration. He pointed us to Derek Wyatt’s site which has awesome tutorial videos on Vim.

While there are usually a couple of topics prepped in advance for the Coffee Hour it’s still a very loose format and people are free to bring up other topics or just use the time to talk about their week, a project they’ve been working on, get advice, or just listen in. It is a small but important bit of time set aside each week for us to gather in the virtual “break room” and talk shop. It is a weekly ritual that brings our voices to each other’s offices and reinforces the humanity of our working relationships while affording us the opportunity to share our knowledge and experience.

Categories
Author
1
Subscribe to Vim