Little Known Vim Command – Join

As the author of Mastering Vim Quickly I sometimes get various Vim related questions from my readers.

Much more often I get emails from my subscribers at where I share free Vim tips.

Although this command is very simple, my experience showed that a lot of people are not aware of it. So it’s time to try to change that :)

Yesterday I was contacted by one of my readers – and as always, I try to answer my readers as soon as possible.

mastering vim quickly


As you can see from the screenshot, he needed to get from this

postscore(font, number, color,

to this:

postscore(font, number, color,
lang, size)

He knew that there must be a better way, than going to Insert mode, and using arrow keys and Backspace. And there is.

The solution to this is simple – put your cursor anywhere on the line where lang, is, and hit J (Shift+j). That’s a join command. For more info see :help J

So, whenever you want to merge two lines into one, position the cursor anywhere on the first line, and press J to join the two lines. Simple as that :)

If you liked the post, we should get connected - follow me on Twitter

Lessons learned after 300 books in 4 years

Four years.

Three hundred (mostly nonfiction) books.

There are a few simple lessons I learned after reading all of those.
They might seem too obvious, but aren’t all the great truths simple?

Anyway, here they are:

  • It’s much better to read the best book on the topic 5 times, than to read 5 different books on the topic once.
  • Eyes that pay read better than eyes that don’t. Eyes that pay more read better than eyes that pay less. In other words, when you pay for a book or a course, you’ll dedicate more to it, so you’ll get more value from it.
  • Good books can offer you a lot of great ideas and useful knowledge. You can’t apply or adopt all of it in your life. Focusing on 3 ideas from which you can benefit in a near future is the best thing you can do.
  • If you read ~1h (almost) every day, you’ll be able to read 60-80 books per year.
  • When you read a lot, you’ll forget a lot. Make notes about the most important ideas and knowledge you get from books you’ve read.

Also, I find this quote very interesting:

“In my whole life, I have known no wise people (over a broad subject matter area) who didn’t read all the time—none. Zero. You’d be amazed at how much Warren reads – and how much I read. My children laugh at me. They think I’m a book with a couple of legs sticking out.”

Charles Munger, the billionaire business partner of Warren Buffett and the Vice Chairman at Berkshire Hathaway.

Happy reading! :)

If you liked the post, we should get connected - follow me on Twitter

5 Phases of Vim Use


1. WTF is going on here?


2. Hmm… this is cool. I want to see other interesting features this thing has.


3. OMG. <mind blown>


4. The worst thing about Vim…



5. I’m actually a wizard… and this is how I feel when someone sees me using Vim




Over the years, Vim got a reputation that it’s really difficult to learn it. I’ve heard many times from guys who are convinced it will take them months to reach proficiency. That’s simply wrong.

That’s why I wrote a book: Mastering Vim Quickly (from WTF to OMG in no time) which will teach you Vim the way I learned it – easily and quickly.


If you liked the post, we should get connected - follow me on Twitter

The History of Vim

What is Vim?

If, for some strange reason, you don’t know what Vim is, here’s the short answer:

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. Vim is distributed free as charityware.  –


You should also know that Vim (a contraction of Vi IMproved) is a text editor written by Bram Moolenaar and first released publicly in 1991. Based on the vi editor common to Unix-like systems, Vim is designed for use both from a command line interface and as a standalone application in a graphical user interface.

Simply saying, Vim is a powerful text editor for programmers, power users and command-line gurus.


The History of Vim

When Bram Moolenaar had bought an Amiga computer, he wanted to use the editor he learned on Unix. Since there was no good Vi for the Amiga, he started with the best that was available (a program called Stevie) and started improving it.

At first, his goal was to imitate Vi. Later new functionality was added, and  by version 1.22 Vim included more features than Vi. That time it was renamed from Vi IMitation to Vi IMproved. Over time the gap has grown wider, now it’s hard to think of a reason to use Vi instead of Vim. I would recommend all Vi users to switch to Vim.

Of course, ports to various operating systems have been done by different people. The port to Unix was a milestone, since Vim started competing with Vi. Currently Vim runs on more than a dozen different operating systems. That is awesome indeed.

Vim was made such that it works on many different operating systems. This wasn’t easy. Just supporting the most popular Unix versions is already a big task. Adding support for MS-DOS and MS-Windows gives the additional problem of using file names with a backslash in them. Machines such as the Amiga and the Macintosh have a different kind of operating system, which require specific solutions. – Bram Moolenaar for Free Software Magazine


The first version of Vim that was released to the general public was 1.14, which was published on November 2, 1991. Over time Vim has grown constantly. It has become a complex program. Adding functionality is taking much more effort now than before.

Here’s the timeline of Vim development:

