If I do M-x customize-face RET default I can adjust the default face (font) in Emacs.
There are several options, all of them explained in the documentation. Many of these options can be selected from a menu when you select/click on Value Menu, but not the Font Family.
How can I see a list of the fonts that I can use in Font Family in Emacs?
Type the following in the *scratch* buffer, and press C-j at the end of it:
(font-family-list)
You may need to expand the result to see all of them, by hitting enter on the ... at the end.
If you are using Emacs 23.1 or later on the X Window System, the following fc-list command can list font families available on your system for Emacs (or any application using fontconfig):
$ fc-list : family
Related
How do change the font size in spacemacs? Do I need to download additional packages such as source code font?
I tried changing the font size in the configuration file, but the font size does not change. I am having trouble installing source code font, because the font paths are not registered correctly. The fonts were installed via the instructions provided by open source Adobe. Is there an easier way to do such a simple task in spacemacs?
Another way is to use the key sequence "SPC z x" and then press "+/=" key to increase font size or "-" key to decrease font size. Other options are shown on the which-key menu.
In my .spacemacs file I have the following
(defun dotspacemacs/init ()
(setq-default
dotspacemacs-startup-lists '(recents bookmarks projects)
dotspacemacs-default-font '("SourceCode Pro"
:size 18
:weight normal
:width normal
:powerline-offset 2))
Of course you should change the font to your liking. The powerline has some char that goes well with the powerline in spacemacs.
To get to .spacemacs simply type SPC f e d to reload the new file type SPC f e R.
This should do it.
And yes I am an old man with less than optimal eyes, hence the rather large font.
If you don't want to change the default settings or want to change the font size without restarting emacs, try:
M-x text-scale-increase
Another way I do it (at least in Ubuntu 20.04) is to click CTRL and move the scroll wheel on your mouse or touchpad to increase/decrease the size of the text.
I have a window whose mode line at the bottom says "(Text Spc Fill)", probably as a default for *.txt filenames. "Spc" seems to be a minor mode which attempts to preserve English text by, for example, collapsing two spaces to one after a word is removed. However, I don't want that in this buffer.
So, how can I turn off this minor mode?
I don't know the actual name of the mode. I tried M-x spc-mode and M-x space-mode, and I looked through a few help pages.
More generally, is there an easy way to get the list of modes which are active in the current buffer? Or to find out about a mode given its mode-line abbreviation? (These can be unpredictable; for example, M-x visual-line-mode corresponds to (WordWrap).)
This is Aquamacs, Emacs version 23.3.50.1.
To answer your second question, the command describe-mode (C-hm) will list
your major mode, along with
some documentation (usually including keybindings), and
all of the minor modes that are active
You might be surprised how many minor modes are active in a typical setup. Not all active modes have an "indicator."
in your .emacs file add the line
(remove-hook 'text-mode-hook 'turn-on-auto-fill)
Source
I've been attempting to alter the font / face for the emacs minibuffer separately from emacs default fonts, but without much luck.
Specifically, I'm interested in making the minibuffer font size larger for use with the emacs MULE as, with my current font setting or if I'm using emacs on a "netbook" screen, sometimes the character selection options in the MULE are a bit small.
Options easily accessed within emacs are the minibuffer-prompt & minibuffer-prompt-properties, but these are only for command prompts and not the regular minibuffer text.
There seem to be a number of minibuffer variables listed in emacs for creating minibuffer frames, or getting contents from minibuffer windows, etc.. but these do not pertain to altering the minibuffer face. Is it even possible to alter the minibuffer face separately from the default emacs?
An interesting option is the oneonone emacs http://www.emacswiki.org/emacs/OneOnOneEmacs project. But could the dedicated minibuffer frame be altered? Also before I alter my current emacs set-up that drastically, I'd hope to be able to just alter fonts first or create my own alterable minibuffer frame, etc...
Any help and/or creative ideas would be greatly appreciated.
You can add customization to the minibuffer through the minibuffer-setup-hook. In there, you can do some face remapping like so:
(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)
(defun my-minibuffer-setup ()
(set (make-local-variable 'face-remapping-alist)
'((default :height 2.0))))
Change the body of the my-minibuffer-setup as desired. The above doubles the height of the default face.
Yes, you can easily customize the properties of a standalone minibuffer frame, including its default face and font.
You can customize the OneOnOneEmacs user option 1on1-minibuffer-frame-alist. (Or you can customize the standard option minibuffer-frame-alist -- its frame parameter values are used as defaults by 1on1-minibuffer-frame-alist.)
The font frame parameter is the one that controls the font (duh). So you would customize option 1on1-minibuffer-frame-alist, changing its setting for the font.
Alternatively, you can just set 1on1-minibuffer-frame-font to the font you want -- it is used as the default value for the font setting by 1on1-minibuffer-frame-alist whenever there is no explicit font setting in minibuffer-frame-alist. For example:
(setq 1on1-minibuffer-frame-font
"-*-Lucida Console-normal-r-*-*-14-112-96-96-c-*-iso8859-1")
If you do not want to use a standalone minibuffer frame then see Trey's answer.
Is there a way to list all the yanked text in Emacs? You can do it on Textmate with SPLAT+V.
Edit: I meant recently killed items, items that can be yanked.
The list of kills (i.e., the list of things you can yank) is called kill ring and stored in the variable kill-ring, so you can view it (in a not very nice way) with C-h v kill-ring RET.
The kill ring also appears in the menu, under “Edit / Paste from kill menu”. If you use a text mode Emacs or have turned the menu bar off, you can access the menu with M-x tmm-menubar (bound to M-`): type M-` e p followed by the first letter of the item you want to paste (if it's a letter and it's unique, otherwise whatever character is indicated). If you don't want to paste anything, type M-` e p C-g; the kills remain in the *Completions* buffer. The kill texts are displayed truncated to yank-menu-length characters.
To my knowledge, emacs doesn't support that feature out of the box.
If you're using a Debian or Ubuntu Linux distribution, you can install the emacs-goodies-el package, which contains a browse-kill-ring feature (bound to M-y by default).
Alternatively, you can use the browse-kill-ring ELisp package available here.
See also here for a nice article about this problem and other alternate solutions.
EmacsWiki has a satisfying list of solutions. A portable and intuitive solution uses the built-in popup.el to display a vertical list to choose from:
(global-set-key (kbd "C-c y") '(lambda ()
(interactive)
(popup-menu 'yank-menu)))
In Icicles you can see all of your kill-ring, and yank any entries in it using completion. By default, C-y is bound in Icicle mode to icicle-yank-maybe-completing.
That's the same as yank, unless you give it a negative prefix arg (e.g., C--). In that case, it lets you complete against the kill-ring. Completion can be prefix, apropos (substring, regexp), or fuzzy.
http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands
councel-yank-pop wors well for me
especially with the binding suggested in
http://pragmaticemacs.com/emacs/counsel-yank-pop-with-a-tweak/
(use-package counsel
:bind
(("M-y" . counsel-yank-pop)
:map ivy-minibuffer-map
("M-y" . ivy-next-line)))
if you use helm, you may call the helm-show-kill-ring function.
I have font-lock mode on by putting (global-font-lock-mode 1) in .emacs. And, with font-lock mode "your program certainly look different" as explained in page 274 of Learning GNU emacs.
What I found was that, with python mode or org mode, when I change the font for that mode, some of the keywords are not shown because of the change in color. I mean, some of the characters(keywords) becomes white, and when the background color is white, those keywords are not seen anymore.
Is this expected behavior? With font-lock mode, am I supposed not to change any font?
What's the good for font-lock mode?
This is the code for changing default code.
;;; http://www.emacswiki.org/emacs/AquamacsFAQ
(set-default-font "-apple-dejavu sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman")
And I used the following options to change a font for specific mode.
http://a.imageshack.us/img823/2772/fontq.png
Is this expected behavior? With font-lock mode, am I supposed not to change any font?
Yes. You have to customize the font faces and colors using customize-face command (change colors starting with "Font Lock"), or use a theme engine like color-theme.
What's the good for font-lock mode?
You can customize and extend font-lock to your need as this is the case for all things in emacs. This is the basic system for syntax highlighting that is used by the majority of the emacs users.
You have to learn how to customize it to your needs (C-h i m Emacs RET m Font Lock RET )
From the emacs help on function font-lock-mode:
Toggle Font Lock mode.
With arg, turn Font Lock mode off if and only if arg is a non-positive
number; if arg is nil, toggle Font Lock mode; anything else turns Font
Lock on.
(Font Lock is also known as "syntax highlighting".)