Skip to content

Instantly share code, notes, and snippets.

@EkoAdiWijayanto
Last active January 3, 2016 10:05
Show Gist options
  • Save EkoAdiWijayanto/3951f798c7b30c0d64c3 to your computer and use it in GitHub Desktop.
Save EkoAdiWijayanto/3951f798c7b30c0d64c3 to your computer and use it in GitHub Desktop.
(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.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(custom-enabled-themes (quote (misterioso)))
'(inhibit-startup-screen t)
'(initial-frame-alist (quote ((fullscreen . maximized))))
'(js2-basic-offset 2)
'(package-archives
(quote
(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.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.
)
(package-initialize)
(defun duplicate-current-line-or-region (arg)
"Duplicates the current line or region ARG times.
If there's no region, the current line will be duplicated. However, if
there's a region, all lines that region covers will be duplicated."
(interactive "p")
(let (beg end (origin (point)))
(if (and mark-active (> (point) (mark)))
(exchange-point-and-mark))
(setq beg (line-beginning-position))
(if mark-active
(exchange-point-and-mark))
(setq end (line-end-position))
(let ((region (buffer-substring-no-properties beg end)))
(dotimes (i arg)
(goto-char end)
(newline)
(insert region)
(setq end (point)))
(goto-char (+ origin (* (length region) arg) arg)))))
(global-set-key (kbd "C-c d") 'duplicate-current-line-or-region)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(set-default 'cursor-type 'box)
(blink-cursor-mode 0)
(ido-mode)
(column-number-mode)
(show-paren-mode)
(global-hl-line-mode)
(winner-mode t)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
(autopair-global-mode)
(global-undo-tree-mode)
(global-set-key (kbd "M-/") 'undo-tree-visualize)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(eval-after-load 'js2-mode
'(define-key js2-mode-map (kbd "C-c b") 'web-beautify-js))
(eval-after-load 'js
'(define-key js-mode-map (kbd "C-c b") 'web-beautify-js))
(eval-after-load 'json-mode
'(define-key json-mode-map (kbd "C-c b") 'web-beautify-js))
(eval-after-load 'sgml-mode
'(define-key html-mode-map (kbd "C-c b") 'web-beautify-html))
(eval-after-load 'css-mode
'(define-key css-mode-map (kbd "C-c b") 'web-beautify-css))
(eval-after-load 'js2-mode
'(add-hook 'js2-mode-hook
(lambda ()
(add-hook 'before-save-hook 'web-beautify-js-buffer t t))))
;; Or if you're using 'js-mode' (a.k.a 'javascript-mode')
(eval-after-load 'js
'(add-hook 'js-mode-hook
(lambda ()
(add-hook 'before-save-hook 'web-beautify-js-buffer t t))))
(eval-after-load 'json-mode
'(add-hook 'json-mode-hook
(lambda ()
(add-hook 'before-save-hook 'web-beautify-js-buffer t t))))
(eval-after-load 'sgml-mode
'(add-hook 'html-mode-hook
(lambda ()
(add-hook 'before-save-hook 'web-beautify-html-buffer t t))))
(eval-after-load 'css-mode
'(add-hook 'css-mode-hook
(lambda ()
(add-hook 'before-save-hook 'web-beautify-css-buffer t t))))
;disable backup
(setq backup-inhibited t)
;disable auto save
(setq auto-save-default nil)
(delete-selection-mode 1)
(setq redisplay-dont-pause t)
(setq-default indent-tabs-mode nil)
(setq tab-width 2)
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-hook 'js2-mode-hook 'ac-js2-mode)
(require 'emmet-mode)
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
ac-js2
auto-complete
autopair
emmet-mode
js2-mode
multiple-cursors
nlinum
smex
undo-tree
web-beautify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment