blob: 0559b225ad9676f08b4f2529ebd79045e85d59af (
plain) (
blame)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
(setq custom-file "~/.emacs.d/emacs-custom.el")
(load-file custom-file)
;; -- utils ---------------------------------------------------------------------
(defun install-once (pkg)
(unless (package-installed-p pkg)
(package-install pkg)))
;; -- emacs ---------------------------------------------------------------------
;; disable menu bar
(menu-bar-mode 0)
;; disable tool bar
(tool-bar-mode 0)
;; disable scroll bar
(scroll-bar-mode 0)
;; windows focus follow mouse (>0 means sec delay before focus)
(setq mouse-autoselect-window 0)
;; disable indenting with TABs
(setq-default indent-tabs-mode nil)
;; line numbers
;(setq display-line-numbers-type 'relative)
;(display-line-numbers-mode 0)
;; place backup of all files in single directory
(setq backup-directory-alist '(("." . "~/.emacs.d/backup")))
;; always show trailing whitespace (no mode needed)
;; variable is buffer local, hence we overwrite the global default
(setq-default show-trailing-whitespace t)
;; whitespace style (when whitespace-mode is enabled)
(setq whitespace-style '(face trailing tabs lines tab-mark))
;; -- ibuffer -------------------------------------------------------------------
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; -- isearch -------------------------------------------------------------------
;; show number of matches
(setq isearch-lazy-count t)
;; -- ansi-color ----------------------------------------------------------------
(require 'ansi-color)
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
;; -- oderless ------------------------------------------------------------------
(install-once 'orderless)
(require 'orderless)
(setq completion-styles '(orderless basic)
completion-category-overrides '((file (styles basic partial-completion))))
;; -- evil ----------------------------------------------------------------------
(install-once 'evil)
;; need to be set before require-ing evil
(setq evil-undo-system 'undo-redo)
(require 'evil)
(evil-mode 1)
(evil-define-key '(normal motion) 'global (kbd "C-k") 'evil-scroll-up)
(evil-define-key '(normal motion) 'global (kbd "C-j") 'evil-scroll-down)
(evil-define-key 'motion compilation-mode-map "gr" 'recompile)
(evil-define-key 'motion compilation-mode-map "n" 'next-error-no-select)
(evil-define-key 'motion compilation-mode-map "p" 'previous-error-no-select)
(evil-define-key 'motion grep-mode-map "n" 'next-error-no-select)
(evil-define-key 'motion grep-mode-map "p" 'previous-error-no-select)
(evil-define-key 'normal xref--xref-buffer-mode-map (kbd "RET") 'xref-goto-xref)
(evil-define-key 'normal xref--xref-buffer-mode-map "n" 'xref-next-line)
(evil-define-key 'normal xref--xref-buffer-mode-map "p" 'xref-prev-line)
;; -- magit ---------------------------------------------------------------------
(install-once 'magit)
(require 'magit)
|