Skip to content

Instantly share code, notes, and snippets.

@2016rshah
Created August 15, 2017 19:34
Show Gist options
  • Save 2016rshah/9f5fc3e5080dd60e533711322e796c3e to your computer and use it in GitHub Desktop.
Save 2016rshah/9f5fc3e5080dd60e533711322e796c3e to your computer and use it in GitHub Desktop.
.emacs-originate
(require 'package)
(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/")
("melpa-stable" . "http://stable.melpa.org/packages/"))))
'(package-selected-packages
(quote
(markdown-mode ranger liquid-types flycheck-liquidhs flycheck-color-mode-line button-lock popup pos-tip intero haskell-mode))))
(package-initialize)
(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.
)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(package-install 'intero)
(add-hook 'haskell-mode-hook 'intero-mode)
(global-set-key (kbd "C-c /") 'comment-or-uncomment-region)
;; Need to find a way to not do this on markdown files
;; (add-hook 'before-save-hook 'delete-trailing-whitespace)
(defun my-setup-indent (n)
;; java/c/c++
(setq-local c-basic-offset n)
;; web development
(setq-local coffee-tab-width n) ; coffeescript
(setq-local javascript-indent-level n) ; javascript-mode
(setq-local js-indent-level n) ; js-mode
(setq-local js2-basic-offset n) ; js2-mode, in latest js2-mode, it's alias of js-indent-level
(setq-local web-mode-markup-indent-offset n) ; web-mode, html tag in html file
(setq-local web-mode-css-indent-offset n) ; web-mode, css in html file
(setq-local web-mode-code-indent-offset n) ; web-mode, js code in html file
(setq-local css-indent-offset n) ; css-mode
)
(defun my-office-code-style ()
(interactive)
(message "Office code style!")
;; use spaces
(setq-local indent-tabs-mode nil)
;; indent 2 spaces width
(my-setup-indent 2))
(defun my-personal-code-style ()
(interactive)
(message "My personal code style!")
;; use space instead of tab
(setq indent-tabs-mode nil)
;; indent 2 spaces width
(my-setup-indent 2))
(ranger-override-dired-mode t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment