Skip to content

Instantly share code, notes, and snippets.

@magichim
Last active February 28, 2020 08:03
Show Gist options
  • Save magichim/3d50476885860e3a95401475956d1cb8 to your computer and use it in GitHub Desktop.
Save magichim/3d50476885860e3a95401475956d1cb8 to your computer and use it in GitHub Desktop.
New emacs init
;; melpa default setting
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/")
t))
;;
;;(when (not package-archive-contents)
;; (package-refresh-contents))
;; Disable auto save
(package-initialize)
(setq auto-save-default nil)
;; Don't make backup files(~)
(setq-default make-backup-files nil)
;; Show line number
(global-linum-mode t)
;; Custom line number style
(setq linum-format "%4d ")
;; Make tab usable
(global-set-key (kbd "TAB") 'self-insert-command)
;; backtab
(global-set-key (kbd "<backtab>") 'backward-kill-word)
;; Auto tab indentation disable
;;(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
;; Set language environment
(set-language-environment "utf-8")
;;Tab indent
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
;; JS
(setq js-indent-level 2)
;; TS
(setq typescript-indent-level 2)
;; JSX
;; Use rjsx-mode for js files
(add-to-list 'auto-mode-alist '("\\.js\\'" . rjsx-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment