summaryrefslogtreecommitdiff
path: root/.emacs.d/init.el
blob: 42788eb64715fa07c0108f831888657bb64339d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;; load any plugins / call boostrapping code (straight)
(when (file-exists-p "~/.emacs.d/plugins.el")
  (load "~/.emacs.d/plugins.el"))
;; install packages
(when (file-exists-p "~/.emacs.d/packages.el")
  (load "~/.emacs.d/packages.el"))

;; Setup modes
;;(setq initial-buffer-choice t)
;;; remember layout
;;(desktop-save-mode 1)
;;; disable menu bar
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;;; disable emacs splash screen
(setq inhibit-startup-screen t)
;; Mode hooks
;;; show line numbers
(add-hook 'prog-mode-hook (lambda () (display-line-numbers-mode)
			    (visual-line-mode)))
(add-hook 'text-mode-hook (lambda () (display-line-numbers-mode)
			    (visual-line-mode)
			    (visual-fill-column-mode)))
;; lsp-hooks
(add-hook 'c++-mode-hook (lambda () (lsp)(company-mode)(yas-minor-mode)))
(add-hook 'python-mode-hook (lambda () (lsp)(comapny-mode)))
(add-hook 'java-mode-hook (lambda () (lsp)(comapny-mode)))
(add-hook 'c-mode-hook (lambda () (lsp)(company-mode)))

;; Idiomdrottning and bad-emacs-defaults fixes
(global-set-key [(control h)] 'delete-backward-char)
(keyboard-translate ?\C-h ?\C-?)
(make-directory "~/.emacs.d/backups/" t)
(make-directory "~/.emacs.d/autosave/" t)
(setq auto-save-file-name-transforms '((".*" "~/.emacs.d/autosave/" t)))
(setq backup-directory-alist '(("." . "~/.emacs.d/backups/")))
(setq sentence-end-double-space nil)

;; follow symlinks
(setq vc-follow-symlinks nil)

;; visual-line-mode make C-a/C-e go to the end of the /actual line/
(global-set-key (kbd "C-e") 'end-of-line)
(global-set-key (kbd "C-a") 'beginning-of-line)

;; Custom mode prefixes
;;; set gemini to markdown mode for now
(add-to-list 'auto-mode-alist '("\\.gmi\\'" . markdown-mode))

;; theme customization
(require 'moe-theme)
(setq moe-theme-mode-line-color 'cyan)
(moe-dark)
(defun use-light-theme () "Set theme to light"
       (interactive)
       (moe-light))
(defun use-dark-theme () "Set theme to dark"
       (interactive)
       (moe-dark))

(global-set-key "\C-cl" 'use-light-theme)
(global-set-key "\C-cd" 'use-dark-theme)
(setq lsp-keymap-prefix "C-s-l")