Skip to content

Instantly share code, notes, and snippets.

@qualalia
Created September 15, 2020 19:58
Show Gist options
  • Save qualalia/ae9c6eb110d4e3d856fede81ead8bbb0 to your computer and use it in GitHub Desktop.
Save qualalia/ae9c6eb110d4e3d856fede81ead8bbb0 to your computer and use it in GitHub Desktop.
emacs config file
;;; .emacs --- config
;;; Commentary:
;;; Code:
(setq visible-bell t)
(setq ring-bell-function 'ignore)
(defun prettify-file ()
"Prettifies the current file."
(when (and (boundp 'prettify-shell-command) prettify-shell-command)
(call-process-shell-command (format prettify-shell-command buffer-file-name) nil "command output")))
(add-hook 'after-save-hook 'prettify-file)
(setq indent-tabs-mode nil)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;(straight-use-package 'nvm)
;(nvm-use "12.10.0")
(global-auto-revert-mode)
;; M-x u for undo tree
(straight-use-package 'undo-tree)
(global-undo-tree-mode)
(straight-use-package 'helm)
(global-set-key (kbd "M-x") 'helm-M-x)
(tool-bar-mode 0)
(menu-bar-mode 0)
(scroll-bar-mode 0)
(fringe-mode '(8 . 0))
(setq show-paren-delay 0)
(show-paren-mode)
(straight-use-package 'web-mode)
(setq web-mode-content-types-alist
'(("jsx" . "\\.js[x]?\\'")))
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-css-indent-offset 2)
(setq web-mode-enable-auto-quoting nil)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.jsx?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.php?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.css?\\'" . web-mode))
(setq web-mode-engines-alist
'(("php" . "\\.phtml\\'")
("blade" . "\\.blade\\."))
)
(set-frame-font "Monaco 16" nil t)
(require 'package)
(add-to-list 'package-archives
'("MELPA Stable" . "https://stable.melpa.org/packages/") t)
;; (package-initialize)
;; flycheck
(straight-use-package 'flycheck)
(require 'flycheck)
;; turn on flycheck globally
(add-hook 'after-init-hook #'global-flycheck-mode)
;; disable jshint...
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(javascript-jshint)))
;; ...use eslint
(flycheck-add-mode 'javascript-eslint 'web-mode)
;; customize flycheck temp file prefix
(setq-default flycheck-temp-prefix ".flycheck")
;; disable json-jsonlist checking for json files
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(json-jsonlist)))
;; prettier
;; (straight-use-package 'prettier-js)
;; (require 'prettier-js)
;; php-mode
(straight-use-package 'php-mode)
;; no blinking cursor
(blink-cursor-mode 0)
(line-number-mode t)
(column-number-mode t)
;; company
(straight-use-package 'company)
(global-company-mode)
(setq company-idle-delay 0)
(provide '.emacs)
;;; emacs ends here
(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.
'(custom-enabled-themes (quote (whiteboard)))
'(inhibit-startup-screen 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.
)
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
backup-by-copying t
version-control t
delete-old-versions t
kept-new-versions 20
kept-old-versions 5
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment