Usefull commands and configuration scripts for the emacs text editor:
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.
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 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
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.