September 24, 2016

Your First Lesson In Vim | Introduction & Installation

21:20 Posted by Durga swaroop Perla , , No comments
This article is first in a series of Vim articles titled, "Your First Lesson In Vim". These are written with a single goal of extending the Vim community and teaching people about the awesomeness of the Vim editor. Vim though quite powerful has a bad rep for being hard to learn and hard to get started with. So, even when someone is interested in learning about Vim, that infamous learning curve seem to be scaring them off. Hopefully this series will put those fears to bed.

Warning : After going through all the articles in this series you will love Vim so much that you would like to have Vim style keyboard bindings everywhere, in your browser, in your mail client, in your shell and every other place which has a text input, which might not always be possible. So, Continue further at your own risk. YOU HAVE BEEN WARNED!

Vim is one of the best text editors available out there in the market. In fact it is one of the two best editors, the other being Emacs (This would be the last you'll see its name. From here on, it will be referred to as, The Editor which shall not be named ). Now you might be wondering, what about Sublime Text ? or Atom ? or some other flashy editor that's getting attention. My answer to that is very simple - East or West, Vim is the best. Don't get me wrong, editors like Sublime, Atom are good and I was a fan of Sublime myself. But to be called the best, a Text Editor needs to customizable, extensible and most importantly should have a huge community of users helping out each other. None of these editors can beat Vim in those areas. Apart from that Vim is really fast and robust. It can open huge files that make any other editor crash. It has builtin syntax support for hundred's of file types. It has a huge plugin base that both extend vim's functionality and add more functionality to do pretty much any thing you want. And that's just a few reasons why its the best.

Since you are reading this article, I assume that you're interested in learning about what Vim is and about what Vim does. So, Let's start with some brief history of how the Vim editor came to be.
  • In 1970's, Bill Joy developed ex editor for Unix which later came to be known as the Vi editor for having a Visual interface for editing.
  • 1987 - Stevie was developed as a clone of Vi for Atari ST systems. Stevie stands for 'ST Editor for Vi Enthusiasts'. The name might be a mouthful but the editor itself is quite popular.
  • 1988 - Vim (Vi IMitation) was created by Bram Moolenaar (Remember the name ..) as a port of Stevie for AmigaOS. Though started as an imitation, Vim quickly started to add several new features with support for multiple operating systems.
  • 1993 - Vim 2.0 released with name changed to 'Vi IMproved' because, by then Vim had a lot more features than original Vi.
    .        Fast forwarding history
  • 2006 - Vim 7.0 released with support for tabs, code completion, undo branching and a lot more
  • 2016 - Vim 8.0 released with a lot of exciting features like Asynchronous I/O, channels, Jobs, Timers, Packages and a lot more
(Shout out to for putting this information together)

So, as you can see from our brief Time travel, Vim has been around for almost 30 years. Now you might be asking yourself, why the heck is this editor still used today after almost 30 years. That's a good question and one that needs to answered right now :

Technology sure changes a lot and old things usually tend to get lost with all the new things that keep coming. But in the case of Vim or The Editor which shall not be named, that is simply not the case. They fall in to the category of "Old is Gold". These editors are written during the days when floppy disks and magnetic tapes were all the rage and hence are written to be memory efficient. Though Vim has changed a lot over the years to add countless new features, the fundamental idea of being light weight and memory efficient is still one of its big selling points. That is the reason why Vim managed to stay relevant through three decades and that is also the reason why it will continue to be relevant for more decades to come.

So, If that answer convinced you to stay the course and explore the exciting and enticing world of Vim, then Welcome aboard! Make sure to remember that this is the day you have decided to take your text editing to the next level by learning Vim.

Now that we know the history of Vim, its time to install Vim on your Computers. If you are rocking a Linux Operating system, chances are you already have a version of Vim pre-installed. So, check if it exists by typing vi or vim in the command line. If it is available, you should see a screen that looks something like this.

If you see this then Vim is already installed.

If you don't have it installed, don't worry. Vim is a freeware (correction: Charity ware) and so you can download it for free from Vim's official site Vim is available for pretty much every major Operating system out there. I heard that there is a version of Vim available even for Toasters. I have no idea who might use that, but its there if you need it. And this is another reason why people like vim so much.No matter the OS, they can be sure that their favorite editor is available. So, Just download vim for your operating system and install it.

And by the way, did I mention that Vim is primarily a terminal based program? It was initially designed to be run in terminals to access files on remote systems. A lot of people to this day, prefer the terminal version of Vim. But to those of you who like to have a Graphical User Interface (GUI) you've that available as well.

For windows users, it can be downloaded from the site. Look for Gvim (stands for Graphical Vim) For mac users, you can download Mac Vim which provides a good GUI experience. For Linux users, there are Gvim versions available for most of the distros. So, download the one suitable for your distribution.

If you have successfully installed Vim on your systems open Vim either in Terminal or the GUI and you should see a welcome screen similar to the picture above. If you got that, then Congratulations, you have the power of Vim with you now.

Don't forget what Uncle Ben said, "With great power comes, great responsibility". So, your responsibility as a Vim user is to spread the vim awesomeness with your co-workers and friends. It would be even better if you can share this article with them but that is entirely up to you. (Jedi mind tricks working implicitly)

And before we finish this article I will give you a sneak peak at the power of Vim and what you can do with it. Watch More Instantly better Vim by Damian Conway.
Conway is one of the Vim geniuses whom I admire a lot. This video gives you a small window in to the world of Vim and what Vim can do in the hands of a seasoned user. You might not be able to understand how Conway is doing his magic but that is completely fine. You obviously won't be able to understand Linux Kernel modules code right when you're starting to write Hello World programs. It takes time to excel at anything. This video is just to show you how the masters use Vim and you will be able to do that too once you've mastered it.

Well, That is all for this Introductory article. Will see you again in the next one. Until then, Happy Vimming!

For more Vim stuff :
Follow us on Facebook  for more interesting articles.

July 18, 2016

Using Tab Pages in Vim | Vim

05:30 Posted by Durga swaroop Perla , , , 1 comment
vim-logo-freblogg-tabsUsing Tabs (vim calls them tab pages) is one of the sure ways to increase your productivity. Vim Tabs are just like the tabs in your browsers. Each tab can have multiple splits (referred as windows in Vim's documentation). So, you can have multiple splits open in one tab and then you can have multiple tabs.

Tabs are a really handy way of grouping things together. So, I usually have multiple tabs open in any session. I have a main editor tab where i will have multiple splits open for the code I am looking at and since I work with a lot of data files, I will have one tab dedicated for the data-sets that I will be using for my program. And, then if required, I will have another tab open for any notes, info that I have previously noted down.

June 23, 2016

Word Count application with Apache Spark and Java

05:30 Posted by Durga swaroop Perla , , , , , 1 comment
Apache Spark is becoming ubiquitous by day and has been dubbed the next big thing in the Big Data world. Spark has been replacing MapReduce with its speed and scalability. In this Spark series we will try to solve various problems using Spark and Java.
Word count program is the big data equivalent of the classic Hello world program. The aim of this program is to scan a text file and display the number of times a word has occurred in that particular file. And for this word count application we will be using Apache spark 1.6 with Java 8.

June 19, 2016

Should a Sanders supporter vote for Hillary if she wins the nomination ?

If you are Bernie supporter  and you are unable to decide whether to vote for Hillary or not in the final elections (when Hillary gets the nomination), then this post will provide you some direction.

If someone is supporting Bernie Sanders it could be because of any of these two reasons :

  1. He wants to vote for someone outside the establishment
  2. He believes Bernie’s vision and ideals

Clinton Vs. Trump | Who will win?

If you had asked me this question a couple of months ago or even just a month ago, my answer would have been Hillary Clinton without any but’s and if’s attached. But now, Its quite unclear.

I have been following this election from the beginning and I predicted it would be Hillary Clinton Vs. Trump for the final, long before others did. And, I assumed Hillary would win it in the finals very comfortably. But, What a ride it has been! It has become such a close call these days and rightfully so.

Apache Spark | Map and FlatMap

03:12 Posted by Durga swaroop Perla , , , , No comments
Map and FlatMap functions transform one collection in to another just like the map and flatmap functions in several other functional languages. In the context of Apache Spark, they transform one RDD in to another RDD.

Here is how they differ from each other.

Quick Vim Tips

02:59 Posted by Durga swaroop Perla , , , , No comments
Vim is one of the most powerful text editors available. And, hence it is not really possible for everyone to know everything or get the same ideas on improving their work experience. And, so this article includes a few tips and handy shortcuts that will help your productivity just as we have been doing in the Vim series, but individually not extensive enough to get their own dedicated article.

So, here are some useful tips for Vim