Files
emacs.d/elisp/settings.el
2019-10-12 14:58:51 -03:00

101 lines
2.7 KiB
EmacsLisp

;; Write custom set variables to different file
(setq custom-file "~/.emacs.d/elisp/custom.el")
;; Set my color theme
(load-theme 'zenburn t)
;; Set default encoding
(setq current-language-environment "UTF-8")
;; Always do syntax highlighting
(global-font-lock-mode 1)
;; Also highlight parens
(setq show-paren-delay 0
show-paren-style 'parenthesis)
(show-paren-mode 1)
;; This is the binary name of my scheme implementation
(setq scheme-program-name "racket")
;; C default style
(add-hook 'c-mode-hook
(lambda ()
(c-set-style "linux")))
;; Adding MELPA
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
'("melpa" . "http://melpa.org/packages/")
'("gnu" . "http://elpa.gnu.org/packages/")))
(put 'erase-buffer 'disabled nil)
;; remove trailing white spaces before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; disable bars
(tool-bar-mode -1)
;(menu-bar-mode -1)
(scroll-bar-mode -1)
;; disable cursor blinking
(setq blink-cursor-mode nil)
;; collumn numbers
(column-number-mode 1)
;;fix deadkeys
(require 'iso-transl)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-input-method "latin-1-prefix")
(defun my-set-default-input-method ()
(set-input-method 'latin-1-prefix))
(add-hook 'text-mode-hook 'my-set-default-input-method)
;; default fill-region size
(setq-default fill-column 80)
;; stop creating ~ files
(setq make-backup-files nil)
; Makes *scratch* empty.
(setq initial-scratch-message "")
;; Removes *scratch* from buffer after the mode has been set.
(defun remove-scratch-buffer ()
(if (get-buffer "*scratch*")
(kill-buffer "*scratch*")))
(add-hook 'after-change-major-mode-hook 'remove-scratch-buffer)
;; Removes *messages* from the buffer.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")
;; Removes *Completions* from buffer after you've opened a file.
(add-hook 'minibuffer-exit-hook
'(lambda ()
(let ((buffer "*Completions*"))
(and (get-buffer buffer)
(kill-buffer buffer)))))
;; Don't show *Buffer list* when opening multiple files at the same time.
(setq inhibit-startup-buffer-menu t)
;; Show only one active window when opening multiple files at the same time.
(add-hook 'window-setup-hook 'delete-other-windows)
;; No more typing the whole yes or no. Just y or n will do.
(fset 'yes-or-no-p 'y-or-n-p)
;; Make seamonkey available for use
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "seamonkey")
;; Mutt support
(setq auto-mode-alist (append '(("/tmp/neomutt.*" . mail-mode)) auto-mode-alist))