Compare commits

..

No commits in common. "068f63d5072444c344f915f25009abdf53a003f9" and "38c0f134c0b233b0f28412226723b059dc5058b7" have entirely different histories.

11 changed files with 26 additions and 76 deletions

2
.gitignore vendored
View File

@ -3,7 +3,5 @@ backup/
elpa/ elpa/
transient/ transient/
.DS_Store
.lsp-session-*
history history
recentf recentf

View File

@ -20,10 +20,3 @@
tab-width 4) tab-width 4)
(setq require-final-newline t) (setq require-final-newline t)
(add-hook 'before-save-hook 'whitespace-cleanup) (add-hook 'before-save-hook 'whitespace-cleanup)
;; Make sure that UTF-8 is *ALWAYS* the default encoding.
(set-charset-priority 'unicode)
(prefer-coding-system 'utf-8-unix)
;; Prettify symbols (eg. lambda -> λ).
(global-prettify-symbols-mode)

42
init.el
View File

@ -17,17 +17,6 @@
(package-install 'use-package)) (package-install 'use-package))
;; Configure how and where backup files are created.
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
backup-by-copying t ; Don't delink hardlinks
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups
kept-new-versions 20 ; How many of the newest versions to keep
kept-old-versions 5 ; How many of the oldest versions to keep
)
;; Define a couple simple helper functions for loading user-defined ;; Define a couple simple helper functions for loading user-defined
;; configuration files. ;; configuration files.
@ -35,12 +24,9 @@
(defun load-user-file (file) (defun load-user-file (file)
"Load FILE in the current user's configuration directory. "Load FILE in the current user's configuration directory.
File names which are prefixed with an underscore or which do not have the File names which are prefixed with an underscore will be ignored."
extension '.el' will be ignored."
(interactive "f") (interactive "f")
(setq file-name (file-name-nondirectory file)) (unless (string-prefix-p "_" (file-name-nondirectory file))
(when (and (string-suffix-p ".el" file-name)
(not (string-prefix-p "_" file-name)))
(load-file (expand-file-name file user-init-dir)))) (load-file (expand-file-name file user-init-dir))))
(defun load-user-dir (dir) (defun load-user-dir (dir)
@ -52,23 +38,28 @@
(load-user-file file))) (load-user-file file)))
;; Load all user-defined configuration files. ;; Configure how and where backup files are created:
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
backup-by-copying t ; Don't delink hardlinks
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups
kept-new-versions 20 ; How many of the newest versions to keep
kept-old-versions 5 ; How many of the oldest versions to keep
)
;; Load all user-defined configuration files:
(load-user-file "editor.el") (load-user-file "editor.el")
(load-user-file "interface.el") (load-user-file "interface.el")
(load-user-file "key-bindings.el") (load-user-file "key-bindings.el")
(load-user-file "theme.el") (load-user-file "typography.el")
(load-user-dir "pkg") (load-user-dir "pkg")
(load-user-dir "lang") (load-user-dir "lang")
;; Diminish some built-in modes that we don't really care about.
(add-hook 'eldoc-mode-hook (lambda () (diminish 'eldoc-mode)))
(add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))
;; WARNING: Don't touch anything after this comment! ;; WARNING: Don't touch anything after this comment!
(custom-set-variables (custom-set-variables
@ -79,7 +70,8 @@
'(git-gutter:added-sign " +") '(git-gutter:added-sign " +")
'(git-gutter:deleted-sign " -") '(git-gutter:deleted-sign " -")
'(git-gutter:modified-sign " *") '(git-gutter:modified-sign " *")
'(package-selected-packages nil)) '(package-selected-packages
'(yaml-mode toml-mode markdown-mode yasnippet which-key vertico super-save solaire-mode smartparens rainbow-delimiters nerd-icons nerd-icons-dired magit lsp-mode hl-todo hl-line git-gutter flycheck diminish crux)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.

View File

@ -19,9 +19,6 @@
scroll-margin 0 scroll-margin 0
scroll-preserve-screen-position 1) scroll-preserve-screen-position 1)
;; Hide the frame identifier in the mode line.
(setq mode-line-frame-identification " ")
;; Display the column and line numbers of the cursor in the mode line. ;; Display the column and line numbers of the cursor in the mode line.
(column-number-mode) (column-number-mode)

View File

@ -10,5 +10,6 @@
;; Enable code folding in programming modes, and set some more reasonable ;; Enable code folding in programming modes, and set some more reasonable
;; shortcuts. ;; shortcuts.
(add-hook 'prog-mode-hook #'hs-minor-mode) (add-hook 'prog-mode-hook #'hs-minor-mode)
(add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))
(global-set-key (kbd "C-c C-h") (kbd "C-c @ C-h")) ; Hide a block (global-set-key (kbd "C-c C-h") (kbd "C-c @ C-h")) ; Hide a block
(global-set-key (kbd "C-c C-s") (kbd "C-c @ C-s")) ; Show a block (global-set-key (kbd "C-c C-s") (kbd "C-c @ C-s")) ; Show a block

View File

@ -1,15 +0,0 @@
;; Rust
;; https://github.com/emacs-rustic/rustic
(use-package rustic
:ensure t
:custom
(rustic-cargo-use-last-stored-arguments t)
:bind
(:map rustic-mode-map
("M-?" . lsp-find-references)
("C-c C-c l" . flycheck-list-errors)
("C-c C-c a" . lsp-execute-code-action)
("C-c C-c r" . lsp-rename)
("C-c C-c q" . lsp-workspace-restart)
("C-c C-c Q" . lsp-workspace-shutdown)
("C-c C-c s" . lsp-rust-analyzer-status)))

View File

@ -3,10 +3,5 @@
(use-package hl-todo (use-package hl-todo
:ensure t :ensure t
:config :config
(setq hl-todo-keyword-faces
'(("FIXME" . "#f7768e")
("HACK" . "#7aa2f7")
("NOTE" . "#e0af68")
("TODO" . "#bb9af7")))
(add-hook 'prog-mode-hook #'hl-todo-mode) (add-hook 'prog-mode-hook #'hl-todo-mode)
(add-hook 'text-mode-hook #'hl-todo-mode)) (add-hook 'text-mode-hook #'hl-todo-mode))

View File

@ -2,10 +2,5 @@
;; https://github.com/emacs-lsp/lsp-mode ;; https://github.com/emacs-lsp/lsp-mode
(use-package lsp-mode (use-package lsp-mode
:ensure t :ensure t
:diminish lsp-mode :commands (lsp lsp-deferred)
:commands lsp :hook ((lsp-mode . lsp-enable-which-key-integration)))
:init
;; Set prefix for lsp-command-keymap:
(setq lsp-keymap-prefix "C-c l")
:hook
((lsp-mode . lsp-enable-which-key-integration)))

View File

@ -1,5 +0,0 @@
;; Org mode.
(use-package org
:ensure t
:mode
(("\\.org$" . org-mode)))

View File

@ -1,7 +0,0 @@
;; https://github.com/doomemacs/themes
(use-package doom-themes
:ensure t
:config
(load-theme 'doom-tokyo-night t)
;(doom-themes-visual-bell-config)
)

6
typography.el Normal file
View File

@ -0,0 +1,6 @@
;; Make sure that UTF-8 is *ALWAYS* the default encoding.
(set-charset-priority 'unicode)
(prefer-coding-system 'utf-8-unix)
;; Prettify symbols (eg. lambda -> λ).
(global-prettify-symbols-mode)