This is an old revision of the document!
File
⇒ New Frame
), multiple buffers
Install the emacs
package, if it is not already available
$ sudo apt install emacs [sudo] password for your_login: Reading package lists... Done Building dependency tree Reading state information... Done emacs is already the newest version (1:26.3+1-1ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Install Aquamacs
This is the light and easy option!
emacs
for Windows:cmd
, PowerShell
or Terminal
with elevated (i.e. administrator) permissions:winget install --id GNU.Emacs
winget
does not work, download the Windows installer from the most recent windows/gnu-XX
directory of a gnu ftp mirroremacs
settings, but it is highly recommended to start with a nice existing emacs configuration file (if available)emacs
can automatically transfer files from your computer and remote servers, if configured properlymylogin_server
(e.g. jyp_ssh1
) is OKmylogin server
will not work/plinkx:mylogin_server:/path/to/file
diffutils-2.8.7-1.exe
as of July 2023) from https://gnuwin32.sourceforge.net/packages/diffutils.htm.emacs
configuration file (and restart emacs). Otherwise emacs will not be able to find the diffutils
binaries it needs for comparing text files(setq exec-path (append exec-path '(“C:\\Program Files (x86)\\GnuWin32\\bin”)))
diffutils
: dated May 2004, as of July 2023…, but it works fine!This is the overkill option… Useful only if you really need WSL! But you should also install the emacs Windows version!
emacs some_text_file &
emacs &
Start
⇒ E
⇒ Emacs
C-g
(CTRL
+g
) to abort or interrupt something in emacs
e.g. When you are searching forward with C-s
, type C-g
to exit the search
All the common functions of emacs are available from the pull-down menus at the top, but the real power comes from knowing (a few of) the keyboard shortcuts!
C-x C-c
means CTRL-x
followed by CTRL-c
, and will exit emacsFile
⇒Quit
, just faster C-s
means CTRL-s
, and will Search forwardIncremental Search
in the Reference Card for more information on searching!C-g
means CTRL-G
and will abort the current emacs command/action (e.g. exit a forward search started with C-s
)C-z
will iconify the emacs window!C-x u
(CTRL-x
followed by u
) or Edit
⇒Undo
for undoing the previous action!M-f
means Alt-f
(or Esc
followed by f
if the keyboard has no Alt
key), and will Move forward a wordC-A
and C-E
to go to the beginning and end of a lineHelp
⇒Emacs Tutorial
Help
⇒Emacs Tutorial (choose language)…
(
and )
) when copy/pasting settings you find on the web, and remember that comments start with a ;
characterOptions
menu appear at the end of the configuration file
Configuration file name: .emacs
emacs knows (of course) where its .emacs
configuration file is located! You can open the configuration file just by typing C-x C-f ~/.emacs
and you can then check how your Home folder (~/
) has been expanded
Related emacs (configuration) files and folders (e.g. .emacs.d/
folder) are located in the same place as the main configuration file
~/.emacs
: i.e. .emacs
(dot-emacs) file in the current user's Home directoryc:\Users\your_login\AppData\Roaming\.emacs
c:/Users/your_login/AppData/Roaming/.emacs
(or just ~/.emacs
)Keyboard shortcuts defined by the example configuration file
C-x C-g
: goto lineShift Left_Arrow
and Shift Right_Arrow
: go to the beginning/end of a lineC-a
and C-e
, and the Home
and End
keyboard keysShift Up_Arrow
and Shift Down_Arrow
: go to the beginning/end of the bufferF1
: Undo (lots of undos!!)F2
: Search and ReplaceQuery Replace
in the Reference Card to determine what you can do when a match is foundF3
: fill-paragraph (i.e. automatically re-indent text or comments)F12
: Repeat complex command (e.g. restart a previous query-replace operation)Useful shortcuts
M-;
: comment out selected linescomment character
for the current buffer mode, e.g. #
for a Python scriptC-x C-f
), emacs will automatically use the tramp
mode to:scp
) to your computer when you open it, so that you can edit the file locallyscp
) file back to its original remote location when you save it (C-x C-s
)/ssh:user@server:/path/file
/plinkx:jdoe_server:/path/file
on Windows with an existing jdoe_server
session defined in PuTTY
/ssh:your_login@ssh1.lsce.ipsl.fr:/home/users/your_login/my_script.py
/ssh:user_A@gateway|ssh:user_B@target_server:/path/file
/ssh:your_login@ssh1.lsce.ipsl.fr|ssh:user_B@target_server:/path/file
'(recentf-mode t)
mode, you can easily access recent files in File
⇒Open Recent
without having to type the full access path again!
The tramp
mode is quite complex and relies on connections to one or more remote computers using external programs and protocols. You may have to experiment a bit till you find the correct syntax and inline method to work with a particular remote server. Make sure you have read the prerequisite section!
Buffer
⇒ *Messages*
C-g
M-x doctor
). See also Fun and Games in EmacsI am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice. My climate model does not work Why do you say your climate model does not work? I get wrong results Is it because of your plans that you say you get wrong results?
[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]