Skip to content

Instantly share code, notes, and snippets.

@magichim magichim/init.el
Last active Apr 25, 2019

Embed
What would you like to do?
My basic emacs setting.
(package-initialize)
(setq auto-save-default nil)
;; Not make backup files
(setq make-backup-files nil)
;; Set language environment
(set-language-environment "UTF-8")
;; Show line number
(global-linum-mode t)
;; Custom line number style
(setq linum-format "%4d ")
;; set tab size 4
(setq default-tab-width 4)
;; prevent auto indentation
;;(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
(global-set-key (kbd "<backtab>") 'un-indent-by-removing-4-spaces)
(defun un-indent-by-removing-4-spaces ()
"remove 4 spaces from beginning of of line"
(interactive)
(save-excursion
(save-match-data
(beginning-of-line)
;; get rid of tabs at beginning of line
(when (looking-at "^\\s-+")
(untabify (match-beginning 0) (match-end 0)))
(when (looking-at "^ ")
(replace-match "")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.