(setq ring-bell-function #'ignore)
(blink-cursor-mode -1)
(setq inhibit-startup-screen t)
(defalias 'yes-or-no-p 'y-or-n-p)
Enable Blink Cursor
(blink-cursor-mode 1)
Stop Blink Cursor
(blink-cursor-mode 0)
Set indentation with spaces instead of tabs with 4 spaces
(setq tab-width 4 indent-tabs-mode nil)
;; set default tab char's display width to 4 spaces
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
;; make tab key always call a indent command.
(setq-default tab-always-indent t)
;; make tab key call indent command or insert tab character, depending on cursor position
(setq-default tab-always-indent nil)
;; make tab key do indent first then completion.
(setq-default tab-always-indent 'complete)
(set-default-font "Inconsolata 14")
;; Character encodings default to utf-8.
(prefer-coding-system 'utf-8)
(set-language-environment 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
Enable
(setq make-backup-files t)
Disable
(setq make-backup-files nil)
ELISP> (show-paren-mode 1) t
Delete trailing whitespace before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
Set the default web browsr used by (browse-url <url>) function and by org-mode.
;; Set the default web browser to Chromium Browsr
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "chromium-browser")
Hide Menu Bar
(menu-bar-mode 0)
Show Menu Bar
(menu-bar-mode 1)
Show Tool Bar
(tool-bar-mode 1)
Hide Tool Bar
(tool-bar-mode 0)
Show
(scroll-bar-mode 1)
Hide
(scroll-bar-mode -1)
From: Ask HN Emacs Users: What’s in your .emacs file?
;; Don't display the 'Welcome to GNU Emacs' buffer on startup
(setq inhibit-startup-message t)
;; Display this instead of "For information about GNU Emacs and the
;; GNU system, type C-h C-a.". This has been made intentionally hard
;; to customize in GNU Emacs so I have to resort to hackery.
(defun display-startup-echo-area-message ()
"If it wasn't for this you'd be GNU/Spammed by now"
(message ""))
;; Don't insert instructions in the *scratch* buffer
(setq initial-scratch-message nil)
It will keep the user customization created with M-x customize-theme, M-x customize-group in a separate file ~/.emacs.d/custom.el.
(setq custom-file (concat (file-name-as-directory user-emacs-directory)
"custom.el"
))
(load custom-file 'noerror)
(prefer-coding-system 'utf-8)
;; force emacs to always use spaces instead of tab characters
(setq-default indent-tabs-mode nil)
;; set default tab width to 4 spaces
(setq default-tab-width 4)
(setq tab-width 4)
;disable backup
(setq backup-inhibited t)
;disable auto save
(setq auto-save-default nil)
;; Get Rid of temporary files ending in ~
;; The temporary files will be in the temporary directory
;;
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
;; Move Deleted Files to Trash
;;
(setq delete-by-moving-to-trash t)
(setq line-number-mode t)
(setq column-number-mode t)
When doing C-x C-f use information at point (your cursor) to open file or URL. I.e. if your cursor is on a file path, or URL, it defaults to that filled in the minibuffer.
;;find-file-at-point, smarter C-x C-f when point on path or URL
(ffap-bindings)
;; Unique buffer name
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
Enable Mark Current Line
;; mark current line:
(global-hl-line-mode 1)
Disable Mark Current Line
;; mark current line:
(global-hl-line-mode 0)
Show recent files in the File menu.
;; recentf stuff
;; recentf - F5
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-saved-items 500)
(setq recentf-max-menu-items 60)
Saves the minibuffer history on every Emacs session.
(savehist-mode 1)
(setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring))
;; To set the file which the minibuffer is saved use:
(setq savehist-file "~/.emacs.d/tmp/savehist")
Load a color theme
(load-theme 'wombat t)
Choose a color theme
M-x customize-theme