Skip to content

Instantly share code, notes, and snippets.

@pgjones
Last active June 6, 2023 07:42
Show Gist options
  • Save pgjones/2265231 to your computer and use it in GitHub Desktop.
Save pgjones/2265231 to your computer and use it in GitHub Desktop.
Good emacs init file, colours and no tabs
(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)
'(inhibit-startup-screen t)
'(line-number-mode t)
'(load-home-init-file t t)
'(package-selected-packages (quote (terraform-mode))))
(cond ((fboundp 'global-font-lock-mode)
;; Turn on font-lock in all modes that support it
(global-font-lock-mode t)
;; Maximum colors
(setq font-lock-maximum-decoration t)))
(setq default-tab-width 4)
(setq-default indent-tabs-mode nil)
(setq require-final-newline t)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-to-list 'auto-mode-alist '("\\.jinja\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . js-jsx-mode))
(add-to-list 'auto-mode-alist '("\\.ts\\'" . js-jsx-mode))
(add-to-list 'auto-mode-alist '("\\.tf\\'" . terraform-mode))
(load-theme 'tango-dark t)
(setq js-indent-level 2)
(setq css-indent-offset 2)
(require 'package)
(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-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.
)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.svelte?\\'" . web-mode))
(setq web-mode-code-indent-offset 2)
(setq web-mode-markup-indent-offset 2)
(setq web-mode-script-padding 2)
@pgjones
Copy link
Author

pgjones commented Jun 6, 2023

M-x package-install then web-mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment