Last active
December 16, 2020 08:40
-
-
Save node13h/eff3b68f319c8fa8af41 to your computer and use it in GitHub Desktop.
.emacs for Python development
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
;;; package --- Summary | |
;;; Commentary: | |
;;; | |
;;; Code: | |
;;; | |
;; Added by Package.el. This must come before configurations of | |
;; installed packages. Don't delete this line. If you don't want it, | |
;; just comment it out by adding a semicolon to the start of the line. | |
;; You may delete these explanatory comments. | |
(prefer-coding-system 'utf-8) | |
(package-initialize) | |
(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. | |
'(ac-auto-show-menu nil) | |
'(ac-delay 0.5) | |
'(custom-enabled-themes (quote (spacemacs-light))) | |
'(elpy-modules | |
(quote | |
(elpy-module-company elpy-module-eldoc elpy-module-pyvenv elpy-module-highlight-indentation elpy-module-yasnippet elpy-module-django elpy-module-sane-defaults))) | |
'(elpy-rpc-backend "jedi") | |
'(flycheck-flake8-maximum-line-length 90) | |
'(global-auto-revert-mode t) | |
'(global-diff-hl-mode t) | |
'(global-flycheck-mode t) | |
'(global-whitespace-mode t) | |
'(ido-mode (quote both) nil (ido)) | |
'(indent-tabs-mode nil) | |
'(inhibit-startup-screen t) | |
'(magit-diff-use-overlays nil) | |
'(markdown-header-scaling nil) | |
'(org-adapt-indentation t) | |
'(org-agenda-files (quote ("~/Org"))) | |
'(org-agenda-window-setup (quote current-window)) | |
'(org-capture-templates | |
(quote | |
(("t" "Todo" entry | |
(file+headline "~/Org/TODO.org" "Unplanned") | |
"* TODO %? | |
%i | |
%a") | |
("j" "Journal" entry | |
(file+datetree "~/Org/journal.org") | |
"* %? | |
Entered on %U | |
%i | |
%a") | |
("i" "Idea" entry | |
(file+headline "~/Org/IDEAS.org") | |
"* %? | |
Entered on %U | |
%i | |
%a")))) | |
'(org-clock-clocked-in-display (quote frame-title)) | |
'(org-clock-idle-time 10) | |
'(org-log-done (quote time)) | |
'(org-pomodoro-format "%s") | |
'(org-pomodoro-long-break-format "%s") | |
'(org-pomodoro-short-break-format "%s") | |
'(org-src-fontify-natively t) | |
'(org-startup-indented nil) | |
'(package-archives | |
(quote | |
(("melpa-stable" . "http://stable.melpa.org/packages/") | |
("gnu" . "http://elpa.gnu.org/packages/")))) | |
'(package-selected-packages | |
(quote | |
(company-lsp lsp-mode company-go rg synosaurus hcl-mode spacemacs-theme csv-mode fic-mode go-mode company-terraform terraform-mode groovy-mode exec-path-from-shell nyan-mode systemd dockerfile-mode docker-compose-mode docker flycheck-clojure ace-window magit yasnippet auto-complete autopair find-file-in-repository flycheck multiple-cursors org-pomodoro web-mode puppet-mode buffer-move cider clojure-mode smart-mode-line yaml-mode avy elpy markdown-mode php-mode paredit diff-hl))) | |
'(rg-group-result t) | |
'(show-paren-mode t) | |
'(sml/replacer-regexp-list | |
(quote | |
(("^~/Projects/" ":P:") | |
("^~/Org/" ":Org:") | |
("^~/\\.emacs\\.d/elpa/" ":ELPA:") | |
("^~/\\.emacs\\.d/" ":ED:") | |
("^/sudo:.*:" ":SU:") | |
("^~/Documents/" ":Doc:") | |
("^~/Dropbox/" ":DB:") | |
("^:\\([^:]*\\):Documento?s/" ":\\1/Doc:") | |
("^~/[Gg]it/" ":Git:") | |
("^~/[Gg]it[Hh]ub/" ":Git:") | |
("^~/[Gg]it\\([Hh]ub\\|\\)-?[Pp]rojects/" ":Git:") | |
("^~/Coding/" ":Code:")))) | |
'(split-height-threshold 160) | |
'(tool-bar-mode nil) | |
'(tramp-save-ad-hoc-proxies t) | |
'(web-mode-enable-current-element-highlight t) | |
'(web-mode-markup-indent-offset 2) | |
'(whitespace-style | |
(quote | |
(face trailing lines-tail empty space-after-tab space-before-tab))) | |
'(yas-global-mode 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. | |
'(default ((t (:family "Menlo" :foundry "unknown" :slant normal :weight normal :height 120 :width normal)))) | |
'(mode-line ((t (:family "DejaVu Sans Condensed")))) | |
'(mode-line-inactive ((t (:family "DejaVu Sans Condensed"))))) | |
;; (add-to-list 'package-archives | |
;; '("melpa" . "http://melpa.org/packages/")) | |
;; org-pomodoro and puppet-mode are seriously outdated in MELPA stable, therefore should be installed from MELPA manually | |
(when (not package-archive-contents) | |
(package-refresh-contents)) | |
(package-install-selected-packages) | |
(require 'fic-mode) | |
(setq fic-highlighted-words '("TODO" "TODO:" "FIXME" "FIXME:" "BUG" "BUG:")) | |
(rassq-delete-all 'change-log-mode auto-mode-alist) | |
(require 'web-mode) | |
(add-hook 'python-mode-hook #'fic-mode) | |
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) | |
(add-hook 'emacs-lisp-mode-hook #'fic-mode) | |
(add-hook 'sh-mode-hook #'company-mode) | |
(add-hook 'sh-mode-hook #'fic-mode) | |
(add-hook 'cider-repl-mode-hook #'company-mode) | |
(add-hook 'cider-mode-hook #'company-mode) | |
(add-hook 'cider-mode-hook #'enable-paredit-mode) | |
(add-hook 'cider-mode-hook #'fic-mode) | |
(require 'terraform-mode) | |
(add-hook 'terraform-mode-hook #'company-mode) | |
(add-hook 'terraform-mode-hook #'fic-mode) | |
;; (add-hook 'terraform-mode-hook #'terraform-format-on-save-mode) | |
(require 'company-terraform) | |
(company-terraform-init) | |
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) | |
(elpy-enable) | |
(sml/setup) | |
(when (memq window-system '(mac ns x)) | |
(exec-path-from-shell-initialize)) | |
(global-set-key (kbd "M-3") '(lambda () (interactive) (insert "#"))) | |
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) | |
(global-set-key (kbd "C->") 'mc/mark-next-like-this) | |
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) | |
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) | |
(global-set-key (kbd "C-:") 'avy-goto-char) | |
(global-set-key (kbd "C-c j") 'avy-goto-word-or-subword-1) | |
(global-set-key (kbd "s-.") 'avy-goto-word-or-subword-1) | |
(global-set-key (kbd "s-w") 'ace-window) | |
(global-set-key (kbd "C-x g") 'magit-status) | |
(global-set-key (kbd "C-c p") 'org-pomodoro) | |
(global-set-key (kbd "C-c l") 'org-store-link) | |
(global-set-key (kbd "C-c a") 'org-agenda) | |
(global-set-key (kbd "C-c l") 'org-store-link) | |
(global-set-key (kbd "C-c c") 'org-capture) | |
(global-set-key (kbd "C-x C-b") 'ibuffer) | |
(windmove-default-keybindings 'shift) | |
(defun my/org-mode-hook () | |
"Stop the org-level headers from increasing in height relative to the other text." | |
(dolist (face '(org-level-1 | |
org-level-2 | |
org-level-3 | |
org-level-4 | |
org-level-5)) | |
(set-face-attribute face nil :weight 'semi-bold :height 1.0))) | |
(add-hook 'org-mode-hook 'my/org-mode-hook) | |
(require 'company) | |
(require 'company-go) | |
(add-hook 'go-mode-hook (lambda () | |
(set (make-local-variable 'company-backends) '(company-go)) | |
(company-mode))) | |
(add-hook 'go-mode-hook #'lsp-deferred) | |
;; (let ((govet (flycheck-checker-get 'go-vet 'command))) | |
;; (when (equal (cadr govet) "tool") | |
;; (setf (cdr govet) (cddr govet)))) | |
(provide '.emacs) | |
;;; .emacs ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment