Text editor

A text editor is a program to create and edit of text files. You need to editor to edit config files.

Software
You find more editors in the "app-editors" category.

vim and vi
If Vim is installed, you may treat vi and vim synonymous due to the following link.

The synonymous use also holds for setting editor defaults.

Set default
You can set system wide the default editor in the, e.g. switch to Vim:

Each user can also set his default editor with eselect (replace NUMBER with the wanted number):

Actually eselect modifies the file above. It seems that the old method of editing doesn't work any more.

sudo editor
sudo does not preserve the user's environment variables and therefore has its own default editor.

visudo editor
Due to the sensitive nature of it may only edited via the command visudo which in turn is is limited to a predefined selection of editors. Call for more information and read sudo