Last active
June 6, 2023 07:42
-
-
Save pgjones/2265231 to your computer and use it in GitHub Desktop.
Good emacs init file, colours and no tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
M-x package-install
thenweb-mode