Forráskód Böngészése

Fixed erors in emacs config.

Thomas Flucke 4 éve
szülő
commit
a08d8cc07b

+ 0 - 55
.emacs.d/Thomas-Experiement-theme.el

@@ -1,55 +0,0 @@
-(deftheme Thomas-Experiement
-  "Created 2018-09-04.")
-
-(custom-theme-set-faces
- 'Thomas-Experiement
- '(cursor ((t (:background "red"))))
- '(fixed-pitch ((t (:family "Monospace"))))
- '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
- '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(minibuffer-prompt ((t (:foreground "blue"))))
- '(highlight ((t (:background "color-88"))))
- '(region ((t (:background "brightblue"))))
- '(shadow ((t (:foreground "brightblack"))))
- '(secondary-selection ((t (:background "brightblack"))))
- '(trailing-whitespace ((t (:foreground "yellow" :background "cyan"))))
- '(font-lock-builtin-face ((t (:foreground "cyan"))))
- '(font-lock-comment-delimiter-face ((t (:foreground "brightyellow"))))
- '(font-lock-comment-face ((t (:foreground "brightblack"))))
- '(font-lock-constant-face ((t (:foreground "color-28"))))
- '(font-lock-doc-face ((t (:foreground "brightblue"))))
- '(font-lock-function-name-face ((t (:foreground "color-112"))))
- '(font-lock-keyword-face ((t (:foreground "color-202"))))
- '(font-lock-negation-char-face ((t (:foreground "green"))))
- '(font-lock-preprocessor-face ((t (:foreground "color-163" :weight semi-bold))))
- '(font-lock-regexp-grouping-backslash ((t (:foreground "yellow"))))
- '(font-lock-regexp-grouping-construct ((t (:foreground "magenta"))))
- '(font-lock-string-face ((t (:foreground "color-184"))))
- '(font-lock-type-face ((t (:foreground "color-93"))))
- '(font-lock-variable-name-face ((t (:foreground "color-41"))))
- '(font-lock-warning-face ((t (:underline (:color "color-130" :style wave)))))
- '(button ((t (:inherit (link)))))
- '(link ((t (:underline (:color foreground-color :style line) :foreground "blue"))))
- '(link-visited ((t (:underline (:color foreground-color :style line) :foreground "magenta"))))
- '(fringe ((t (:background "brightgreen"))))
- '(header-line ((t (:foreground "magenta" :inherit (mode-line)))))
- '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
- '(mode-line ((t (:box nil :foreground "brightblue" :background "brightyellow"))))
- '(mode-line-buffer-id ((t (:foreground "green"))))
- '(mode-line-emphasis ((t (:slant italic :foreground "brightmagenta"))))
- '(mode-line-highlight ((t (:weight bold :box nil :foreground "magenta"))))
- '(mode-line-inactive ((t (:box nil :foreground "brightblack" :background "brightgreen"))))
- '(isearch ((t (:inverse-video t :foreground "yellow" :background "brightgreen"))))
- '(isearch-fail ((t (:inverse-video t :background "brightgreen" :inherit (font-lock-warning-face)))))
- '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline (:color foreground-color :style line)))))
- '(match ((t (:inverse-video t :foreground "blue" :background "brightgreen"))))
- '(next-error ((t (:inherit (region)))))
- '(query-replace ((t (:inherit (isearch)))))
- '(show-paren-match ((t (:background "blue" :foreground "green"))))
- '(show-paren-mismatch ((t (:background "red" :foreground "white" :underline (:color foreground-color :style wave)))))
- '(c-annotation-face ((t (:inherit font-lock-preprocessor-face))))
- '(default ((t (:family "default" :foundry "default" :width normal :height 1 :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :foreground "white" :background "black" :stipple nil :inherit nil))))
- '(flycheck-error ((((supports :underline (:style wave))) (:underline (:color "Red1" :style wave))) (t (:inherit (error) :underline (:color foreground-color :style line)))))
- '(error ((t (:foreground "red" :weight bold)))))
-
-(provide-theme 'Thomas-Experiement)

+ 4 - 0
.emacs.d/configs/package-loader.el

@@ -16,6 +16,10 @@
         ("org" . "https://orgmode.org/elpa/"))
       package-archive-priorities '(("melpa" . 1)))
 
+;; 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.
 (package-initialize)
 
 ;; Configure use-package

+ 63 - 14
.emacs.d/configs/scala.el

@@ -11,19 +11,68 @@
 
 (require 'package-loader)
 
-(if (version<= "24.4" emacs-version)
-    (use-package ensime
-      :requires company
-      :hook (scala-mode java-mode)
-      :config
-      (setq ensime-startup-notification nil)
-      (eval-after-load 'ensime-mode
-        '(define-key ensime-mode-map (kbd "C-c i")
-           (lambda () "Generate ensime.sbt file"
-             (interactive)
-             (write-region "ensimeScalaVersion in ThisBuild := \"2.11.8\""
-                           nil (concat (read-directory-name "SBT Root:") "ensime.sbt"))))))
-  (use-package scala-mode
-    :commands (scala-mode)))
+;; Enable scala-mode for highlighting, indentation and motion commands
+(use-package scala-mode
+  :mode "\\.s\\(cala\\|bt\\)$")
+
+;; Enable sbt mode for executing sbt commands
+(use-package sbt-mode
+  :commands sbt-start sbt-command
+  :config
+  ;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31
+  ;; allows using SPACE when in the minibuffer
+  (substitute-key-definition
+   'minibuffer-complete-word
+   'self-insert-command
+   minibuffer-local-completion-map)
+  ;; sbt-supershell kills sbt-mode:
+  ;; https://github.com/hvesalai/emacs-sbt-mode/issues/152
+  (setq sbt:program-options '("-Dsbt.supershell=false"))
+  )
+
+;; TODO: Maybe make conditional instead of global
+;; Enable nice rendering of diagnostics like compile errors.
+(use-package flycheck
+  :init (global-flycheck-mode))
+
+(use-package lsp-mode
+  ;; Optional - enable lsp-mode automatically in scala files
+  :hook  (scala-mode . lsp)
+  (lsp-mode . lsp-lens-mode)
+  :config (setq lsp-prefer-flymake nil))
+
+;; Add metals backend for lsp-mode
+(use-package lsp-metals)
+
+;; Enable nice rendering of documentation on hover
+(use-package lsp-ui)
+
+;; lsp-mode supports snippets, but in order for them to work you need to use yasnippet
+;; If you don't want to use snippets set lsp-enable-snippet to nil in your lsp-mode settings
+;;   to avoid odd behavior with snippets and indentation
+(use-package yasnippet)
+
+;; Add company-lsp backend for metals
+; [tflucke] 2021-12-20: This isn't in the repos anymore.  Also, I don't know why
+; dependancy management won't handle this.
+;(use-package company-lsp)
+
+;; Use the Debug Adapter Protocol for running tests and debugging
+(use-package posframe
+  ;; Posframe is a pop-up tool that must be manually installed for dap-mode
+  )
+(use-package dap-mode
+  :hook
+  (lsp-mode . dap-mode)
+  (lsp-mode . dap-ui-mode)
+  )
+
+;; Use the Tree View Protocol for viewing the project structure and triggering compilation
+(use-package lsp-treemacs
+  :disabled
+  :config
+  (lsp-metals-treeview-enable t)
+  (setq lsp-metals-treeview-show-when-views-received t)
+  )
 
 (provide 'scala)

+ 3 - 1
.emacs.d/configs/spellcheck.el

@@ -6,7 +6,9 @@
 (defun flyspell-detect-ispell-args (&optional run-together)
   (cond ((string-match  "aspell$" ispell-program-name)
 		 (append (list "--sug-mode=ultra" "--lang=en_US")
-                 (if run-together '("--run-together" "--run-together-limit=5" "--run-together-min=2"))))
+                 (if run-together
+                     '("--run-together" "--run-together-limit=5" "--run-together-min=2")
+                   )))
 		((string-match "hunspell$" ispell-program-name)
 		 "-d en_US")))
 

+ 7 - 22
.emacs.d/init.el

@@ -5,13 +5,6 @@
 ;; gocode - Go auto complete
 
 ;; Enable loading my custom config files
-
-;; 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.
-(package-initialize)
-
 (add-to-list 'load-path "~/.emacs.d/configs/")
 
 ;; ----------- Default Variables -----------
@@ -29,7 +22,8 @@
               backup-directory-alist `(("." . ,backup-directory))
               delete-old-versions t)
 
-;; (global-linum-mode)
+;; ----------- Package Managing -----------
+(require 'package-loader)
 
 ;; Delete selected text when typing (normal editor behavior)
 (delete-selection-mode t)
@@ -53,19 +47,6 @@
 (global-set-key (kbd "M-f") 'revert-buffer)
 (global-set-key (kbd "M-F") 'revert-buffer-no-confirm)
 
-;; ----------- Package Managing -----------
-(require 'package-loader)
-
-;; ---------- Color Themes ----------
-;; TODO: Fix warning underline to always be orange/yellow
-;; Update: Seems it always takes the color of the foreground.
-;; Also seems to ignore most properties. (e.g. overline, underline,
-;; strike-though, etc.)  Maybe it's an xterm problem?
-(use-package color-theme
-  :config
-  (color-theme-initialize)
-  (load-theme 'Thomas-Experiement t))
-
 ;; ---------- Use X11 clipboard -----------
 (use-package xclip
   :if (executable-find "xclip")
@@ -123,6 +104,9 @@
 ;; ----------- Scala Mode -----------
 (require 'scala)
 
+;; ---------- Kotlin Mode -----------
+(require 'kotlin)
+
 ;; ------------ Web Mode ------------
 (require 'web)
 
@@ -181,10 +165,11 @@
  ;; If there is more than one, they won't work right.
  '(package-selected-packages
    (quote
-    (hl-todo restclient flyspell-correct-popup sx csharp-mode auctex racket-mode company-go go-mode flycheck-rust cargo rust-playground rust-mode magit multi-web-mode ensime flycheck company highlight-parentheses xclip color-theme auto-package-update use-package))))
+    (gnu-elpa-keyring-update flycheck-kotlin kotlin-mode hl-todo restclient flyspell-correct-popup sx csharp-mode auctex company-go go-mode flycheck-rust cargo rust-playground rust-mode magit multi-web-mode ensime flycheck company highlight-parentheses xclip auto-package-update use-package))))
 (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.
  )
+(put 'downcase-region 'disabled nil)

+ 1 - 1
.xsessionrc

@@ -7,4 +7,4 @@ if which numlockx > /dev/null 2> /dev/null; then
 fi
 
 xss-lock i3lock &
-#exec xautolock -time 15 -locker '/usr/local/bin/suspend' &
+exec xautolock -time 15 -locker 'systemctl --no-wall suspend' &