Questions tagged [init-file]

for questions about initialization files .emacs or `init.el. DO NOT USE this tag if you assume answers require tweaking initialization files because many solutions do not involve directly manipulating initialization files.

On startup, Emacs normally loads a Lisp program from an initialization file, or init file for short. It is how Emacs is customized. Emacs looks for the init file using the filenames ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el (where ~/ is the home directory). Use the tag for questions pertaining to any of these initialization files.

Use for questions about:

  • ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el
  • customs, protocols, and canonical practices for Emacs startup files
  • errors in

Do not use for questions:

  • that you assume may need code snippets in the
813 questions
124
votes
6 answers

Are there any advantages to using ~/.emacs.d/init.el instead of ~/.emacs?

I've normally used ~/.emacs for my config file, but I've noticed others using ~/.emacs.d/init.el. Are there advantages to the init.el location? Any disadvantages?
Larry Coleman
  • 1,475
  • 2
  • 11
  • 10
76
votes
14 answers

How to start emacs with a custom user-emacs-directory

I'm working on a custom and small Emacs configuration that I want to share with some friends as a git repository for them to use as a baseline for their own future configurations. For this I need some way to test my configuration and the simplest…
Mattias Bengtsson
  • 1,300
  • 1
  • 11
  • 18
29
votes
12 answers

Organize the content of ~/.emacs.d/init.el and ~/emacs.d?

When we add more and more lines into ~/.emacs.d/init.el for various purposes (for python-mode, for emacs-eclim, for ...), the file becomes lengthy and less readable. Is there a way to help organize its content? My current ~/.emacs.d looks like…
Tim
  • 5,007
  • 7
  • 32
  • 61
16
votes
2 answers

Function to open my init file for editing or return its path

Is there a function I can call that opens my init file for editing or returns its path?
daveloyall
  • 1,300
  • 9
  • 21
14
votes
7 answers

How do I "group" hooks?

There are certain things like the display of trailing whitespace, display of buffer boundaries, rainbow-colored delimiters and many more I'd like to enable in most modes or rather, all programming- and text-related ones (because displaying trailing…
wasamasa
  • 22,178
  • 1
  • 66
  • 99
13
votes
3 answers

project specific init file

I have some customizations for emacs that I'd like to use for a single project, but not affect emacs globally. Is there any way I can have emacs load a specific init file when launched from a certain directory or automatically load all init files in…
Connor
  • 1,611
  • 1
  • 21
  • 26
13
votes
3 answers

How can I find my Emacs init file?

I have read the guide found here: How Emacs Finds Your Init File I cannot find any .emacs directory in my home directory. I have show hidden files selected. I also cannot find the init.el file in Emacs home directory. Since I have been unable to…
Georgina Davenport
  • 311
  • 1
  • 2
  • 10
9
votes
1 answer

Automatically identify obsolete variables in init-file

When a new version of Emacs is released it is usually the case that some variables/commands/functions become obsolete. They are usually marked as such in the corresponding documentation: turn-on-eldoc-mode is an alias for eldoc-mode in eldoc.el.…
itsjeyd
  • 14,666
  • 3
  • 59
  • 87
9
votes
2 answers

Relative paths in init file

When loading things like themes from custom directories, is it possible to specify a path relative to the init.el file, rather than an absolute path? I ask because I want to be able to use the same config file across my OSX and Windows machines,…
Simon
  • 421
  • 6
  • 15
8
votes
1 answer

Controlling the width of the vertical scroll bar

I am using emacs 24.5 under Linux Gentoo, and I would like to adjust the vertical scroll bar width, as I notice it became much larger than it was in a recent revision. How to do this in my ".emacs" file ? I tried to manually set variable…
Xavier
  • 81
  • 3
6
votes
1 answer

how to hide scratch buffer when starting emacs while opening a file?

emacs-25 GUI on Debian. I set up emacs so that it shows the scratch buffer at startup. However, when I open a file via a file manager with right-click -> open with -> emacs, emacs starts up with a split screen and two buffers: on top the scratch…
rockemacs
  • 61
  • 1
  • 2
6
votes
4 answers

forward-sexp: Scan error: "Unbalanced parentheses", 30586, 41369

When using the menu system to modify customizations (Options > Customize Emacs > ...etc...), I am Able to "Apply" the change for the curent session Unable to "Apply and save" for future sessions The error message I get is 'forward-sexp: Scan…
davesailer
  • 91
  • 1
  • 5
5
votes
1 answer

How to postpone redrawing on startup?

On startup I can see the fonts and color scheme before my own are loaded in. Is it possible to drawing the interface until a certain moment when settings are loaded? Incase it's important: Linux, GTK3 UI, 26.2 (latest at time of writing)
ideasman42
  • 8,786
  • 1
  • 32
  • 114
5
votes
0 answers

.emacs bankruptcy -- how to do it well

So, at this point my .emacs.d and files with it is older than a lot of people reading this question, and with packages, version changes, packages that have gone obsolete, and so on. It's a mess. It's time to declare emacs bankruptcy again. So, with…
Charlie Martin
  • 349
  • 1
  • 10
5
votes
1 answer

Emacs inside Tmux problem

This might have an obvious answer but I've been trying to fix this issue with no luck. (I'm new to Emacs) Whenever I start Emacs within a Tmux pane, it ignores some of my .emacs settings. These are the contents of the .emacs…
Rtsne42
  • 489
  • 5
  • 13
1
2 3 4 5 6 7