-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.scm
66 lines (44 loc) · 2.04 KB
/
init.scm
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
(require-builtin steel/random as rand::)
(require "cogs/keymaps.scm")
(require (prefix-in helix. "helix/commands.scm"))
(require (prefix-in helix.static. "helix/static.scm"))
(require "helix/configuration.scm")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Picking one from the possible themes is _fine_
(define possible-themes '("tokyonight_moon"))
(define (select-random lst)
(let ([index (rand::rng->gen-range 0 (length lst))]) (list-ref lst index)))
(define (randomly-pick-theme options)
;; Randomly select the theme from the possible themes list
(helix.theme (select-random options)))
(randomly-pick-theme possible-themes)
;;;;;;;;;;;;;;;;;;;;;;;; Default modes ;;;;;;;;;;;;;;;;;;;;;;;
;; Enable the recentf snapshot, will watch every 2 minutes for active files,
;; and flush those down to disk
(recentf-snapshot)
;;;;;;;;;;;;;;;;;;;;;;;;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;
;; To remove a binding, set it to 'no_op
;; For example, this will make it impossible to enter insert mode:
;; (hash "normal" (hash "i" 'no_op))
;; Set the global keybinding for now
(add-global-keybinding
(hash
"normal"
(hash "C-r" (hash "f" ":recentf-open-files") "space" (hash "l" ":load-buffer" "o" ":eval-sexpr"))))
(define scm-keybindings (hash "insert" (hash "ret" ':scheme-indent "C-l" ':insert-lambda)))
;; Grab whatever the existing keybinding map is
(define standard-keybindings (deep-copy-global-keybindings))
(define file-tree-base (deep-copy-global-keybindings))
(merge-keybindings standard-keybindings scm-keybindings)
(merge-keybindings file-tree-base FILE-TREE-KEYBINDINGS)
;; <scratch> + <doc id> is probably the best way to handle this?
(set-global-buffer-or-extension-keymap (hash "scm" standard-keybindings FILE-TREE file-tree-base))
;;;;;;;;;;;;;;;;;;;;;;;;;; Options ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(file-picker (fp-hidden #f))
(cursorline #t)
(soft-wrap (sw-enable #t))
(randomly-pick-theme possible-themes)
; (open-term)
;; (show-welcome-message)
;; Probably should be a symbol?
; (register-hook! 'post-insert-char 'prompt-on-char-press)