Helpful Resources for Vim: #1 OpenVim

OpenVim

OpenVim Tutorial, according to me, might be the best hands-on approach to vim, though a bit restrictive. It has got great layout and pretty great introduction to the basic vim shortcuts.
There's an editor screen which shows the tutorial and where you type and use commands, then there's the keyboard that flashes the key you're supposed to press, and finally the sections to skip chapters or to practice again.
Tutorial can feel somewhat restrictive as other than the keys you're supposed to press, you can't use any other commands, not even keep on practicing the same thing till you get it. You either start the chapter anew or switch to the practice mode.

Also there's this practice mode on the website where you get an editor screen and a helpful sidebar of context-aware actions to see the list of rightful changes.



Setting up VMware tools in Ubuntu Server (14.04.2) CLI

First of all, make sure your Ubuntu Server is installed properly and start it up.

Now you need to go to  
Virtual Machine > Install VMware Tools 
(or VM > Install VMware Tools).

If you see an error like- can't install while performing easy install ,
you need to power off the VM and disconnect the Floppy drive.

Now  power on the Ubuntu server and after getting to TTY, again select  Install VMware Tools.
Be patient and wait for the download to finish... Because I did for a long long while!

Meanwhile check out these links about setting it up-
 Now that your VMware tools have been downloaded and mounted in a cdrom, follow the instructions here-
  1.  sudo mkdir /mnt/cdrom
    When prompted for a password, enter your Ubuntu admin user password.
  2.  sudo mount /dev/sr0 /mnt/cdrom
    Run this command to mount the CD-ROM (try sr1 if sr0 doesn't work)
  3.  tar xzvf /mnt/cdrom/VMwareTools-x.x.x-xxxx.tar.gz -C /tmp/
    To extract (Use to get exact name of the file)
  4.  sudo ./tmp/vmware-tools-distrib/vmware-install.pl -d
    To install VMware tools (might need to fulfill some dependencies first)
 The problem now comes in fulfilling those dependencies required for VMware Tools' installation. For that, first you need to perform
sudo apt-get update & sudo apt-get upgrade

Here in update, I encountered an error, the GPG ERROR NO_PUBKEY
After resolving this error, I again found out that there's no source for the package- build-essential in my sources.list
For this, I used this online Sources generator.
 After you've selected all the repositories you want in your sources.list, do the following-
  1. Run the curl commands under Sources list and GPG keys as it is.
  2.  Run this- `. /etc/apt/gpg_keys.txt` 
  3. Now sudo apt-get update again and 
  4. try the sudo apt-get install build-essential which will finally work!
Now while the apt-get is doing its thing, look at this askubuntu question and this wiki on ubuntuguide.org

 Finally, now that you've got all the builds, you're ready to install VMware Tools for linux.

Just run-
sudo perl /tmp/vmware-tools-distrib/vmware-install.pl -d

and the VMware tools have been installed successfully!
This can be a great tool for learning to use linux without the aid of gui on your mac/windows etc.

Now I'm going to set the screen resolution on the terminals as mine is smaller than the native's-

  1.  Edit the GRUB template
    sudo vim /etc/default/grub
  2. uncomment GRUB_GFXMODE and write down your desired resolution
    GRUB_GFXMODE=1280x800
  3. Then Run these two commands-
    sudo update-grub
    sudo reboot

After setting up the resolution, I found my font size becoming too small, so for setting that up, do this-
sudo dpkg-reconfigure console-setup

Or visit these links for step-by-step instructions-


Alright! Now that everything is setup, do whatever you want..

 

Viewing long output and scrolling up/down in tty terminals

To view long output from utilities like ls
you need to pipe the output into a pager, such as  
more or less : `ls | less`

The `|` (pipe) sends(, or pipes), the output from the command on the left (ls) into the input of the command on the right (less) as arguments. 

  • Press the spacebar or `f`  to scroll down the output by a page. Or `d` for half-a-page.
  • Press `b` or `ESC-v` to scroll up the output by a page. Or `u` for half-a-page
  • Press the `q` key to quit the pager. 
  • To search for some text type `/something`
  • Try `man less` for more information.

 To scroll up/down in a terminal without support for mouse, just press `SHIFT + pgUP/pgDOWN`. Although the amount you can scroll depends on terminal's scrollback buffer.

Now, to increase scrollback buffer size-
  • Press Ctrl-a then : and then type scrollback 10000
  • to get a 10000 line buffer, for example.
  • You can also set the default number of scrollback lines by adding defscrollback 10000
  • to your ~/.screenrc file.
  • Another tip: Ctrl-a i shows your current buffer setting.

Relative line numbers in Vim for calculation free fast movement

I've seen on someone's Vim having dynamic line numbers. You can just switch to another line by looking at its line number and using that with either j or k.

So, after googling a bit, I came upon these settings-

" To show normal line numbers
set number

" To show relative line numbers
set relativenumber

Just add one of the above snippet to your .vimrc and you're good to go.

But,  if you want to toggle between them, 

Relative line numbers in Vim for super-fast movement
Jeff Kreeftmeijer - Relative line numbers in Vim for super-fast movement

The Architecture of Open Source Applications


3 Books on The Architecture of Open Source Applications
http://aosabook.org/en/index.html

Architects look at thousands of buildings during their training, and study critiques of those buildings written by masters. In contrast, most software developers only ever get to know a handful of large programs well—usually programs they wrote themselves—and never study the great programs of history. As a result, they repeat one another's mistakes rather than building on one another's successes.
The above quote from their website depicts what the three books on their website are all about. Here you can read about some of the greatest open source projects, about how their software is structured and why. 
You'll learn about the building blocks of their project and how they interact with one another. Getting unique insights directly from the contributors will be the key here, missing from most of the online lectures or tutorials.
Whether you're just starting in this field or are already an expert, these books will help you understand the underlying 'how' in problem solving and the way they reached the answer to their design problems.

Here are some of the open source projects talked about in these books-

Follow them on their blog at http://aosabook.org/blog/
or on Twitter at @aosabook and using the #aosa hashtag.