Last active
April 25, 2019 04:00
-
-
Save magichim/47d3bea51c132950dc265fc47b23f8d7 to your computer and use it in GitHub Desktop.
My basic emacs setting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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