Misc changes to emacs config

This commit is contained in:
Oystein Kristoffer Tveit 2021-08-25 10:24:16 +02:00
parent d0f03ff3c0
commit 621b02a10a

View File

@ -10,7 +10,7 @@
* Use-package
#+BEGIN_SRC elisp
(setq user-emacs-directory (substitute-in-file-name "$HOME/.emacs.d"))
; (setq user-emacs-directory (substitute-in-file-name "$HOME/.emacs.d"))
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
@ -36,7 +36,6 @@
:states 'motion
:prefix "SPC"
:non-normal-prefix "C-SPC"))
;:non-normal-prefix "SPC"))
#+END_SRC
Base keys
@ -175,6 +174,7 @@ Put backup files in emacs.d/temp
("C-j" . evil-window-down)
("C-k" . evil-window-up)
("C-l" . evil-window-right)
:map evil-insert-state-map
("C-g" . evil-normal-state)
("C-h" . evil-delete-backward-char-and-join))
@ -213,22 +213,16 @@ Put backup files in emacs.d/temp
Evil escape mode
#+BEGIN_SRC emacs-lisp
(use-package evil-escape
:after (evil company)
:diminish evil-escape-mode
:init
(with-eval-after-load 'company
(add-hook 'evil-normal-state-entry-hook #'company-cancel))
;; (use-package lsp-python-ms
;; :init (setq
;; ; (lsp-python-ms-auto-install-server t)
;; lsp-python-ms-executable (executable-find "mspyls"))
;; ; :hook (python-mode . (lambda () (require 'lsp-python-ms) (lsp))))
;; :hook (python-mode . lsp))
(setq evil-escape-key-sequence "jk"
evil-escape-unordered-key-sequence t)
:config
(evil-escape-mode))
;; (use-package evil-escape
;; :after (evil company)
;; :diminish evil-escape-mode
;; :init
;; (with-eval-after-load 'company
;; (add-hook 'evil-normal-state-entry-hook #'company-cancel))
;; (setq evil-escape-key-sequence "jk"
;; evil-escape-unordered-key-sequence t)
;; :config
;; (evil-escape-mode))
#+END_SRC
** Ivy
@ -241,10 +235,6 @@ Evil escape mode
("M-j" . ivy-next-line)
("M-k" . ivy-previous-line)
("M-l" . ivy-alt-done)))
;; :general (leader-key
;; "ij" 'ivy-next-line
;; "ik" 'ivy-previous-line))
#+END_SRC
Ivy-rich adds extra columns to a few of the Counsel commands to provide more information about each item.
@ -283,7 +273,9 @@ Ivy-rich adds extra columns to a few of the Counsel commands to provide more inf
"oe" '(org-edit-src-code :which-key "Edit SRC")
; Insert
"io" '(:ignore t :which-key "org")
"ios" 'org-insert-structure-template))
"ios" 'org-insert-structure-template)
:config
(setq org-src-tab-acts-natively nil))
#+END_SRC
Improved version of org-bullets
@ -345,30 +337,30 @@ Evil bindings for org mode
#+BEGIN_SRC emacs-lisp
(setq dotfiles '(
("Emacs" . "~/.emacs.d/config.org")
("Xmonad" . "~/.xmonad/xmonad.hs")
("Xmobar" . "~/.config/xmobar/xmobarrc")
("Awesome" . "~/.config/awesome/rc.lua")
("Stalonetray" . "~/.stalonetrayrc")
("Termite" . "~/.config/termite/config")
("Kitty" . "~/.config/kitty/kitty.conf")
("Mpd" . "~/.config/mpd/mpd.conf")
("Ncmpcpp" . "~/.ncmpcpp/config")
("Nnn" . "~/.config/nnn/")
("TeX-ntnu" . "~/texmf/tex/latex/local/ntnu.sty")
("Tmux" . "~/.tmux.conf")
("Todo" . "~/.todo")
("Qutebrowser" . "~/.config/qutebrowser/config.py")
("Vim" . "~/.config/nvim/init.vim")
("Zsh" . "~/.zshrc")
("Config-selector" . "~/.scripts/rofi/config-selector")
("Configfiles" . "~/.scripts/rofi/configfiles")))
("Emacs" . (concat user-emacs-directory "/config.org"))
("Xmonad" . "$HOME/.xmonad/xmonad.hs")
("Xmobar" . "$XDG_CONFIG_HOME/xmobar/xmobarrc")
("Awesome" . "$XDG_CONFIG_HOME/awesome/rc.lua")
("Stalonetray" . "$HOME/.stalonetrayrc")
("Termite" . "$XDG_CONFIG_HOME/termite/config")
("Kitty" . "$XDG_CONFIG_HOME/kitty/kitty.conf")
("Mpd" . "$XDG_CONFIG_HOME/mpd/mpd.conf")
("Ncmpcpp" . "$HOME/.ncmpcpp/config")
("Nnn" . "$XDG_CONFIG_HOME/nnn/")
("TeX-ntnu" . "$HOME/texmf/tex/latex/local/ntnu.sty")
("Tmux" . "$XDG_CONFIG_HOME/tmux/tmux.conf")
("Todo" . "$HOME/.todo")
("Qutebrowser" . "$XDG_CONFIG_HOME/qutebrowser/config.py")
("Vim" . "$XDG_CONFIG_HOME/nvim/init.lua")
("Zsh" . "$XDG_CONFIG_HOME/zsh/.zshrc")
("Config-selector" . "$HOME/.scripts/rofi/config-selector")
("Configfiles" . "$HOME/.scripts/rofi/configfiles")))
(defun find-config-file ()
"Chooses a config-file from dotfiles and opens it in a new buffer"
(interactive)
(ivy-read "Config: " dotfiles
:action (lambda (confpair) (find-file (cdr confpair)))))
:action (lambda (confpair) (find-file (substitute-in-file-name (eval (cdr confpair)))))))
(leader-key "fc" '(find-config-file :which-key "find config file"))
#+END_SRC
@ -400,7 +392,32 @@ For every other theme, use load-theme
#+BEGIN_SRC emacs-lisp
(use-package monokai-theme
:config
(load-theme 'monokai t))
(setq monokai-user-variable-pitch t)
(progn
(defvar after-load-theme-hook nil
"Hook run after a color theme is loaded using `load-theme'.")
(defadvice load-theme (after run-after-load-theme-hook activate)
"Run `after-load-theme-hook'."
(run-hooks 'after-load-theme-hook))
(defun customize-monokai ()
"Customize monokai theme"
(if (member 'monokai custom-enabled-themes)
(custom-theme-set-faces
'monokai
'(py-object-reference-face ((t (:foreground "#FFA500"))))
'(py-decorators-face ((t (:foreground "#FFA500"))))
'(py-variable-name-face ((t (:foreground "#FFA500"))))
'(py-exception-name-face ((:foreground "#FFA500")))
'(py-class-name-face ((:foreground "#FFA500")))
'(py-pseudo-keyword-face ((:foreground "#FFA500")))
'(py-builtins-face ((:foreground "#FFA500"))))))
(add-hook 'after-load-theme-hook 'customize-monokai)))
(load-theme 'monokai t)
#+END_SRC
** Centaur-tabs
@ -588,10 +605,10 @@ For every other theme, use load-theme
;; Whether display the gnus notifications.
(setq doom-modeline-gnus t)
;; Wheter gnus should automatically be updated and how often (set to 0 or smaller than 0 to disable)
;; Whether gnus should automatically be updated and how often (set to 0 or smaller than 0 to disable)
(setq doom-modeline-gnus-timer 2)
;; Wheter groups should be excludede when gnus automatically being updated.
;; Whether groups should be excludede when gnus automatically being updated.
(setq doom-modeline-gnus-excluded-groups '("dummy.group"))
;; Whether display the IRC notifications. It requires `circe' or `erc' package.
@ -665,8 +682,8 @@ In order for this to work, the [[https://github.com/tonsky/FiraCode/issues/211#i
(setq dashboard-set-file-icons t)
(setq dashboard-image-banner-max-height (/ (frame-pixel-height) 3))
(setq dashboard-startup-banner "~/.emacs.d/logo.svg")
; (setq dashboard-startup-banner "~/.emacs.d/logo.svg")
(setq dashboard-startup-banner (concat user-emacs-directory "/logo.svg"))
; (setq dashboard-startup-banner (concat user-emacs-directory "/logo.svg"))
(setq dashboard-center-content t)
(setq dashboard-items '((recents . 10)
(projects . 5)
@ -934,7 +951,9 @@ Nice looking completions
(use-package projectile
:init
(setq projectile-project-search-path '("~/git/"
"~/git/temp/"))
"~/git/temp/"
"~/git/appkom/"
"~/git/pvv/"))
(setq projectile-switch-project-action #'projectile-dired)
:custom ((projectile-completion-system 'ivy))
@ -1087,11 +1106,6 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-
#+END_SRC
#+BEGIN_SRC emacs-lisp
(use-package evil-magit
:after (magit evil))
#+END_SRC
#+BEGIN_SRC emacs-lisp
(use-package git-gutter
:init
@ -1099,62 +1113,15 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-
#+END_SRC
* Langugages
** Agda
(after! agda2-mode
(set-lookup-handlers! 'agda2-mode
:definition #'agda2-goto-definition-keyboard)
(map! :map agda2-mode-map
:localleader
"?" #'agda2-show-goals
"." #'agda2-goal-and-context-and-inferred
"," #'agda2-goal-and-context
"=" #'agda2-show-constraints
"SPC" #'agda2-give
"a" #'agda2-auto-maybe-all
"b" #'agda2-previous-goal
"c" #'agda2-make-case
"d" #'agda2-infer-type-maybe-toplevel
"e" #'agda2-show-context
"f" #'agda2-next-goal
"gG" #'agda2-go-back
"h" #'agda2-helper-function-type
"l" #'agda2-load
"n" #'agda2-compute-normalised-maybe-toplevel
"p" #'agda2-module-contents-maybe-toplevel
"r" #'agda2-refine
"s" #'agda2-solveAll
"t" #'agda2-goal-type
"w" #'agda2-why-in-scope-maybe-toplevel
(:prefix "x"
"c" #'agda2-compile
"d" #'agda2-remove-annotations
"h" #'agda2-display-implicit-arguments
"q" #'agda2-quit
"r" #'agda2-restart)))
** C/C++
** Clojure
** Coq
** Dart / Flutter
#+BEGIN_SRC emacs-lisp
(use-package dart-mode
:mode "\\.dart\\'")
#+END_SRC
** Elixir
Major mode for elixir
#+BEGIN_SRC emacs-lisp
; (use-package elixir-mode)
#+END_SRC
Several tools for navigation, formatting, compilation, docs and completion
#+BEGIN_SRC emacs-lisp
; (use-package alchemist)
(use-package lsp-dart
:hook 'dart-mode-hook)
#+END_SRC
** Elm
@ -1267,25 +1234,6 @@ It requires the hindent executable
flycheck-haskell?
ghc ?
** Idris
#+BEGIN_SRC emacs-lisp
;; (use-package idris-mode
;; :hook (idris-mode-hook . turn-on-idris-simple-indent)
;; :general (leader-key idris-mode-map
;; "m." 'idris-pop-to-repl
;; "mr" 'idris-load-file
;; "md" 'idris-docs-at-point
;; "mt" 'idris-type-at-point
;; "md" 'idris-add-clause
;; "ml" 'idris-make-lemma
;; "mc" 'idris-case-split
;; "mw" 'idris-make-with-block
;; "mm" 'idris-add-missing
;; "mp" 'idris-proof-search
;; "mh" 'idris-docs-at-point))
#+END_SRC
** Java
Java LSP using the Eclipse JDT Language server
@ -1395,6 +1343,7 @@ js2-mode
js-doc
js2-refactor
npm.el
** Json
#+BEGIN_SRC emacs-lisp
@ -1699,17 +1648,46 @@ To be installed from the arch community repos: python-language-server
("or" . "")
("pi" . "π"))))
(add-hook 'python-mode-hook 'prettify-symbols-mode)
(add-hook 'python-mode-hook 'prettify-python)
;; (add-hook 'python-mode-hook 'prettify-symbols-mode)
;; (add-hook 'python-mode-hook 'prettify-python)
#+END_SRC
** Rust
rust-mode
#+BEGIN_SRC emacs-lisp
(use-package rustic
:bind (:map rustic-mode-map
("M-j" . lsp-ui-imenu)
("M-?" . lsp-find-references)
("C-c C-c l" . flycheck-list-errors)
("C-c C-c a" . lsp-execute-code-action)
("C-c C-c r" . lsp-rename)
("C-c C-c q" . lsp-workspace-restart)
("C-c C-c Q" . lsp-workspace-shutdown)
("C-c C-c s" . lsp-rust-analyzer-status))
:config
;; uncomment for less flashiness
;; (setq lsp-eldoc-hook nil)
;; (setq lsp-enable-symbol-highlighting nil)
;; (setq lsp-signature-auto-activate nil)
;; comment to disable rustfmt on save
(setq rustic-format-on-save t)
(add-hook 'rustic-mode-hook 'rk/rustic-mode-hook))
(defun rk/rustic-mode-hook ()
;; so that run C-c C-c C-r works without having to confirm, but don't try to
;; save rust buffers that are not file visiting. Once
;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should
;; no longer be necessary.
(when buffer-file-name
(setq-local buffer-save-without-query t)))
#+END_SRC
flycheck-rust
cargo.el - Cargo support for Emacs.
** Scala
** Shellscripts
** Yaml
** Web-dev
@ -1996,6 +1974,8 @@ https://protesilaos.com/
https://writequit.org/denver-emacs/presentations/2017-04-11-ivy.html
https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/
** Configs
*** Quinoa42