Emacs relies on a startup file, usually init.el
(or back in the days, .emacs
) placed in the .emacs.d
folder within the user home directory.
If you are on a Unix based operating system, the HOME
directory is a well defined concept and, most notably, a defined environment variable that Emacs can rely on to find out where .emacs.d
(and hence init.el
) or .emacs
is.
On Microsoft Windows, althought the concept of user’s home directory is there, there is not a predefined variable that Emacs can use to its aim.
As a consequence, if you have your own configuration under ~/.emacs.d
, such configuration will not be usable on Microsoft Windows in a straightforward manner. However, setting an HOME
environment variable for Emacs to use is quite simple.
First of all, search in the Start
menu for an entry named like Manage environment variables
, that will bring up a dialog window where you have to select the Environment variables
button.
Then, add a new environment variable named, you guess, HOME
, that holds your own home directory, that on Microsoft Windows is something like C:\Users\<username>
.
While you can make the HOME
variable to point to whatever you want, to avoid headaches, let it point to your own home directory.
Now you can place you .emacs.d
directory within the same home directory and have a nice day using Emacs on Microsoft Windows!
The article Emacs startup file and configuration directory on Windows: where are init.el and .emacs.d?
has been posted by
Luca Ferrari
on July 16, 2023
In my Swedish version of Windows 7 Professional, .emacs and/or .emacs.d/ are placed in C:\Users\username\AppData\Roaming
I don’t actually know, since (being a relative newcomer to Emacs and thus not having done any customization) I don’t have a .emacs
for my (WinXP) desktop, but I do have a directory, %USERPROFILE%\Application Data\.emacs.d
I’d put it there and see if it works.
From the GNU Emacs FAQ for MS Windows:
3.5 Where do I put my init file?
On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called .emacs.d/init.el. Many of the other files that are created by lisp packages are now stored in the .emacs.d directory too, so this keeps all your Emacs related files in one place.
All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:
- If the environment variable HOME is set, use the directory it indicates.
- If the registry entry HKCU\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates.
- If the registry entry HKLM\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
- If C:.emacs exists, then use C:/. This is for backward compatibility, as previous versions defaulted to C:/ if HOME was not set.
- Use the user’s AppData directory, usually a directory called Application Data under the user’s profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.
Within Emacs, <~> at the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with C-x C-f ~/.emacs.
Tags:
Windows
Emacs
Related
¶Intro
The most valuable aspect of Emacs is the ability it gives you to customize your environment and workflow perfectly for whatever it is you want to do.
This is the first video in a series where I’ll show you how to build a complete Emacs configuration while also teaching you what you need to know about Emacs Lisp, the language used to configure Emacs.
Let’s take a look at how you can quickly get started customizing Emacs using the functionality that comes “in the box”!
Click like 👍 on the video if you’re excited to get started!
¶Getting started
In this video I won’t show you how to install or use Emacs! If you are a new Emacs user, check out my video The Absolute Beginner’s Guide To Emacs where I give a very thorough introduction for how you can get started.
I’m going to assume you’ve already got Emacs installed and you’re using at least Emacs 27 which was released last year. However, much of what I’ll show in this series is using features in Emacs 28 which isn’t fully released at the time of this video.
If you can’t find a recent build of Emacs 28 for your operating system or Linux distribution, check out the link to the show notes in the description to find more details on how to build your own copy of Emacs 28.
As we go, I’ll also give pointers on alternative ways to get some of the same functionality for earlier Emacs versions.
¶Finding Emacs 28
Here are some pointers to find or build Emacs 28 on your operating system. If you have trouble getting it, leave a note in the comments or come find us in the Discord or IRC.
- On Linux, follow the instructions in the INSTALL file: https://git.savannah.gnu.org/cgit/emacs.git/tree/INSTALL
- On Windows, these instructions should still work: https://gist.github.com/nauhygon/f3b44f51b34e89bc54f8
- On macOS, install the
emacs-plus
package (see documentation)
brew tap d12frosted/emacs-plus brew install emacs-plus@28
¶Where is the configuration?
The primary way to configure Emacs is to edit its configuration file which is written in a language called Emacs Lisp. This means that your Emacs configuration is actually code! Don’t worry, I’ll explain everything.
Here are the places where you might find the main configuration file:
~/.emacs
or~/.emacs.el
— The old location for the configuration file (not recommended!)~/.emacs.d/init.el
— The main configuration file in the Emacs config folder (recommended on macOS and Windows)~/.config/emacs/init.el
— Follows Linux desktop environment guidelines (recommended on Linux!)
Emacs will look for a configuration file in each of these locations every time it starts up!
This file typically does not exist by default, so you will probably have to create it! We’ll use C-x C-f
(Ctrl+X then Ctrl+F) to open this file for editing.
Be aware that I’m editing my init.el
from a different folder than the default! That’s because I’m isolating it from my own Emacs configuration. Your init.el
should go in one of the places I mentioned above!
Emacs Manual: The Emacs Initialization File
¶The basics of configuration
Now that we’re in our init.el
file, let’s learn how you can actually configure Emacs with it!
The two most common things you will do in your init.el
file:
- Configure features by setting variables
- Enable or disable features by calling functions
¶Setting configuration variables
Let’s take a look at how you would set a configuration variable and then we’ll break down the syntax to understand Emacs Lisp a little better:
(setq inhibit-startup-message t)
This is a list expression (wrapped in parentheses) that represents a “call” to a function named setq
.
An expression is an unit of code that can be evaluated to produce a result. A list is an ordered collection of expressions: symbols, values, or lists.
A function is a higher-level unit of code that has a name and accepts a certain number of inputs. When you call a function by name and provide inputs, the code in that function executes and applies some kind of change in Emacs.
setq
is the name of the “function” to be called in this expression and the remaining two items are the inputs to the function. inhibit-startup-message
is the name of the configuration variable we are setting.
The second parameter is t
, a value that means “true”. There is also a value nil
which means “false”. You will see these two values a lot in configuration!
Variable and function names in Emacs are typically of the form some-variable-name
where multiple lower-cased words are separated with the hyphen (-
) character.
The line starting with ;;
is a comment, a non-evaluated line that is used for writing notes in the code. A single ;
also works, can be used at end of any line.
What this expression says is that we want to turn on the setting to prevent the startup screen from being displayed.
Let’s try it out! Add this line to your init.el
file, save it with C-x C-s
(Ctrl+X then Ctrl+S) and then restart Emacs.
¶Setting variables without restarting Emacs
It wouldn’t be great if you had to restart Emacs every time you changed your configuration file. Luckily you can evaluate parts of your configuration while Emacs is running!
Let’s set another variable to test this out. While we do this, I’ll show you another detail about the setq
function: you can set more than one variable in the same call!
(setq inhibit-startup-message t visible-bell t) (setq inhibit-startup-message t) (setq visible-bell t)
Instead of restarting Emacs to test out this behavior, let’s use a key binding that will evaluate the configuration expression under the cursor to apply it immediately:
Place your cursor somewhere inside of the open and close parentheses of the setq
call and press C-M-x
(Ctrl+Alt+X). Now try to use the UP arrow key to move the cursor before the beginning line of the file and it Emacs should blink!
If you don’t like the flashing behavior of visual-bell
then leave it out, it’s your configuration!
¶Enabling or disabling features
Many features of Emacs are controlled by something called a “mode.” A mode is basically a collection of functionality that can be applied either to a single Emacs buffer or to the entire editor.
Some modes are enabled by default in Emacs and others must be turned on explicitly. You can turn modes on or off at any time by calling the mode’s function and passing the value -1
to disable the mode or 1
to enable the mode:
(menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) (global-display-line-numbers-mode 1)
Now that we’ve added this code to our configuration and saved it with C-x C-s
, these changes will be applied every time we start up Emacs!
¶Setting the theme
Another way to configure certain parts of Emacs is by calling individual functions. There are a ton of functions you can call in Emacs!
One function you’ll definitely want to call is load-theme
which allows you to… load a color theme!
(load-theme 'modus-vivendi t) (load-theme 'deeper-blue t)
We’ll talk about visual customization more in a later video.
- How to install the Modus themes on Emacs 27 and lower (it’s built-in with Emacs 28!)
- Customizing the Modus themes — this is a good way to practice!
- Prot’s YouTube channel
¶How to find more things to configure
The two most useful functions in Emacs when you’re learning how to configure it are:
describe-variable
(C-h v
/ Ctrl+H then V) — Shows documentation for any variable in Emacsdescribe-function
(C-h f
/ Ctrl+H then F) — Shows documentation for any function in Emacs- The best of both worlds:
describe-symbol
(C-h o
/ Ctrl+H then O)!
When you run these functions, the prompt will be filled automatically with the name of the variable or function where your cursor is in the current file, so just press Enter! You can also type the name of any variable or function you’d like to know about.
Another useful property of these functions is that you can press TAB
inside the prompt to get suggestions for variable and function names using the prefix you’ve already typed! This can be very useful for discovering new things to configure.
You can also get suggestions for variable and function names right in your init.el
buffer by using the key binding C-M-i
(Ctrl+Alt+i). Let’s type “scroll
” and press this key binding right after it!
¶Try it out!
Now it’s your turn to experiment with what you’ve learned in this video!
- Try
hl-line-mode
andblink-cursor-mode
- Explore variables and functions: type a particular word (like “
indent
”) and useC-M-i
to see what shows up - Use
describe-function
anddescribe-variable
to see documentation interesting things you find - If you have Modus themes installed, try setting some of the customization variables to make the theme look more to your taste. I’ll show you a better configuration for it in a later video!
When you try what I showed in this video, let me know in the comments how it went for you!
¶Bonus: My Emacs demo launcher
If you’re curious, here’s the command I’m using in my own Emacs configuration to quickly launch my demo Emacs session!
(defun efs/launch-demo-emacs () (interactive) (let ((default-directory "~/Projects/Code/emacs-from-scratch") (existing-emacs (get-buffer "Emacs"))) (if existing-emacs (switch-to-buffer existing-emacs) (start-process-shell-command "Emacs" nil "./.tools/run-emacs.sh")))) (local-set-key (kbd "C-c e") #'efs/launch-demo-emacs)
These notes summarize some of my discoveries (re-)learning GNU Emacs. Since these are my personal notes, it may help to briefly describe my background. I used Emacs on Unix from somewhere around 1990 until 1995. Then in 1995 I began using Windows as my primary operating system and stopped using Emacs. In 2010 I decided to give Emacs on Windows another try. I may not mention some basic things just because I remember them from my initial experience.
These notes are not a thorough introduction to Emacs. For a more systematic reference, the Emacs Wiki is a good place to start. I wanted to write these things down for future reference, and I put this file up on my website in case someone else finds it useful. If you have comments or corrections, please let me know.
Table of contents
- Installation and configuration
- Installing Emacs and setting up .emacs
- Backup files
- Recycle bin
- Integration with the Windows File Explorer
- Getting rid of the start-up screen and toolbar
- Changing fonts
- Enabling commands to change case
- Spell check
- Installing color-theme
- Installing nXhtml
- Installing powershell-mode
- Remapping my keyboard
- Line wrapping
- Column position
- Emacs vocabulary
- Editing LaTeX
- Editing source code
- Selecting and deleting text
- Searching and replacing
- Searching for strings
- Regular expressions
- Replacing
- Saving text and positions
- Saving text
- Saving positions
- The Emacs help system
- Navigating files, buffers, and windows
- Files
- Buffers
- Windows
- Miscellaneous commands
- Emacs resources
Installation and configuration
Installing Emacs and setting up .emacs
I install all my Unix-like software under C:\bin
and have that directory in my Windows PATH
environment variable. I installed Emacs 23.1 in C:\bin\emacs-23.1
and created an environment variable HOME
set to C:\bin
. The significance of HOME
is that Emacs can find your configuration file if you put it there. This file is called “dot emacs” because the traditional name for the file on Unix systems is .emacs
. On Windows, it is more convenient to name the file _emacs
. (You can also name the file _emacs.el
. Giving the file the .el
extension causes Emacs to open the file in Lisp mode. And if someday the file becomes huge, you can compile it to make startup faster.)
Backup files
Emacs automatically saves backup versions of file and by default leaves these backup files beside the files being edited. This can be annoying. Some people call these extra files “Emacs droppings.” Adding the following lines to .emacs
instructs Emacs to put all backup files in a temporary folder.
(setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
Recycle Bin
The following line configures Emacs so that files deleted via Emacs are moved to the Recycle.
(setq delete-by-moving-to-trash t)
More details here.
Integration with the Windows File Explorer
The following registry script creates an “Open with Emacs” option in the Windows file explorer context menu.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\Shell\Open In Emacs\Command] @="\"C:\\bin\\Emacs-23.1\\bin\\emacsclientw.exe\" -a \"C:\\bin\\Emacs-23.1\\bin\\runemacs.exe\" \"%1\""
See also this blog post for how to open a file in a running instance of Emacs rather than starting a new instance for each file.Putting these two lines in .emacs
creates a menu item File -> Open recent.
(require 'recentf) (recentf-mode 1)
If you have a desktop shortcut to runemacs
, you can open a file in Emacs by dropping it on the shortcut icon.
Getting rid of the start-up screen and toolbar
I turned off initial start-up screen by adding (setq inhibit-startup-screen t)
to .emacs
. This had the pleasant side effect of making the “Open with Emacs” context menu work as expected. (Before, Emacs would open with a split window. Now it opens with just the “sent” file.)
Got rid of the toolbar by using the configuration editor under Options / Customize Emacs.
Changing fonts
I used the Options menu to change the default font to Consolas.
Enabling commands to change case
The commands for converting the text in a region to upper or lower case are disabled by default. (The GNU Emacs manual says beginners find these commands confusing and so you have turn them on. That seems very strange. Many other Emacs commands are more confusing.) The following turns the commands on.
(put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil)
Once this is enabled, you can make the text in a region lowercase with C-x C-l
or uppercase with C-x C-u
.
Spell check
GNU Emacs does not provide a spell checker. Instead, it provides hooks to install your own spell checker, usually Aspell. I downloaded Aspell version 0.50.3 (win32) from here. I then installed the English dictionary from the same page. The dictionary installer warned me that Aspell was already installed and suggested that I uninstall it. I did, thinking that it might install a newer version. That didn’t work. I re-installed Aspell, then installed the dictionary, ignoring the warning. Everything worked fine.
After installing Aspell, I let Emacs know where to find it by adding these lines to my .emacs
file.
(setq-default ispell-program-name "C:/bin/Aspell/bin/aspell.exe") (setq text-mode-hook '(lambda() (flyspell-mode t) ))
The command M-x ispell
will run the spell checker on your file. If flyspell-mode
is turned on, as it is in the lines above, misspelled words are underlined in red as you type.
Installing color-theme
It was difficult to find a more direct way to configure the color schemes that Emacs uses, so I installed color-theme
version 6.60. I then used color theme creator to create a basic theme then tweaked the colors.
Installing nXhtml
The default support for editing HTML files was less than I expected. I heard good things about nXhtml and decided to go with it. Notice that it inserts extra menus when you open a file in nXhtml mode. You can use the commands from the menu until you learn their keyboard shortcuts.
nXhtml mode requires HTML to be valid XHTML. If your HTML is not valid, you can use HTML Tidy to bring it into standard compliance. HTML Tidy appears as a menu option under nXhtml, but it must be installed separately. Installing HTML Tidy is very simple: download two files, the executable and a DLL, and copy them to somewhere in your path. Once HTML Tidy is installed, it will continually check the validity of the XHTML. It will display its status in the mode line and will turn angle brackets red that are not in the correct place.
Incidentally, the table of contents for this page was automatically generated using nXhtml. Just give every <h>
tag an id. Then you can use commands from the nXhtml menu to insert the table of contents and its style sheet.
NB: Apparently the nXhtml code does not allow a space on either side of the equal sign when specifying the id
value.
Installing powershell-mode
I installed a mode for editing PowerShell code by copying powershell-mode.el
, downloaded from here, by copying the file to C:\bin\emacs-23.1\site-lisp
, which is in my Emacs load-path
. I tried installing some code that would allow me to run PowerShell as a shell inside Emacs. That did not work on the first try and I did not pursue it further.
Remapping my keyboard
Many Emacs users recommend remapping your keyboard so that the caps lock key becomes a control key. I don’t like the idea of changing my keyboard just to accommodate one program, even a program I may use very often. However, I recently bought a laptop that came with a Fn key right where my muscle memory expects the left control key. I hardly ever use the caps lock key, so I made it a control key for the sake of Emacs and for making it easier to use my laptop. I mapped the scroll lock key, a key I have not used in a decade or two, to caps lock in case I ever need a caps lock key. My initial intention was to keep the original left control key as an addition control key, but then I disabled it to force myself to get into the habit of using my new control key. I mapped the keyboard of every computer I use to be the same. This has been hard to get used to.
I don’t know what I want to do for my “Meta” key. For now I’m using the Esc key. Some recommend using the original Control key after remapping the Caps Lock key. I have two problems with that: it will not work on my laptop, and I first have to break my habit of using the original Control key as a Control key. (Why not just remap the Fn key on my laptop? Unfortunately this key cannot be remapped like an ordinary key.) I may try to get in the habit of using the right Alt key as my Meta key.
Line wrapping
I set global-visual-line-mode
as the default way to handle line wrap. I did this through the menu sequence Options / Customize Emacs / Specific Option. This causes text to flow as it does in most Windows programs.
Column position
By default, Emacs displays the current line number in the mode line but not the current column number. To display the column number, add the following to your .emacs
file.
(setq column-number-mode t)
Emacs vocabulary
Emacs uses a set of terminology that is not commonly used elsewhere. The following correspondences are not exact, but they are a good first approximation.
Emacs terminology | Common terminology |
---|---|
fill | word wrap |
yank | paste |
kill | cut |
kill ring | clipboard |
mode line | status bar |
point | cursor |
font lock | syntax coloring |
The “echo area” is the very bottom of an Emacs window. It echoes commands, displays the minibuffer, and provides a place to type extra arguments for commands.
Editing LaTeX
One of the most useful key sequences for editing LaTeX files are C-c C-o
to insert a \begin
and \end
pair. Emacs will prompt you for the keyword to put inside the \begin{}
statement. Another useful key sequence is C-c C-f
to run latex
on a file. (Emacs can detect whether a file is plain TeX or LaTeX. I use LaTeX exclusively.)
There is Emacs package AUCTex for editing (La)TeX files, but I have not tried it.
I would like to have C-c C-f
run pdflatex
rather than latex
, but I have not found out how to configure that.
Editing source code
Here are a few useful commands for editing source code files.
Command | Explanation |
---|---|
C-M-a | Go to beginning of a function definition |
C-M-e | Go to end of a function definition |
C-M-h | Put a region around a function definition |
C-j | Insert a newline and properly indent the next line |
I put these lines in my .emacs
file to make the C++ mode behave more like what I am accustomed to.
(add-hook 'c++-mode-hook '(lambda () (c-set-style "stroustrup") (setq indent-tabs-mode nil)))
Selecting and deleting text
C-x h
selects the entire current buffer.
You select a region by using C-SPACE
at one end of the region and a selection command and moving the point (cursor) to the other end of the region. Then you can use C-w
to cut or M-y
to copy. The paste command is C-y
. Emacs maintains a “kill ring”, something analogous to the Windows clipboard but containing more than just the latest cut or copy. For example, C-y M-y.
lets you paste the next-to-last thing that was cut. Use M-y
again to paste the cut before that, etc.
You can kill all but one whitespace character with M-SPACE
. You can kill all but one blank line with C-x C-o
.
Emacs has commands for working with rectangular regions, analogous to vertical selection in some Windows programs. Specify a rectangular region by setting the mark at one corner and the point at the opposite corner. All commands for working with rectangular regions start with C-x r
. Here are a few rectangular region commands.
Command | Explanation |
---|---|
C-x r k |
Kill the rectangle |
C-x r d |
Delete the rectangle |
C-x r c |
Clear the rectangle, i.e. fill the region with whitespace |
C-x r y |
Yank (paste) the rectangular region |
Searching and replacing
Searching for strings
Use C-s
for forward incremental search, C-r
for backward incremental search. Type another C-s
or C-r
to repeat the search. Type RET to exit search mode.
Regular expressions
C-M-s
and C-M-
r are the regular expression counterparts of C-s
and C-r
.
Emacs regular expressions must escape the vertical bar | and parentheses. For example, the Perl regular expression (a|b)
becomes \(a\|b\)
in Emacs.
Emacs regular expressions do not support lookaround.
The whitespace patterns \s
and \S
in Perl are written as \s-
and \S-
in Emacs. There is no equivalent of Perl’s \d
except to use the range [0-9]
.
Replacing
Use M-x replace-string
and M-x replace-regex
for replacing text. There are also interactive counterparts M-x query-replace
and M-x query-replace-regex
.
Saving text and positions
Saving text
You can save a region of text to a named register for later pasting. Register names can be any single character. The command to save to a register a is C-x r s a
. The command to insert the contents of register a is C-x r i a
.
Saving positions
Bookmarks are named positions in a buffer. The command to create a bookmark is C-x r m bookmark_name
. The command to go to a bookmark is C-x r b bookmark_name
.
The Emacs help system
All help commands start with C-h
. If you don’t know a more specific location to go to, you can start by typing C-h C-h
to get to the top of a navigation system for help.
C-h m
is very useful. It displays all active modes and describes key bindings.
C-h k
tells what command is bound to a key and gives documentation on how it is used. C-h w
is a sort of opposite: given a command, it sells what keys are bound to that command.
Navigating files, buffers, and windows
Files
The command to open a file is C-x C-f
. The command for ‘save as” is C-x C-w
.
Emacs has a sort of File Explorer named Dired. You can open Dired with the command C-x d
. You can move up and down in the Dired buffer by using p
and n
just as you can use C-p
and C-n
in any other buffer. You can still use the control key, but you do not have to.
Here are a few of the most important Dired commands.
Dired command | Action |
---|---|
RET | Visit selected file (or directory) |
C | Copy |
D | Delete immediately |
d | Mark for deletion. Use x to carry out deletions. |
R | Rename a file |
! | Specify a shell command to carry out on a file |
Adding the following two lines to your .emacs
file will create an Open Recent submenu under the File menu.
(require 'recentf) (recentf-mode 1)
Buffers
The command C-x b
takes you to your previous buffer.
The command C-x C-b
creates a new window with a list of open buffers. You can navigate this list much as you would the Dired buffer.
You can type the letter o
to open the file on the current line in another window. You can type the number 1
to open the file as the only window.
The command M-x kill-some-buffers
lets you go through your open buffers and select which ones to kill.
Windows
The command C-x 1
closes all windows except the current one.
C-x 2
splits the current window horizontally, one buffer on top of the other.
C-x 3
splits the current window vertically, one beside the other.
C-x o
cycles through windows.
Miscellaneous commands
Command | Explanation |
---|---|
M-g g |
Go to line number |
M-= |
Report line and character count of region |
M-/ |
Autocomplete based on text in current buffer |
C-x C-e |
Evaluate the Lisp expression to the left of the cursor |
M-x eval-region |
Evaluate the selected region as Lisp code |
M-x shell |
Run a shell inside Emacs |
M-! |
Run a single shell command |
M-x sort-lines |
Sort the lines in a region |
M-x desktop-save |
Save an Emacs session |
C-t |
Transpose characters |
M-t |
Transpose words, works across punctuation and tags |
Emacs resources
One program to rule them all
Emacs cursor movement
Emacs and Unicode
Emacs kill (cut) commands
Real Programmers (xkcd cartoon)
10 Specific Ways to Improve Your Productivity With Emacs from Steve Yegge
- Where is emacs configuration file?
- What is the Emacs init file?
- Where is Emacs config file in Windows?
- What is Emacs load path?
- What is GNU Emacs used for?
- How do I create an emacs file?
- How do I reload Emacs?
- How do I edit an init file?
- Where are Emacs packages?
- How do I load a lisp in emacs?
- How do I add Emacs D bin to my path?
- Why should I use Emacs?
- What is Emacs mode?
- Is Emacs any good?
Where is emacs configuration file?
Your emacs config file is probably in one of three places: in ~/. emacs though this is now a bit outdated and instead it will usually be in. ~/.
What is the Emacs init file?
User’s Initialization File or dotemacs or init file is a file to store your configurations/customizations for Emacs written in Emacs Lisp, located at either $HOME/. emacs. d/init. el or (archaically) at $HOME/.
Where is Emacs config file in Windows?
emacs file or . emacs. d folder is in the c:/Users/username/AppData/Roaming . Or some sources will write it as %HOMEPATH%\AppData\Roaming\.
What is Emacs load path?
The value of variable ‘load-path’ is a list of directories to search, in order, for EmacsLisp libraries that you load. If you do not alter it (directly or indirectly), by default it contains the Lisp source directories for the Emacs distribution.
What is GNU Emacs used for?
Emacs provides commands to manipulate and differentially display semantic units of text such as words, sentences, paragraphs and source code constructs such as functions. It also features keyboard macros for performing user-defined batches of editing commands.
How do I create an emacs file?
To create a new file, use Control-X-Control-F, just as if the file already existed. When emacs asks you for the file name, type in the name you want your new file to have, and emacs will create the file, and display an empty buffer for you to type in. Emacs will perform file name completion for you.
How do I reload Emacs?
You can use the command load-file ( M-x load-file , then press return twice to accept the default filename, which is the current file being edited). You can also just move the point to the end of any sexp and press C-x C-e to execute just that sexp.
How do I edit an init file?
If you want to replace the init. rc file by pushing a new edited file using adb you should have a root user permission to change the system from read only to read and write. Another way is to download the source code of android x86 and then edit init.
Where are Emacs packages?
Once installed, the contents of a package are placed in a subdirectory of ~/. emacs. d/elpa/ (you can change the name of that directory by changing the variable package-user-dir ). The package subdirectory is named name — version , where name is the package name and version is its version string.
How do I load a lisp in emacs?
To load an Emacs Lisp file, type M-x load-file . This command reads a file name using the minibuffer, and executes the contents of that file as Emacs Lisp code. It is not necessary to visit the file first; this command reads the file directly from disk, not from an existing Emacs buffer.
How do I add Emacs D bin to my path?
So you should:
- clone doom-emacs to ~/. emacs. d.
- switch to develop branch.
- copy ~/. emacs. d/init-example. el to your doom-private-dir/init. el (and maybe edit it)
- run doom quickstart.
- start emacs and run all-the-icons-install-fonts and restart emacs to pick up changes.
Why should I use Emacs?
Here are some other reasons I use Emacs for certain things: I use it for almost any typing or editing of text of more than a couple of lines, including writing emails. I’m even typing this comment in Emacs! … Editing text in Emacs is much more convenient than anything I can do in a puny browser textarea!
What is Emacs mode?
Emacs modes are different behaviors and features which you can turn on or off (or customize, of course) for use in different circumstances. Emacs modes are simply libraries of Lisp code that extend, modify, or enhance Emacs is some way. …
Is Emacs any good?
Emacs is very good for any kind of plain text file editing (I’m not talking about editing images or video files here), even for regular people (who is not a programmer). For me, Emacs is the best editor. … Emacs is completely open to the public. You can view the source code of Emacs in a mirrored repository on GitHub.