-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick-init.el
62 lines (54 loc) · 1.98 KB
/
quick-init.el
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
(setq corfu-auto t
visible-bell t
vertico-mode t
vertico-count 10
show-paren-mode t
show-paren-delay 0
xterm-mouse-mode t
load-prefer-newer t
global-corfu-mode t
pixel-scroll-mode t
electric-pair-mode t
corfu-prescient-mode t
prescient-persist-mode t
vertico-prescient-mode t
prescient-history-length 5
global-hide-mode-line-mode t
pixel-scroll-precision-mode t
prescient-sort-full-matches-first t
native-comp-async-report-warnings-errors nil)
(defalias 'yes-or-no-p 'y-or-n-p)
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(unless (display-graphic-p)
(corfu-terminal-mode +1))
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-to-list 'completion-at-point-functions #'cape-history)
(add-to-list 'completion-at-point-functions #'cape-keyword)
(vertico-indexed-mode)
(vertico-mouse-mode)
(add-hook 'vertico-mode-hook #'marginalia-mode)
(completion-styles '(orderless basic prescient))
(completion-category-overrides '((file (styles basic partial-completion))))
(defun sudo ()
"Opens the current buffer at point with root privelages using TRAMP"
(interactive)
(let ((position (point)))
(find-alternate-file (concat "/sudo::"
(buffer-file-name (current-buffer))))
(goto-char position)))
(defun ! (n)
"An emacs function to calculate the factorial of n using the calc library"
(string-to-number (calc-eval (format "%s!" n))))
(defun nPr (n k)
"A function for calculating the number of permutations in combinatorics"
(/
(! n)
(! (- n k))))
(defun nCr (n k)
"A function for calculating the number of combinations in combinatorics"
(/
(! n)
(* (! k) (! (- n k)))))
(defalias 'binomial 'nCr)