1988       Vim 1.0     Vi IMitation on the Amiga
1991       Vim 1.14    First public release (on Fred Fish disk #591)
1992       Vim 1.22   Port to Unix, renamed to Vi IMproved
1994       Vim 3.0     Multiple windows
1996       Vim 4.0     GUI
1998       Vim 5.0     Syntax highlighting
2001       Vim 6.0      Folding, multi-language
2006       Vim 7.0      On the fly spell checker, support for tabs

The list shows only the most important features, but each version brought us a lot of nice features. For example, if we take version 6.0: the major new feature was folding. But, there were other great features such as UTF-8 support, multi-language support (translated messages and menus), vertical window split, improved performance for syntax highlighting, etc.

Vim has grown to an big open source project, but it’s also important to mention that it’s charityware. The basic idea with charityware is that everybody who uses Vim is asked to donate to a charity. Thus the use of Vim is free, if you think it’s worth something, you can give that money to a good cause.  Moolenaar helped with establishing a foundation called ICCF Holland that works to support to a children’s center in Uganda.


Vim today

Unlike the other vi clones, Vim is still actively developed and has a large base of contributors. New features are still being developed and added to the text editor every year, making it even more powerful. Besides that, number of Vim plugins is rapidly growing.

At the moment, Vim 7.4 is the latest stable version. It is highly recommended to update your Vim if you didn’t, because many bugs have been fixed since 7.2 and earlier.

Vim has been my editor of choice since 2008, few months after Linux became my main desktop operating system. In a meanwhile, I have changed few different distributions of Linux, but Vim was always there.

I’ve used it to write many lines of code, edit lots of configuration files, and write tons of documentation. Although I’ve tried to use some of the modern text editors, I haven’t found any that match Vim’s efficiency.

I’m not the only one who, after using Vim almost every day for so many years, is still discovering new features, capabilities, and useful tips that further improve my productivity.

At the moment, my favorite work environment is Gentoo with i3 window manageroh-my-zsh and Vim. I have never been more productive.

Over the years, Vim got a reputation – that it’s really difficult to learn it. I’ve heard many times from guys who are convinced it will take them months to reach proficiency. That’s simply wrong.

That’s why I’ve started to write a book: Mastering Vim Quickly (from WTF to OMG in no time) which will teach you Vim the way I learned it – easily and quickly.

Sign up below for updates about the book.


If you liked the post, we should get connected - follow me on Twitter

How to install Apache (with SSL) + WebDav on Ubuntu

Installing Apache with SSL

$ sudo apt-get install apache2 libapache2-mod-auth-mysql

Then, setup and generate a cerfitecate for the web server:

$ sudo openssl genrsa -des3 -out server.key 1024

You’ll be asked to enter a pass phrase.

$ sudo openssl rsa -in server.key -out server.key.insecure

You’ll be asked for the pass parse you used in the previous step.

This command generates the certificate you will be asked to fill in some details:

$ sudo openssl req -new -key server.key -out server.csr
$ sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

The certificate now need coping in to the SSL directory:

$ sudo cp server.crt /etc/ssl/certs
$ sudo cp server.key /etc/ssl/private

Now wee need to enable to SSL site:

$ sudo a2enmod ssl
$ sudo a2ensite default-ssl

The web server needs to be restarted for the change to take place:

$ sudo /etc/init.d/apache2 restart

Now, you should now be able to access the server by typing https://ip_address in your browser.

You’ll get a certificate warning about it not being from a trust source you need to click on more details to check that it is the right computer you are connecting to.

Installing WebDAV

First you need to enable WebDav modules:

$ sudo a2enmod dav_fs
$ sudo a2enmod dav

You need to create a directory to share. For example, it can be in /home/user:

$ mkdir webdav

We need to give the web server and the user access to the WebDav directory:

$sudo chown www-data:user /home/user/webdav

Next we have to setup a password:

$ sudo a2enmod auth_digest

Create a directory where you will store your password files:

$ sudo mkdir /etc/password

Create the password file like this (WebDavCloud is the AuthName, and user1 is actual username for accessing the WebDav):

$ sudo htdigest -c /etc/password/digest-password WebDavCloud user1

You will be asked to type in a password. Select a strong password, you will use it for accessing to your WebDav directory.

Now we need to edit the default-ssl config files:

$ sudo vim /etc/apache2/sites-enabled/default-ssl

You need to find the part of the file that says:

CustomLog /var/log/apache2/ssl_access.log combined

and under that you need to place the following in to the file

Alias /webdav /home/user/webdav
<Directory /home/user/webdav/>
 Options Indexes MultiViews
 AllowOverride None
 Order allow,deny
 allow from all
<Location /webdav>
 AuthType Digest
 AuthName "WebDavCloud"
 AuthUserFile /etc/password/digest-password
 Require valid-user

Now you need to restart the Apache:

$ sudo /etc/init.d/apache2 restart

You should now be able to access the WebDAV folder by going to https://ip_address/webdav

Note: If you would like to map your WebDav directory as a network drive from Windows, it’s most likely that you will have big problems. If you want to use WebDav from Windows, you will need to buy a commercial certificate and use it instead of self-generated certificate.


If you liked the post, we should get connected - follow me on Twitter

30 Day challenge – Stay out of social media

Yesterday I was reading post from Matt Cutts about his last 30 day challenge, so I decided to take one as well.

For the next 30 days, I will not visit Facebook, Twitter and social media in general. Also, I will stop with reading online articles, and I’ll try to minimize my email activities. Instead, I will study and read more books.

Next blog post I will write in 30 days, and tell you about my results.

The challenge starts today at noon ( meaning, in about 40 minutes ).

If you liked the post, we should get connected - follow me on Twitter