Table of Contents

Emacs

Usefull commands and configuration scripts for the emacs text editor:

Help

Common commands

Registers

Registers and Bookmarks (to save and jump in specific positions of the file)

CVS

Editing

File management (Dired mode)

How to use emacs to manage file in your harddisk

With C-x C-f or C-x d you can open a directory

Now you can use on the file or on the directory where the cursor is located the following commands:

To act on a set of files or directories you can use the following commands to mark them:

To refresh the listing of files or directories can be used the g key, and the key ^ can be used to go to the parent directory. As for any emacs environment, you can use the M+! (or M-x shell-command) to run a shell command and use more powerful tools such as awk, find, sed or grep.

Install a new language

For example the Italian language using Ubuntu

Download the new language from the Ubuntu repository:

sudo apt-get install iitalian

Load the downloaded language in emacs with the command:

Activate, if needed, the automatic correction:

To check the lessical correctness of the current buffer use the command:

The Italian language case

The Italian language is not properly recognized by the ispell dictionary, therefore is better to install aspell.

To install aspell in Ubuntu linux, install the following packets from Ubuntu repository:

sudo apt-get install aspell aspell-it

Now, the .emacs file located in the home directory must be modified in order to setup aspell as the emacs default dictionary. Add to the .emacs file the following lines:

(setq ispell-program-name "aspell") 
(setq ispell-list-command "list")
(setq ispell-dictionary "italiano");; use the Italian dictionary 

the last row must be deleted in the case you do not want that the default dictionary is Italian.

The command explained before for ispell also works for aspell: M-x ispell-change-dictionary, M-x flyspell-mode and M-x flyspell-buffer.

NB: The installation of the Italian dictionary in emacs has been also explained in Italian here

Generate TAGS file

With this command you can generate TAGS file which contains indexes of all symbols in the project.

find . -type f -iname "*.[ch]" | etags -

For example, in emacs with the M-. command you can search the definition of a function or of a structure starting from its calling or use.