Skip to content

Instantly share code, notes, and snippets.

@1duo
Last active July 26, 2018 17:32
Show Gist options
  • Save 1duo/a41925b56fc1a462686534d0630c59ca to your computer and use it in GitHub Desktop.
Save 1duo/a41925b56fc1a462686534d0630c59ca to your computer and use it in GitHub Desktop.
My Zero-Dependency Emacs Configurations.
;;; CUDA syntax hihlighting
(add-to-list 'auto-mode-alist '("\\.cuh\\'" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.cu\\'" . c++-mode))
(setq fill-column 80)
(setq text-mode-hook 'turn-on-auto-fill)
(setq default-major-mode 'text-mode)
(defun iwb ()
"indent whole buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))
(global-set-key [f12] 'iwb)
;; set the fill column
(setq-default fill-column 80)
(setq auto-fill-mode 1)
;; display time
(display-time-mode 1)
(setq display-time-day-and-date t)
;; brackets
(setq show-paren-mode t)
(setq show-paren-style 'parenthesis)
;; grammar highlights
(setq global-font-lock-mode t)
(require 'generic-x)
;; linenumbers
(setq column-number-mode 1)
(setq line-number-mode 1)
(setq linum-format "%4d ")
(setq column-number-mode t)
;; highlight current line
(global-hl-line-mode 0)
;; auto save file / temp file
(setq auto-save-default nil)
(setq make-backup-file nil)
(setq-default make-backup-files nil)
(setq whitespace-global-mode t)
(setq show-paren-style 'parenthesis)
(global-hl-line-mode t)
;;Auto kill trailing spaces
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;;Remember cursor position
(if (version< emacs-version "25.0")
(progn
(require 'saveplace)
(setq-default save-place t))
(save-place-mode 1))
;;Show line numbers
(add-hook 'prog-mode-hook 'linum-mode)
(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.
'(column-number-mode t)
'(custom-safe-themes (quote ("eca0d32bfc51767d389e52a1082eb4911f7bd96a2637baaf2da6faf95d777a5e" default)))
'(display-time-mode t)
'(line-number-mode 1)
'(show-paren-mode t))
(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.
)
(load-theme 'wombat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment