Skip to content

Instantly share code, notes, and snippets.

@zflat
Created May 18, 2014 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zflat/bcbf07fa39acde3d6ce6 to your computer and use it in GitHub Desktop.
Save zflat/bcbf07fa39acde3d6ce6 to your computer and use it in GitHub Desktop.
emacs initialization file ( ~/.emacs.d/init.el)
;; Configure emacs
;; Set font
;; http://askubuntu.com/questions/23603/how-to-change-font-size-in-emacs
(set-face-attribute 'default nil :height 120)
;; disable splash screen
(load "~/elisp/autoloads" 'install)
(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 init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.32")
'(inhibit-startup-screen t))
;; current buffer name in title bar
(setq frame-title-format "%b")
;;;;;;;;;;;;;
;; Start emacs to fill the screen
;; http://stackoverflow.com/questions/92971/how-do-i-set-the-size-of-emacs-window
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 120))
(add-to-list 'default-frame-alist (cons 'width 100)))
;; for the height, subtract a couple hundred pixels
;; from the screen height (for panels, menubars and
;; whatnot), then divide by the height of a char to
;; get the height we want
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 200)
(frame-char-height)))))))
(set-frame-size-according-to-resolution)
(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment