Compare commits

...

3 Commits

Author SHA1 Message Date
Frederik Hanghøj Iversen 9d8e9fc4a1 Changes 2020-11-08 12:39:44 +01:00
Frederik Hanghøj Iversen 91c769461d Changes 2020-08-27 12:07:43 +02:00
Frederik Hanghøj Iversen 4c286c9cf6 Change Emacs config 2020-07-23 10:25:34 +02:00
1 changed files with 102 additions and 12 deletions

View File

@ -50,6 +50,7 @@
;; If there is more than one, they won't work right.
'(Buffer-menu-name-width 30)
'(agda2-program-args nil)
'(async-shell-command-buffer 'new-buffer)
'(auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))
'(blink-cursor-mode nil)
'(column-number-mode t)
@ -59,6 +60,7 @@
'(css-indent-offset 2)
'(custom-safe-themes
'("670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "cfca08e1a703af85a52840c6839ec6ae6568fbdf2f4f6e344fb807345fca45b8" default))
'(custom-search-field nil)
'(dashboard-set-footer nil)
'(delete-selection-mode t)
'(dhall-repl-executable "dhall-repl")
@ -79,6 +81,8 @@
'(flycheck-emacs-lisp-load-path 'inherit)
'(flycheck-ghc-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
'(("github.com" "api.github.com" "github.com" forge-github-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.data.coop" "git.data.coop/api/v1" "git.data.coop" forge-gitea-repository)))
'(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)
'(haskell-indentation-where-post-offset 0)
'(haskell-indentation-where-pre-offset 0)
'(haskell-language-extensions (symbol-value 'haskell-language-extensions))
'(haskell-tags-on-save t)
'(idris-interpreter-path "idris2")
'(idris-semantic-source-highlighting nil)
'(indent-tabs-mode nil)
'(initial-scratch-message nil)
'(js-indent-level 2)
@ -107,6 +118,7 @@
'(kill-whole-line t)
'(line-move-visual nil)
'(lsp-auto-guess-root t)
'(lsp-ui-sideline-show-code-actions nil)
'(magit-diff-refine-hunk "all")
'(magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
'(magit-popup-display-buffer-action nil)
@ -117,7 +129,7 @@
'(org-agenda-files "~/.config/orgmode/agenda_files")
'(org-hide-leading-stars t)
'(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")
'(projectile-globally-ignored-directories
'(".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)
2)))
'(projectile-switch-project-action 'magit-status)
'(projectile-use-git-grep t)
'(purescript-mode-hook '(turn-on-purescript-indentation))
'(recentf-max-menu-items 255)
'(recentf-mode t)
@ -145,7 +158,14 @@
(format "cd ~/git/zendesk/guide-acceptance-tests && rspec --no-color '%s'"
(projectile-get-relative-path-buffer))))
'(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)
(electric-indent-mode)
(eval add-hook 'js2-mode-hook
@ -173,9 +193,12 @@
'(set-mark-command-repeat-pop t)
'(sgml-basic-offset 1)
'(sh-basic-offset 2)
'(sh-here-document-word "eof")
'(show-paren-delay 0)
'(show-paren-mode t)
'(shr-width 80)
'(split-window-keep-point nil)
'(tab-line-close-button-show nil)
'(tags-add-tables t)
'(temp-buffer-resize-mode nil)
'(tool-bar-mode nil)
@ -185,7 +208,8 @@
'(vc-follow-symlinks nil)
'(which-key-idle-delay 1e-05)
'(window-combination-resize t)
'(window-resize-pixelwise t))
'(window-resize-pixelwise t)
'(yaml-backspace-function 'delete-backward-char))
;;;; MAC setup
@ -277,15 +301,21 @@
;; 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.
'(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-op-face ((t (:inherit font-lock-variable-name-face))))
'(enh-ruby-string-delimiter-face ((t (:inherit font-lock-string-face))))
'(erm-syn-errline ((t (:inherit flycheck-error))))
'(erm-syn-warnline ((t (:inherit flycheck-warning))))
'(error ((t (:foreground "Pink" :weight bold))))
'(fixed-pitch-serif ((t (:family "Monospace Serif"))))
'(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-highlight ((t (:inherit highlight))))
'(magit-mode-line-process-error ((t (:inherit error))))
'(region ((t (:background "#285b89"))))
'(success ((t (:foreground "Green3" :weight bold)))))
@ -309,11 +339,38 @@
(add-hook 'yaml-mode-hook
(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
(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
(lambda ()
@ -356,9 +413,12 @@
(setq js2-global-externs js2-globals)
(require 'origami)
(global-origami-mode)
(global-set-key (kbd "C-c o o") 'origami-recursively-toggle-node)
(add-hook 'sh-mode-hook
(lambda ()
(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
@ -452,10 +512,6 @@
(advice-add 'forward-list :override 'enh-ruby-end-of-block)
(advice-add 'backward-list :override 'enh-ruby-beginning-of-block)
(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)
"Beautify SQL in region between BEG and END.
@ -481,6 +537,7 @@ npm i -g sql-formatter-cli"
;;; Jira
;; (require 'jira)
(add-hook 'jira-mode-hook 'org-mode)
(global-set-key (kbd "C-c j") 'jira)
(put 'upcase-region 'disabled nil)
@ -512,4 +569,37 @@ Requires that `sqlformat` is installed."
(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