Using Emacs as a Shell and file manager.
Your ~/.emacs.d/init.el file, your ~/.emacs.d/el/typopunct.el file, and your ~/.emacs.d/el/gopher.el file.
Open the console version of emacs instead of the X window version:
emacs -nw
Under most of your installations, the Meta key is the Esc key at the upper left of the keyboard.
Activate menu items: Meta-` [Meta-tickmark (below tilde)] Close without saving: Ctrl-x Ctrl-c Save: Ctrl-x Ctrl-s Save as: Ctrl-x Ctrl-w Open a man page: Meta-x man
Cancel a command or close a minibuffer:
Ctrl-g
Open file or create new:
Ctrl-x Ctrl-f
This can be used to open a file on a remote server. Backspace over the default directory (~/) and enter:
/[ssh:]user@server.net#port-number:/path/to/file
Alternatively, you can use the “Host” specified in an SSH config file to identify a remote server:
/ssh:Host:/path/to/file
Kill buffer: Ctrl-x k List buffers: Ctrl-x Ctrl-b Move to previous buffer: Ctrl-x Ctrl-[left-arrow] Move to next buffer: Ctrl-x Ctrl-[right-arrow] Open second window: Ctrl-x 2 Move to other window: Ctrl-x o Close current window: Ctrl-x 0 Increase window size: Ctrl-x ^ Pull up directory listing: Ctrl-x d Top of buffer: Meta-< Bottom of buffer: Meta-> Page down: Ctrl-v Page up: Meta-v Beginning of line: Ctrl-a End of line: Ctrl-e Next line: Ctrl-n Previous line: Ctrl-p Forward on character: Ctrl-f Back one character: Ctrl-b Forward one word: Meta-f Back one word: Meta-b
Bookmarks
Set bookmark: Ctrl-x r m List bookmarks: Ctrl-x r l . With list open use "r" to rename a bookmark. . With list open use "d" to mark bookmark for deletion. . With list open use "x" to delete marked bookmark.
A red dot in the upper left corner of an Emacs window indicates the presence of a bookmark. See this StackExchange discussion.
Cut/Copy/Paste
Select text by setting a beginning mark with Ctrl-space, and then moving cursor to end of desired selection. Cut selection: Ctrl-w Copy selection: Meta-w Paste selection: Ctrl-y Merge previous line with current: Meta-^ Set text width (i.e. fill column): Ctrl-x f [default is 70] Display column ruler: Meta-x ruler-mode Justify paragraph at 78 characters: Meta-78 Meta-q RE-FILL a paragraph after editing: Meta-q Undo: Ctrl-x u Search: Ctrl-s . A subsequent Ctrl-s takes you to the next occurrence . Ctrl-r takes you to the previous occurrence Spellchecking . Spellcheck word: Meta-$ . Spellcheck buffer: Meta-x ispell Center line: Meta-x center-line Meta-l Make word lower case Meta-u Make word upper case Meta-c Capitalize word
If italic or bold faces are not displaying properly, you can examine and change their current settings with:
Meta-x customize-face
Org mode files can be exported into a number of external file formats, including ODT. (Note that the zip utility must be installed for the file converter to run.) When you have an org mode file open:
Ctrl-c Ctrl-e
will bring up a list of export options.
Some links to instructions on working with tables in org mode:
To enter calendar mode:
Meta-x calendar-mode
To exit calendar mode:
q
By default, the diary file is located at
~/.emacs.d/diary
You can set a different location in your ~/.emcas.d/init.el file:
(setq diary-file "/path/to/alternate-location)
The "Diary" entries in the Emacs manual at gnu.org are very helpful.
Add the gopher.el file to your ~/.emacs.d/el/ directory, and then add the line
(require 'gopher)
to your ~/.emacs.d/init.el file.
Use
Meta-x gopher
to enter gopher mode and prompt to enter a gopher url.
Use
q
to exit gopher mode.
Basic usage guidelines can be found on the gopher.el github page.
To enter enriched mode, open (i.e. ‘visit’) a new file and type:
Meta-x enriched-mode
If you open a file that was saved in enriched mode, it will automatically open in enriched mode. One problem I have run into is that it does not seem possible to edit a compressed file in enriched mode.
Some enriched mode formatting reminders:
Meta-o-i (Italic) Meta-o-b (Bold) Meta-o-u (Underline) Meta-o-l (Bold-Italic) Meta-o-d (Return to default text format)
To open the emacs internal web browser, type:
Meta-x eww
You will then be prompted to enter a URL. Use "Meta-x eww" each time you wish to enter a new URL. Some useful commands:
q = exit browser mode l = go to previously loaded page (lower case "L") r = go to subsequently loaded page d = download H = show history b = add bookmark B = show bookmarks C = show cookies
You can add syntax highlighting for Markdown files by installing the Debian package elpa-markdown-mode. Once installed, you do not need to do any additional configuration in your init.el file. Emacs will recognize and properly highlight Markdown files.
There are numerous online discussions about how tramp mode frequently locks up your emacs session. There do not seem to be any consistently reliable solutions, even though many long-term, regular users of emacs complain about this issue. One potential remedy is to clear out old cache and connection related junk using the following commands:
M-x tramp-cleanup-connection #allows you to close a connection M-x tramp-cleanup-all-connections #closes all existing connections M-x tramp-cleanup-all-buffers #does the same, and deletes also related buffers
That last command can be especially useful. Note that deleting the buffer just deletes the open emacs buffer. It does not delete the underlying file.
You can adjust the face/font size, without changing anything else, by adding a line like:
(set-face-attribute 'default nil :height 140)
to your init.el file. Height is measured in tenths of a point. So, 140 equals 14 points.