Compare commits
3 commits
d19907c2fe
...
9d8e9fc4a1
Author | SHA1 | Date | |
---|---|---|---|
9d8e9fc4a1 | |||
91c769461d | |||
4c286c9cf6 |
114
emacs/init.el
114
emacs/init.el
|
@ -50,6 +50,7 @@
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(Buffer-menu-name-width 30)
|
'(Buffer-menu-name-width 30)
|
||||||
'(agda2-program-args nil)
|
'(agda2-program-args nil)
|
||||||
|
'(async-shell-command-buffer 'new-buffer)
|
||||||
'(auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))
|
'(auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))
|
||||||
'(blink-cursor-mode nil)
|
'(blink-cursor-mode nil)
|
||||||
'(column-number-mode t)
|
'(column-number-mode t)
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
'(css-indent-offset 2)
|
'(css-indent-offset 2)
|
||||||
'(custom-safe-themes
|
'(custom-safe-themes
|
||||||
'("670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "cfca08e1a703af85a52840c6839ec6ae6568fbdf2f4f6e344fb807345fca45b8" default))
|
'("670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "cfca08e1a703af85a52840c6839ec6ae6568fbdf2f4f6e344fb807345fca45b8" default))
|
||||||
|
'(custom-search-field nil)
|
||||||
'(dashboard-set-footer nil)
|
'(dashboard-set-footer nil)
|
||||||
'(delete-selection-mode t)
|
'(delete-selection-mode t)
|
||||||
'(dhall-repl-executable "dhall-repl")
|
'(dhall-repl-executable "dhall-repl")
|
||||||
|
@ -79,6 +81,8 @@
|
||||||
'(flycheck-emacs-lisp-load-path 'inherit)
|
'(flycheck-emacs-lisp-load-path 'inherit)
|
||||||
'(flycheck-ghc-language-extensions (symbol-value 'haskell-language-extensions))
|
'(flycheck-ghc-language-extensions (symbol-value 'haskell-language-extensions))
|
||||||
'(flycheck-hlint-language-extensions (symbol-value 'haskell-language-extensions))
|
'(flycheck-hlint-language-extensions (symbol-value 'haskell-language-extensions))
|
||||||
|
'(flycheck-idris-executable "idris2")
|
||||||
|
'(flycheck-javascript-eslint-executable nil)
|
||||||
'(forge-alist
|
'(forge-alist
|
||||||
'(("github.com" "api.github.com" "github.com" forge-github-repository)
|
'(("github.com" "api.github.com" "github.com" forge-github-repository)
|
||||||
("gitlab.com" "gitlab.com/api/v4" "gitlab.com" forge-gitlab-repository)
|
("gitlab.com" "gitlab.com/api/v4" "gitlab.com" forge-gitlab-repository)
|
||||||
|
@ -94,11 +98,18 @@
|
||||||
("git.sr.ht" nil "git.sr.ht" forge-srht-repository)
|
("git.sr.ht" nil "git.sr.ht" forge-srht-repository)
|
||||||
("git.data.coop" "git.data.coop/api/v1" "git.data.coop" forge-gitea-repository)))
|
("git.data.coop" "git.data.coop/api/v1" "git.data.coop" forge-gitea-repository)))
|
||||||
'(global-company-mode t)
|
'(global-company-mode t)
|
||||||
|
'(graphql-extra-headers
|
||||||
|
'(("Content-Type" . "application/json")
|
||||||
|
("Authorization" . "Basic YWRtaW5AemQtZGV2LmNvbToxMjM0NTY=")
|
||||||
|
("Host" . "mondocam.zd-dev.com")))
|
||||||
|
'(graphql-url "https://mondocam.zd-dev.com/gather/badges/graphql")
|
||||||
'(graphviz-dot-indent-width 2)
|
'(graphviz-dot-indent-width 2)
|
||||||
'(haskell-indentation-where-post-offset 0)
|
'(haskell-indentation-where-post-offset 0)
|
||||||
'(haskell-indentation-where-pre-offset 0)
|
'(haskell-indentation-where-pre-offset 0)
|
||||||
'(haskell-language-extensions (symbol-value 'haskell-language-extensions))
|
'(haskell-language-extensions (symbol-value 'haskell-language-extensions))
|
||||||
'(haskell-tags-on-save t)
|
'(haskell-tags-on-save t)
|
||||||
|
'(idris-interpreter-path "idris2")
|
||||||
|
'(idris-semantic-source-highlighting nil)
|
||||||
'(indent-tabs-mode nil)
|
'(indent-tabs-mode nil)
|
||||||
'(initial-scratch-message nil)
|
'(initial-scratch-message nil)
|
||||||
'(js-indent-level 2)
|
'(js-indent-level 2)
|
||||||
|
@ -107,6 +118,7 @@
|
||||||
'(kill-whole-line t)
|
'(kill-whole-line t)
|
||||||
'(line-move-visual nil)
|
'(line-move-visual nil)
|
||||||
'(lsp-auto-guess-root t)
|
'(lsp-auto-guess-root t)
|
||||||
|
'(lsp-ui-sideline-show-code-actions nil)
|
||||||
'(magit-diff-refine-hunk "all")
|
'(magit-diff-refine-hunk "all")
|
||||||
'(magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
|
'(magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
|
||||||
'(magit-popup-display-buffer-action nil)
|
'(magit-popup-display-buffer-action nil)
|
||||||
|
@ -117,7 +129,7 @@
|
||||||
'(org-agenda-files "~/.config/orgmode/agenda_files")
|
'(org-agenda-files "~/.config/orgmode/agenda_files")
|
||||||
'(org-hide-leading-stars t)
|
'(org-hide-leading-stars t)
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(graphviz-dot-mode rust-mode lsp forge tide origami dhall-mode docker-tramp graphql-mode enh-ruby-mode scala-mode string-inflection prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell projectile exec-path-from-shell lsp-ui lsp-mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard))
|
'(jsonnet-mode eslint-fix nhexl-mode idris-mode realgud-trepan-ni realgud-node-inspect realgud graphviz-dot-mode rust-mode lsp forge tide origami dhall-mode docker-tramp graphql-mode enh-ruby-mode scala-mode string-inflection prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell projectile exec-path-from-shell lsp-ui lsp-Mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard))
|
||||||
'(prettier-js-command "prettier")
|
'(prettier-js-command "prettier")
|
||||||
'(projectile-globally-ignored-directories
|
'(projectile-globally-ignored-directories
|
||||||
'(".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" "node_modules" "vendor"))
|
'(".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" "node_modules" "vendor"))
|
||||||
|
@ -129,6 +141,7 @@
|
||||||
(directory-files "~/git" t)
|
(directory-files "~/git" t)
|
||||||
2)))
|
2)))
|
||||||
'(projectile-switch-project-action 'magit-status)
|
'(projectile-switch-project-action 'magit-status)
|
||||||
|
'(projectile-use-git-grep t)
|
||||||
'(purescript-mode-hook '(turn-on-purescript-indentation))
|
'(purescript-mode-hook '(turn-on-purescript-indentation))
|
||||||
'(recentf-max-menu-items 255)
|
'(recentf-max-menu-items 255)
|
||||||
'(recentf-mode t)
|
'(recentf-mode t)
|
||||||
|
@ -145,7 +158,14 @@
|
||||||
(format "cd ~/git/zendesk/guide-acceptance-tests && rspec --no-color '%s'"
|
(format "cd ~/git/zendesk/guide-acceptance-tests && rspec --no-color '%s'"
|
||||||
(projectile-get-relative-path-buffer))))
|
(projectile-get-relative-path-buffer))))
|
||||||
'(safe-local-variable-values
|
'(safe-local-variable-values
|
||||||
'((compilation-disable-input . t)
|
'((eval local-set-key
|
||||||
|
(kbd "C-M-\\")
|
||||||
|
'prettier-js)
|
||||||
|
(add-to-list 'auto-mode-alist
|
||||||
|
'("\\.js\\'" . js-mode))
|
||||||
|
(prettier-js-mode)
|
||||||
|
(prettier-mode)
|
||||||
|
(compilation-disable-input . t)
|
||||||
(sgml-basic-offset . 2)
|
(sgml-basic-offset . 2)
|
||||||
(electric-indent-mode)
|
(electric-indent-mode)
|
||||||
(eval add-hook 'js2-mode-hook
|
(eval add-hook 'js2-mode-hook
|
||||||
|
@ -173,9 +193,12 @@
|
||||||
'(set-mark-command-repeat-pop t)
|
'(set-mark-command-repeat-pop t)
|
||||||
'(sgml-basic-offset 1)
|
'(sgml-basic-offset 1)
|
||||||
'(sh-basic-offset 2)
|
'(sh-basic-offset 2)
|
||||||
|
'(sh-here-document-word "eof")
|
||||||
|
'(show-paren-delay 0)
|
||||||
'(show-paren-mode t)
|
'(show-paren-mode t)
|
||||||
'(shr-width 80)
|
'(shr-width 80)
|
||||||
'(split-window-keep-point nil)
|
'(split-window-keep-point nil)
|
||||||
|
'(tab-line-close-button-show nil)
|
||||||
'(tags-add-tables t)
|
'(tags-add-tables t)
|
||||||
'(temp-buffer-resize-mode nil)
|
'(temp-buffer-resize-mode nil)
|
||||||
'(tool-bar-mode nil)
|
'(tool-bar-mode nil)
|
||||||
|
@ -185,7 +208,8 @@
|
||||||
'(vc-follow-symlinks nil)
|
'(vc-follow-symlinks nil)
|
||||||
'(which-key-idle-delay 1e-05)
|
'(which-key-idle-delay 1e-05)
|
||||||
'(window-combination-resize t)
|
'(window-combination-resize t)
|
||||||
'(window-resize-pixelwise t))
|
'(window-resize-pixelwise t)
|
||||||
|
'(yaml-backspace-function 'delete-backward-char))
|
||||||
|
|
||||||
|
|
||||||
;;;; MAC setup
|
;;;; MAC setup
|
||||||
|
@ -277,15 +301,21 @@
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
|
'(compilation-info ((t (:inherit link))))
|
||||||
|
'(compilation-mode-line-exit ((t (:inherit compilation-info :weight bold))))
|
||||||
|
'(compilation-mode-line-fail ((t (:inherit compilation-error :weight bold))))
|
||||||
'(enh-ruby-heredoc-delimiter-face ((t (:inherit font-lock-string-face))))
|
'(enh-ruby-heredoc-delimiter-face ((t (:inherit font-lock-string-face))))
|
||||||
'(enh-ruby-op-face ((t (:inherit font-lock-variable-name-face))))
|
'(enh-ruby-op-face ((t (:inherit font-lock-variable-name-face))))
|
||||||
'(enh-ruby-string-delimiter-face ((t (:inherit font-lock-string-face))))
|
'(enh-ruby-string-delimiter-face ((t (:inherit font-lock-string-face))))
|
||||||
'(erm-syn-errline ((t (:inherit flycheck-error))))
|
'(erm-syn-errline ((t (:inherit flycheck-error))))
|
||||||
'(erm-syn-warnline ((t (:inherit flycheck-warning))))
|
'(erm-syn-warnline ((t (:inherit flycheck-warning))))
|
||||||
|
'(error ((t (:foreground "Pink" :weight bold))))
|
||||||
'(fixed-pitch-serif ((t (:family "Monospace Serif"))))
|
'(fixed-pitch-serif ((t (:family "Monospace Serif"))))
|
||||||
'(font-lock-comment-face ((t (:foreground "chocolate1"))))
|
'(font-lock-comment-face ((t (:foreground "chocolate1"))))
|
||||||
|
'(isearch ((t (:background "palevioletred2" :foreground "white"))))
|
||||||
'(magit-diff-hunk-heading ((t (:inherit lazy-highlight))))
|
'(magit-diff-hunk-heading ((t (:inherit lazy-highlight))))
|
||||||
'(magit-diff-hunk-heading-highlight ((t (:inherit highlight))))
|
'(magit-diff-hunk-heading-highlight ((t (:inherit highlight))))
|
||||||
|
'(magit-mode-line-process-error ((t (:inherit error))))
|
||||||
'(region ((t (:background "#285b89"))))
|
'(region ((t (:background "#285b89"))))
|
||||||
'(success ((t (:foreground "Green3" :weight bold)))))
|
'(success ((t (:foreground "Green3" :weight bold)))))
|
||||||
|
|
||||||
|
@ -309,11 +339,38 @@
|
||||||
|
|
||||||
(add-hook 'yaml-mode-hook
|
(add-hook 'yaml-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(flyspell-mode -1)))
|
(flyspell-mode -1)
|
||||||
|
(local-set-key (kbd "DEL") 'delete-backward-char)))
|
||||||
|
|
||||||
|
(defvar html--html-template (concat
|
||||||
|
"<head>\n"
|
||||||
|
" <title>%s</title>\n"
|
||||||
|
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n"
|
||||||
|
" </head>\n"
|
||||||
|
" <body>\n"
|
||||||
|
" <main>\n"
|
||||||
|
" <h1>%s</h1>\n"
|
||||||
|
" </main>\n"
|
||||||
|
" </body>"))
|
||||||
|
|
||||||
|
(require 'sgml-mode)
|
||||||
(add-hook 'html-mode-hook
|
(add-hook 'html-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(flyspell-mode -1)))
|
(flyspell-mode -1)
|
||||||
|
(add-to-list 'sgml-tag-alist '("html" (\n (format html--html-template (setq title (read-string "Title: ")) title))))))
|
||||||
|
|
||||||
|
(add-hook 'shell-mode-hook 'goto-address-mode)
|
||||||
|
|
||||||
|
;; This is overwritten by a keymap added by comint-mode... In org-mode
|
||||||
|
;; the same keymap is also bound to something. Think it's org-goto.
|
||||||
|
(add-hook 'goto-address-mode
|
||||||
|
(lambda ()
|
||||||
|
(local-set-key (kbd "C-c C-o") 'goto-address-at-point)))
|
||||||
|
|
||||||
|
(add-hook 'mhtml-mode
|
||||||
|
(lambda ()
|
||||||
|
(local-set-key (kbd "C-c C-o") 'browse-url-of-buffer)
|
||||||
|
(local-set-key (kbd "C-c C-v") 'sgml-validate)))
|
||||||
|
|
||||||
(add-hook 'prog-mode-hook
|
(add-hook 'prog-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
@ -356,9 +413,12 @@
|
||||||
|
|
||||||
(setq js2-global-externs js2-globals)
|
(setq js2-global-externs js2-globals)
|
||||||
|
|
||||||
(require 'origami)
|
(add-hook 'sh-mode-hook
|
||||||
(global-origami-mode)
|
(lambda ()
|
||||||
(global-set-key (kbd "C-c o o") 'origami-recursively-toggle-node)
|
(sh-electric-here-document-mode -1)
|
||||||
|
(set (make-local-variable 'compile-command)
|
||||||
|
(buffer-file-name (current-buffer)))
|
||||||
|
(local-set-key (kbd "C-c C-c") 'compile)))
|
||||||
|
|
||||||
|
|
||||||
;;;; Projectile
|
;;;; Projectile
|
||||||
|
@ -452,10 +512,6 @@
|
||||||
(advice-add 'forward-list :override 'enh-ruby-end-of-block)
|
(advice-add 'forward-list :override 'enh-ruby-end-of-block)
|
||||||
(advice-add 'backward-list :override 'enh-ruby-beginning-of-block)
|
(advice-add 'backward-list :override 'enh-ruby-beginning-of-block)
|
||||||
(fredefox-ruby-mode-hook)))
|
(fredefox-ruby-mode-hook)))
|
||||||
;; '(lambda ()
|
|
||||||
;; (local-set-key (kbd "C-M-n") 'ruby-forward-sexp)
|
|
||||||
;; (local-set-key (kbd "C-M-p") 'ruby-backward-sexp)
|
|
||||||
;; (chruby-use-corresponding)))
|
|
||||||
|
|
||||||
(defun sql-beautify-region (beg end)
|
(defun sql-beautify-region (beg end)
|
||||||
"Beautify SQL in region between BEG and END.
|
"Beautify SQL in region between BEG and END.
|
||||||
|
@ -481,6 +537,7 @@ npm i -g sql-formatter-cli"
|
||||||
|
|
||||||
;;; Jira
|
;;; Jira
|
||||||
;; (require 'jira)
|
;; (require 'jira)
|
||||||
|
(add-hook 'jira-mode-hook 'org-mode)
|
||||||
(global-set-key (kbd "C-c j") 'jira)
|
(global-set-key (kbd "C-c j") 'jira)
|
||||||
|
|
||||||
(put 'upcase-region 'disabled nil)
|
(put 'upcase-region 'disabled nil)
|
||||||
|
@ -512,4 +569,37 @@ Requires that `sqlformat` is installed."
|
||||||
|
|
||||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
|
(require 'ansi-color)
|
||||||
|
(defun colorize-compilation-buffer ()
|
||||||
|
"Use ansi-color to translate SGR control sequences into overlays."
|
||||||
|
|
||||||
|
(ansi-color-apply-on-region compilation-filter-start (point)))
|
||||||
|
|
||||||
|
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
|
||||||
|
|
||||||
|
(defun projectile--buffer-file-relative-path ()
|
||||||
|
"Get the project relative path of FILE-NAME."
|
||||||
|
(file-relative-name buffer-file-name (projectile-project-root)))
|
||||||
|
|
||||||
|
(defun projectile-eslint ()
|
||||||
|
"Run eslint on current buffers file."
|
||||||
|
(interactive)
|
||||||
|
(shell-command (format "yarn eslint --fix %s" (projectile--buffer-file-relative-path))))
|
||||||
|
|
||||||
|
(defun forge-browse-file ()
|
||||||
|
"Browse the currently visited file on the remote."
|
||||||
|
(interactive
|
||||||
|
(browse-url
|
||||||
|
(let
|
||||||
|
((rev (magit-get-current-branch))
|
||||||
|
(repo (forge-get-repository 'stub))
|
||||||
|
(file (projectile--buffer-file-relative-path)))
|
||||||
|
(forge--format repo "https://%h/%o/%n/blob/%r/%f"
|
||||||
|
`((?r . ,rev) (?f . ,file)))))))
|
||||||
|
|
||||||
|
(defun sort-words (beg end)
|
||||||
|
"Sort words between BEG and END."
|
||||||
|
(interactive "r")
|
||||||
|
(sort-regexp-fields nil "\\w+" "\\&" beg end))
|
||||||
|
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
|
Loading…
Reference in a new issue