2022 Developer Survey is open! Take survey.
51 votes
Accepted

How to change the cursor type and color?

In order to change your cursor or caret, what you want to do is: Open your .emacs file and this line of code: (setq-default cursor-type 'bar) And to change the color: (set-cursor-color "#ffffff") ...
user avatar
  • 6,504
38 votes
Accepted

How to Change size of split screen emacs windows?

C-x- (shrink-window-if-larger-than-buffer) to shrink a window to fit its content. C-x+ (balance-windows) to make windows the same heights and widths. C-x^ (enlarge-window) to increase height by 1 ...
user avatar
  • 5,981
22 votes

Word wrap line option by default

JeanPierre's answer will work fine if you want to use different word wrapping per type of document. If you want all your documents word-wrapped, use the following: (global-visual-line-mode t) in ...
user avatar
19 votes
Accepted

Set column widths in `ibuffer`

As @Sigma's answer mentions, you need to customize ibuffer-formats. The docstring gives a lot of details about how to modify it by hand, and also notes that you can use the customize machinery to ...
user avatar
  • 31k
15 votes

Create a file link in org-mode that accepts spaces in the text

If you put the links in a file using org-mode (e.g. ending in .org), you can create links like this by: [[file:d:/path/to/filename with spaces]] I'm assuming you are on Windows, and this works for ...
user avatar
14 votes

How can I get undo behavior in Evil similar to Vim's?

Since @shosti pointed out that Evil considers deviation from Vim behavior as bugs, I filed a bug and one of the authors of Evil added a new possible value for evil-want-fine-undo: (setq evil-want-...
user avatar
  • 2,420
14 votes

Is there a way to change color of active window's fringe?

Since you want "To better distinguish between focused window", you can use other ways to do that instead of just changing the active window's fringe color. I combine three ways to better distinguish ...
user avatar
  • 2,559
13 votes

How to change the cursor type and color?

Cursor type can be set for a given buffer (using buffer-local variable cursor-type), as indicated in the answer by @King. (That answer uses setq-default to set the default value for all buffers.) Or ...
user avatar
  • 69.2k
12 votes
Accepted

How can I make customize use single quote for quotation?

Whether Lisp objects are printed using ' and #' is controlled by print-quoted. See section Output Variables of the Emacs Lisp manual. So, (advice-add 'custom-save-all :around (lambda (...
user avatar
  • 8,922
11 votes
Accepted

describe-face character not under / unreachable by the cursor

I do not know about using the mouse, but I've often found it's easiest for me to run list-faces-display and then just i-search for what the face is likely called or visually scan for text that looks ...
user avatar
11 votes
Accepted

How can I change where the customize puts custom-set-variables

Set the custom-file variable in your init file. C-hv custom-file RET
user avatar
  • 43.1k
10 votes

describe-face character not under / unreachable by the cursor

There are 4 regions where text may be displayed in Emacs, here is what you can do to inspect each of them. The mode-line: See the value of mode-line-format. The header-line: See the value of header-...
user avatar
  • 22.3k
10 votes
Accepted

How can I prevent GNU Emacs from splitting windows on startup?

You want the following in your init file: (setq inhibit-startup-screen t) or, equivalently, say M-x customize-variable RET inhibit-startup-screen RET
user avatar
  • 5,480
10 votes
Accepted

Emacs always ask to trust colour theme at startup

Your init.el file probably contains a snippet like this: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your ...
user avatar
  • 22.3k
10 votes
Accepted

How can I add a new colon-command to Evil?

The official way of doing this is demonstrated in evil-maps.el. Therefore, creating a new ex command is very simple: (evil-ex-define-cmd "b[utterfly]" 'butterfly) You'll want to either use this ...
user avatar
  • 21k
9 votes
Accepted

How to customize syntax highlight for just a given mode

Faces are global so changing its attributes anywhere changes it everywhere, as you've noticed. To change it locally, make a copy of the face, change the attributes in the copy and then use a mode ...
user avatar
  • 12.1k
9 votes

Make Buffer List take focus?

You can replace the command list-buffers which is run with C-x C-b to a function that does what you want. In this case buffer-menu-other-window opens the buffers list in another window with focus. ...
user avatar
  • 3,816
9 votes
Accepted

Word wrap line option by default

As you noticed, the menu entry says "Line Wrapping in This Buffer" so this is not something that is saved by "Save Options". To enable visual-line-mode in all your latex documents, add the following ...
user avatar
  • 6,943
9 votes
Accepted

How to use .dir-locals.el with Projectile?

.dir-locals.el does not care about the meaning of the variables that it sets, nor does it assume their values are lists (they do not have to be.) So it does not perform any merge or other processing. ...
user avatar
9 votes
Accepted

Customize ??? in which-func-mode

??? is displayed if which-func-mode (or which-function-mode in Emacs 25) can't determine the name of the current function. To customize it, modify the variable which-func-unknown, which is the "String ...
user avatar
  • 515
8 votes

Make Buffer List take focus?

An alternative is to switch to ibuffer, which does not share this problem. ibuffer is part of GNU Emacs, so on recent versions of Emacs you should just need to add (global-set-key (kbd "C-x C-b") '...
user avatar
  • 111
8 votes
Accepted

Display all setq possibilities

For best results and to avoid gotchas, do not use setq to set option values. Get in the habit of doing one of the following instead: Use M-x customize OPTION, where OPTION is the option name. Change ...
user avatar
  • 69.2k
7 votes

How to Change size of split screen emacs windows?

I would also recommend checking out either the windresize package from ELPA, or the windsize package from MELPA. With windresize, you can do M-x windresize and then use the arrow keys to move window ...
user avatar
  • 2,549
7 votes

How can I get undo behavior in Evil similar to Vim's?

According to the variable description (see C-h v evil-want-fine-undo) the value fine is not supported any more due to inconsistent behaviour. As I use undo to undo typos or the mentioned setting ...
user avatar
7 votes
Accepted

What does customize: Set for Current Session do?

Any change to the variable is equivalent here, so just M-x set-variable or (setq THE-VAR A-NEW-VALUE) is sufficient. The function called when you click Set for Current Session is custom-variable-set. ...
user avatar
  • 69.2k
7 votes
Accepted

Enable any outline mode for markdown

If I understand the question, you are looking for a way to edit markdown files where you can show or hide sections, navigate by headings and so on. I've never used allout-mode but it does look like ...
user avatar
  • 19.1k
7 votes
Accepted

On monkey-patching a third-party function

For variety, here's a solution using the :around advice. Copy the below test snippet to the *scratch* buffer and evaluate the progn form. (progn (defvar last-enabled-foo nil) (setq last-enabled-...
user avatar
  • 24.2k
7 votes

How can I change where the customize puts custom-set-variables

Example of exact text you may want to place in your init.el: (setq custom-file (concat user-emacs-directory "custom.el")) (load custom-file 'noerror)
user avatar
  • 7,069
7 votes
Accepted

Is it possible to organize the capture templates selection screen?

There are a couple of options for this, to me the easiest way is grouping templates using the built-in mechanism. My way to use capture templates is based in memory muscle rather than digging a long ...
user avatar
  • 2,366
6 votes

Dired: only reuse buffer for directories

If you get used to the fact that a replaces the current (dired) buffer with the selected file/directory, then you're not limited by a default approach; you just use the option you want at the time.
user avatar
  • 43.1k

Only top scored, non community-wiki answers of a minimum length are eligible