また、フォントサイズをファイルに保存したいと思い.emacs
ます。
17 に答える
(set-face-attribute 'default nil :height 100)
値は 1/10pt なので、100 は 10pt になります。
Emacswikiから、GNU Emacs 23 には組み込みのキーの組み合わせがあります。
C-xC-+バッファのテキストサイズをC-xC--増減する
Shift キーを押しながら最初のマウス ボタンを押します。次の方法でフォント サイズを変更できます 。この Web サイトには詳細があります。
M-x customize-face RET defaultdefault
他のすべての面のベースとなる面面を設定できます。ここでフォントサイズを設定できます。
これが私の.emacsの内容です。実際には、color-theme が基本を設定し、次に私のカスタム フェイス設定がいくつかのものをオーバーライドします。custom-set-faces は、emacs の Customize-face メカニズムによって記述されます。
;; my colour theme is whateveryouwant :)
(require 'color-theme)
(color-theme-initialize)
(color-theme-whateveryouwant)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
'(font-lock-comment-face ((t (:foreground "darkorange4"))))
'(font-lock-function-name-face ((t (:foreground "navy"))))
'(font-lock-keyword-face ((t (:foreground "red4"))))
'(font-lock-type-face ((t (:foreground "black"))))
'(linum ((t (:inherit shadow :background "gray95"))))
'(mode-line ((t (nil nil nil nil :background "grey90" (:line-width -1 :color nil :style released-button) "black" :box nil :width condensed :foundry "unknown" :family "DejaVu Sans Mono")))))
これは別の簡単な解決策です。24でも活躍
(set-default-font "Monaco 14")
ショートカット:
`C-+` increases font size
`C--` Decreases font size
私は私の中に次のものを持っています.emacs
:
(defun fontify-frame (frame)
(set-frame-parameter frame 'font "Monospace-11"))
;; Fontify current frame
(fontify-frame nil)
;; Fontify any future frames
(push 'fontify-frame after-make-frame-functions)
を選択した任意のフォントに置き換えることができます"Monospace-11"
。使用可能なオプションのセットは、システムに大きく依存します。M-x set-default-font
タブの完了を使用して確認すると、いくつかのアイデアが得られます。私のシステムでは、Emacs 23とアンチエイリアシングが有効になっているので、名前でシステムフォントを選択できます(例:、Monospace
などSans Serif
)。
X11でemacsを開き、メニューオプションに移動し、「デフォルトのフォントを設定...」を選択して、フォントサイズを変更します。同じメニューで「オプションの保存」を選択します。終わり。
zoom.cfgとglobal-zoom.cfgは、フォント サイズ変更バインディングを提供します (EmacsWiki より)
- C-- または C-mousewheel-up: フォント サイズを大きくします。
- C-+ または C-mousewheel-down: フォント サイズを小さくします。
- C-0 はフォント サイズをデフォルトに戻します。
フォントの高さを一度に 1 ポイントずつインタラクティブにサイズ変更するオプションを次に示します。
;; font sizes
(global-set-key (kbd "s-=")
(lambda ()
(interactive)
(let ((old-face-attribute (face-attribute 'default :height)))
(set-face-attribute 'default nil :height (+ old-face-attribute 10)))))
(global-set-key (kbd "s--")
(lambda ()
(interactive)
(let ((old-face-attribute (face-attribute 'default :height)))
(set-face-attribute 'default nil :height (- old-face-attribute 10)))))
これは、すべてのバッファでテキストのサイズを変更する場合に適しています。ガターの行番号が後で途切れる可能性があるため、text-scale-increase
andを使用したソリューションは好きではありません。text-scale-decrease
それはすべて、フォントサイズを変更することの意味によって異なります。この EmacsWiki セクションは、最良かつ最も完全な情報を提供します。さまざまなケース (テキストのスケーリング、フレーム フォント、バッファー/フレームなど) を区別します:フォント サイズの変更。
AquaMacsで、現在のバッファのフォント サイズを調整しますCMD +
。CMD -
コンソール emacs (emacs -nw) に満足しています。最新の vterm 実装 (gnome-terminal など) は、フォントのサポートが優れている傾向があります。さらに、それに慣れれば、tmux を使用できるようになるため、X がなくても、リモート サーバー上の完全な環境での作業が可能になります。
NTEmacs 23.1 では、オプション メニューに「既定のフォントを設定...」オプションがあります。