Comments in Vim – The Effective way

Two days ago, a colleague of mine came to me with a question. He just started using Vim, so he’s a total beginner. He needed to comment random lines in a big configuration file. Another colleague of mine already recommended him a great plugin vim-commentary.

The problem was, that my colleague was a beginner with Vim. He still didn’t know how to install a Vim plugin, and he wanted to complete his work quickly. So no time for learning how to install a plugin and how to use it.

As I always try to spread the word about Vim as much as I can, I quickly came up with solution which worked for him. He actually really liked it. (and we got another Vim user! :) )

You might find it useful, when you need to comment or uncomment lots of random lines. And you don’t have or don’t want the help of any plugin.

All you need to do is to add these two lines to your .vimrc:

map ic :s/^/#/g<CR>:let @/ = ""<CR>
map rc :s/^#//g<CR>:let @/ = ""<CR>

ic (insert comment) will insert # at the beginning of the line.
rc (remove comment) will remove # at from the beginning of the line.

Change ic and rc to fit your needs, and enjoy ;)


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.

If you want to get updates and sample content from the book, leave me your email below, and I’ll make sure to keep you updated. You could also go to Mastering Vim Quickly page and check it out.


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

Practical ways for boosting your productivity online

A while ago, I’ve noticed that I lose a lot of time online. Some of the websites I visit regularly include Twitter, Hacker News, ProductHunt, and Facebook. Over the last year, I’ve managed to drastically improve my productivity online, and stop wasting my time.

Here’s the list of “tips” I’m using to stay informed about the things I’m interested about, and don’t lose too much of my time on it:

Facebook

1. Turn off the chat.

2. Don’t comment on random posts. Don’t get into discussions which are not directly related to you. You will rarely get any value from a discussion, and you will never convince anyone to think differently with just a few comments.

These two tips work incredible for me. It’s enough to go to Facebook for ~5 minutes every second day and see the updates.

Twitter

1. The same here, don’t go into pointless discussions, except if you are giving or getting some value from the conversation.

2. Don’t check your Twitter timeline few (hundred?) times per day. Use a free web app called Social Hunt to follow the most interesting people. Then, you can choose to get to your inbox all of their tweets daily.

Huge time saver.

HackerNews and ProductHunt

1. If you’re like me, a fan of HackerNews, you might catch yourself checking it really often. In order to get the best posts once a week to your inbox, sign up to this free HackerNews newsletter. It’s awesome indeed.

2. If you want to get the best posts from HackerNews daily, then I would suggest you to add @HNTweets to Social Hunt account mentioned above.

3. If you’re a fan of ProductHunt as well, you can sign up to their newsletter. It’s great. Additionally, you can follow @ProductHunt and Ryan Hoover (Founder of ProductHunt) via Social Hunt app, to stay updated on a daily basis.

 

These are some of the best ways I use to get updated on the things I’m interested about, and stay productive. What are yours?


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

Why Vim – 21 Reasons to Learn Vim

 

After writing about the history of Vim, I wrote a post where I told you what you can expect from my upcoming book Mastering Vim Quickly.

Today, I will try to mention as many as possible reasons to learn Vim. So, if you’re a beginner with Vim and you’re not sure should you keep learning it, or if you only think about learning Vim, this post if for you.

This post is not going to cover awesome Vim features as reasons to learn Vim, so if this is what you expect, don’t lose your time on reading.

