Skip to content

Instantly share code, notes, and snippets.

@fuzzy31u
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuzzy31u/4c8f9b5d779fb4144725 to your computer and use it in GitHub Desktop.
Save fuzzy31u/4c8f9b5d779fb4144725 to your computer and use it in GitHub Desktop.
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
;; editorconfig
(load "editorconfig")
;; No Tabs
(setq-default indent-tabs-mode nil)
;; Color in the current line
(global-hl-line-mode 1)
;; Show line number
;(column-number-mode 1)
;; Show full path in title bar
(setq frame-title-format "%f")
;; Show paren
;(show-paren-mode 1)
;; anything
(require 'anything-startup)
(define-key global-map (kbd "C-y") 'anything-show-kill-ring)
;; auto-complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/dict")
(ac-config-default)
;; color-moccur
(require 'color-moccur)
(define-key global-map (kbd "M-o") 'moccur-grep-find)
(setq moccur-split-word t)
;; moccur-edit
(require 'moccur-edit nil t)
(defadvice moccur-edit-change-file
(after save-after-moccur-edit-buffer activate)
(save-buffer))
;; web-mode, jsx-mode
(require 'jsx-mode)
(require 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.js'" . js2-mode))
(add-hook 'jsx-mode-hook (lambda () (auto-complete-mode 1)))
;; less
(require 'less-css-mode)
(add-to-list 'ac-modes 'less-css-mode)
(add-hook 'less-css-mode-hook 'ac-css-mode-setup)
;; set indent level
;; (setq jsx-indent-level 2)
;; (setq js-indent-level 2)
;; (setq less-css-indent-level 2)
;; (setq ejs-indent-level 2)
;; (setq styl-indent-level 2)
;; (setq css-indent-level 2)
(setq default-tab-width 4)
(setq js2-bounce-indent-p t)
(add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1)))
;; assign shortcut
(global-set-key (kbd "C-o") 'switch-to-buffer)
(global-set-key (kbd "C-;") 'comment-region)
(global-set-key (kbd "M-;") 'uncomment-region)
;; delete whitespace
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; exec-path-from-shell
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;; ido
(require 'flx-ido)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil)
(setq ns-use-srgb-colorspace t)
(add-hook 'before-save-hook 'whitespace-cleanup)
;; flycheck
(require 'flycheck)
(add-hook 'after-init-hook 'global-flycheck-mode)
;; yes-or-no
(defalias 'yes-or-no-p 'y-or-n-p)
;; theme
(load-theme 'whiteboard t)
;; Set default encoding
(prefer-coding-system 'utf-8)
;;(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.
;; '(package-archives
;; (quote
;; (("gnu" . "http://elpa.gnu.org/packages/")
;; ("marmalade" . "http://marmalade-repo.org/packages/")))))
;;)
;;(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.
;; )
;; http://coderepos.org/share/browser/lang/elisp/init-loader/init-loader.el
;; Set loading with init-loader under this specific folder
;; (require 'init-loader)
;; (init-loader-load "~/.emacs.d/conf")
;; auto-install
;; (when (require 'auto-install nil t)
;; (setq auto-istall-directory "~/.emacs.d/elisp/")
;; (auto-install-update-emacswiki-package-name t)
;; (auto-install-compatibility-setup))
;; ;; anything-c-moccur
; (require 'anything-c-moccur)
;; ;; less
;; (require 'less-css-mode)
;; (add-to-list 'ac-modes 'less-css-mode)
;; (add-hook 'less-css-mode-hook 'ac-css-mode-setup)
;; ;; stylus
;; (require 'sws-mode)
;; (require 'stylus-mode)
;; (add-to-list 'auto-mode-alist '("\\.styl\\'" . sws-mode))
;; ;; un-indent
;; (global-set-key (kbd "<S-tab>") 'un-indent-removing-2-spaces)
;; (defun un-indent-removing-2-spaces ()
;; "remove 2 spaces from beginning of line"
;; (interactive)
;; (save-excursion
;; (save-match-data
;; (beginning-of-line)
;; ;; get rid of tabs at begining of line
;; (when (looking-at "^\\s-+")
;; (untabify (match-beginning 0) (match-end 0)))
;; (when (looking-at "^ ")
;; (replace-match "")))))
(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)
'(current-language-environment "Japanese")
'(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment