Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.
* type: vim file-name.
* press "i", "o", or "a", switch to insert mode, input the text you need.
* press "Esc", switch to command mode, then type ":wq" to save and quit the vim(just type "q" to quit if you didn't make any change, or "q!" quit without change).
vim -d file1 file2
vim -o file1 file2
OR vim file1, then :split file2
vim -O file1 file2
OR vim file1, then :vsp file2
You can navigate between each split by using the key combination ctrl-wand then the direction key in which you want to move.
vim -p file1 file2
OR vim file1, then :tabnew file2.
use :tabn(ext) or gt to go to the next tab page. Wraps around from the last to the first one.
use :tabp(revious) or gT to go to the previous tab page. Wraps around from the first one to the last one.
Other usage like "tabn {count}" can be found by using the command ":help tabn".
A buffer is something that is loaded into the memory, so it can be used in the immediate future.
The command ":edit(or :e) filename" is used to open a new file into a new buffer, and switch to this new buffer.
If you want add a file to the buffer list, without loading it, let it stay in the background, you can use the command ":badd(or:bad) filename".
There are three commands to list the open buffers:
:ls, :files, or :buffers.