So, here is the list of reasons why to learn Vim:

  1. Vi is guaranteed to exist on all Unix systems and exists on most Linux ones as well. That kind of broad coverage makes learning it worth it – because, if you know Vim then you know Vi as well.

  2. Vim is free and has a vibrant community

  3. Vim works over telnet & SSH connections. There’s no better way to edit files remotely via terminal than using Vim. Sysadmins know this.

  4. Vim’s configuration is portable. You just need to copy a few directories and files, and that’s all.

  5. Vim compiles/has precompiled binaries for almost every OS out there. You will never have to post “I need a [some text editor] alternative for [some OS]” anymore. You’ll have Vim instead!

  6. It’s also usually very fast and lightweight even when editing huge files of source code. Seriously huge.

  7. If you’re a programmer who edits a lot of text, then it’s important to learn an serious text editor like Vim. Serious text editors are highly optimized to perform the kinds of tasks that you will be doing a lot. For example, adding the same bit of text to the end of every line is trivial in Vim, but ridiculously tiresome otherwise.

  8. If you plan to configure anything in a Unix based system likelihood is you going to be editing a fair few config files, therefore you’ll want to learn a terminal based editor, of which Vim is one of the best.

  9. Vim allows you to easily code without taking your hands off the keyboard.

  10. Your fingers very rarely have to leave the home row, which means you’ll be able to edit text very, very quickly.

  11. It starts up faster than any IDE or text editor I’ve used, and it has many powerful features.

  12. It helps you focus on the coding process itself, you won’t be using the mouse at all to deal with it, that’ll save you a lot of time when you’re just writing code.

  13. It’s fun! Editing text is like a game to me now. I sincerely enjoy it – which is pretty ridiculous, when you think about it.

  14. If you’re working remotely, there is no choice to use Eclipse or similar GTK based IDE. You can do everything with Vim: source control, SQL, debug, compile, browsing – really fast browsing even over 1 GB source code. Visual Studio or Eclipse couldn’t handle all of this.

  15. There are a lot of good plugins out there which add a lot of functionality.

  16. Vim is a really good tool once you familiarize yourself with it.

  17. It has a reputation for the quality and the completeness of its docs. That’s true. Vim is thoroughly documented. You will find most of the  answers to your questions in its help system as soon as you will manage to stick the proper keywords in your help queries.

  18. You might want to learn Vim because many people think it is cool.

  19. You don’t have to press Ctrl or Alt all the time in order to run commands or shortcuts.

  20. It’s much quicker to use vi for a sudo edit: $ sudo vi. For example, if you run text editor 100 times a day, with typing sudo emacs, you’ll have to make 300 keypresses more! Okay, this is a joke :) chill out emacs guys (and yes, I know that there’s something like alias :) )

  21. Vim is addictive. You will find yourself wishing you could use Vim commands in all your computing, and cursing whenever you can’t. For example, I use Google Chrome with Vimium extension, so I surf the Internet without a mouse or touchpad. How cool is that!

On the end, have have to add that Vim’s usefulness depends on what you’re working with. If you’re an Java/C#/etc developer, you’ll most probably be more comfortable with an IDE.

But if you work with Python, Perl, Ruby, C, web, etc. or you’re a system admin/devops, Vim is the way to go. Vim is fast, powerful and does everything you need.


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.

If you want to get updates and sample content from the book, leave me your email below, and I’ll make sure to keep you updated. You could also go to Mastering Vim Quickly page and check it out.

[mc4wp_form]


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

Mass manipulation and the 5 monkeys experiment

Social control and technology to manipulate the masses, both at local and global level is a serious topic. There are numerous manipulation methods applied for decades. The fact is that with each following generation of people, those methods achieve better results. If you don’t know a lot about this topic, for beginning you can read this.

Then, take a look at one experiment:

 

Quite interesting. And now just think – did you ever wonder why you ( and people around you ) follow some matrix even you think that it’s stupid or you know a better way, did you ever follow some rules no matter they make no sense to you, … ? Who created those matrix, those rules, etc?

Are we just a group monkeys?

 


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

The Success of Introverts vs. Extroverts

New research from Adam Grant, the youngest tenured professor at the University of Pennsylvania’s Wharton School of Management, is really intriguing. In his study, Grant collected data from sales representatives at a software company. He began by giving reps an often-used personality assessment that measures introversion and extroversion on a 1-to-7 scale, with 1 being most introverted and 7 being most extroverted.

 

Then he tracked their performance over the next three months.
The introverts fared worst; they earned average revenue of $120 per hour.
The extroverts performed slightly better, pulling in $125 per hour. But neither did nearly as well as a third group: the ambiverts.
In Grant’s study, ambiverts earned average hourly revenues of $155, beating extroverts by a healthy 24 percent.

Who are Ambiverts?

Ambiverts, a term coined by social scientists in the 1920s, are people who are neither extremely introverted nor extremely extroverted. Think back to that 1-to-7 scale that Grant used. Ambiverts aren’t 1s or 2s, but they’re not 6s or 7s either. They’re 3s, 4s and 5s. They’re not quiet, but they’re not loud. They know how to assert themselves, but they’re not pushy.

via washingtonpost.com


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