-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
152 lines (131 loc) · 4.09 KB
/
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
;; -*- lexical-binding: t -*-
(require 'package)
(setopt package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")))
(when (not (= emacs-major-version 29))
(error (format "Only works with Emacs 29" emacs-major-version)))
(unless (package-installed-p 'vc-use-package)
(package-vc-install "https://github.com/slotThe/vc-use-package"))
(require 'vc-use-package)
(use-package no-littering
:ensure t
:config
(no-littering-theme-backups)
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)))
(use-package emacs
;; scrolling
:custom
(mouse-wheel-progressive-speed nil)
(scroll-conservatively 101)
;; completion
(completion-styles '(basic partial-completion emacs22 substring))
(completions-format 'one-column)
(icomplete-mode t)
;; appearance
(column-number-mode t)
(custom-enabled-themes '(modus-vivendi))
(global-display-line-numbers-mode t)
(inhibit-startup-screen t)
(size-indication-mode t)
(tool-bar-mode nil)
(visible-bell t)
;; other
(electric-pair-mode t)
(completion-ignore-case t)
(read-file-name-completion-ignore-case t)
:config
(global-auto-revert-mode)
(xterm-mouse-mode))
(use-package tab-bar
:custom
(tab-bar-mode t))
(use-package proced
:custom
(proced-show-remote-processes t))
(use-package dired
:config
(put 'dired-find-alternate-file 'disabled nil))
(use-package wdired
:custom
(wdired-allow-to-change-permissions t))
(use-package windmove
:bind (("C-x <left>" . windmove-left)
("C-x <right>" . windmove-right)
("C-x <up>" . windmove-up)
("C-x <down>" . windmove-down)))
(add-to-list 'load-path "~/projects/org-mode/lisp") ; https://github.com/nafiz1001/org-mode/tree/patch
(use-package org
:custom
(org-directory "~/Documents/Org")
(org-capture-templates '(("d"
"Diary/Journalling"
item
(file+headline (lambda () (expand-file-name (concat org-directory "/Diary/" (format-time-string "%Y-%m-%d.org"))))
(lambda () (format-time-string (org-time-stamp-format t t) (current-time))))
"- %?"
:empty-lines 0)))
:config
(add-hook 'org-mode-hook #'visual-line-mode))
(use-package xref
:custom
(xref-search-program 'ripgrep))
(use-package eglot
:after (treesit)
:config
(add-to-list 'eglot-server-programs `(((js-mode :language-id "javascript")
(js-ts-mode :language-id "javascript")
(tsx-ts-mode :language-id "typescriptreact")
(typescript-ts-mode :language-id "typescript")
(typescript-mode :language-id "typescript"))
.
("typescript-language-server" "--stdio"))))
(use-package editorconfig
:ensure t
:config
(editorconfig-mode 1))
(use-package treesit-auto
:ensure t
:custom
(treesit-auto-install 'prompt)
:config
(treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode))
(use-package magit
:ensure t)
(use-package xclip
:ensure t
:config
(xclip-mode 1))
(use-package apheleia
:ensure t
:config
(apheleia-global-mode +1)
(setf (alist-get 'prettier-json apheleia-formatters)
'("apheleia-npx"
"prettier"
"--stdin-filepath"
filepath
(if (equal (file-name-nondirectory (apheleia-formatters-local-buffer-file-name)) "package.json")
"--parser=json-stringify"
"--parser=json")
(apheleia-formatters-js-indent "--use-tabs" "--tab-width"))))
(use-package nix-mode
:ensure t
:mode "\\.nix\\'")
(use-package keycast
:disabled
:ensure t)
(custom-set-variables
;; custom-set-variables 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.
'(package-vc-selected-packages
'((vc-use-package :vc-backend Git :url "https://github.com/slotThe/vc-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.
)