The Archives
-
09.28.09Vim. Moving aroundVim is not a mouse driven program. With other editors, you use the mouse to place the cursor at the desired position. This seems to be fine. However, you do not realize how faster you can move using a command approach as in Vim. In Vim, you move around the text using different commands, that is, keystrokes while you are in command mode. At the beginning this may result confusing or even seem a waste of time. However, once you get used to it, you will never leave it and you find it to be faster than any other method. Basic ...
-
07.10.09Adding password protection on a file with vim$ vim -x filename The -x option uses encryption when writing the file. It will ask for a key: Enter encryption key: ****** Enter same key again: ****** From then on your filename will be encrypted and accessed using the password. The -x option will no longer be necessary when editing the file.
-
07.04.09Vim. Inserting textProbably, the most important action to do with a text editor is inserting text. Vim makes this task very easy and powerful at the same time. Before we start, let us specify some symbolic conventions: I will use ESC and ENTER to refer to the escape and ENTER keys respectively All the keys you are expected to press without producing any output on the screen will be in boldface. Example: ESC i means you have to press escape and then i, i being a command that does not produce any output Let us start with vim: $ vim test.txt The simplest way of inserting test ...
-
06.08.09Vim, first sessionHere you are: your first vim lesson! First off, start vim with a named empty file: $ vim myfile Once you have done this, you get a screen similar to this one (I've removed some of the blank lines for the sake of clarity): ~ ...
-
05.06.09Vim, a short tutorialSince quite a while, I have intended to write a short Vim tutorial. I do not plan it to be a very detailed guide, I just want to show some of the features of Vim I use often. In this first chapter I explain what Vim is and what it can do for you. Vim is a command-line oriented editor. This is true even though there are some gui-oriented, vim-based alternatives (gvim, for instance). It is based on the ancient Vi, but Vim stands for Vi (i)Mproved, as it provides more powerful features. Some of the things which can be done ...
-
03.29.09Opening files in Vim$ vim file1 file2 Opens file1 and file2 in two different buffers and shows file1 in the current viewport $ vim -o file1 file2 Opens file1 and file2 in two different buffers and shows every one of them in a viewport with the screen splitted horizontally $ vim -O file1 file2 Same as above but with the screen splitted vertically