Add some more packages and fix some existing configuration
This commit is contained in:
parent
bc343c2677
commit
38c0f134c0
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,7 @@
|
|||||||
auto-save-list/
|
auto-save-list/
|
||||||
|
backup/
|
||||||
elpa/
|
elpa/
|
||||||
transient/
|
transient/
|
||||||
|
|
||||||
*~
|
history
|
||||||
|
recentf
|
||||||
|
26
init.el
26
init.el
@ -23,19 +23,32 @@
|
|||||||
(defconst user-init-dir "~/.emacs.d/")
|
(defconst user-init-dir "~/.emacs.d/")
|
||||||
|
|
||||||
(defun load-user-file (file)
|
(defun load-user-file (file)
|
||||||
|
"Load FILE in the current user's configuration directory.
|
||||||
|
File names which are prefixed with an underscore will be ignored."
|
||||||
(interactive "f")
|
(interactive "f")
|
||||||
"Load a file in the current user's configuration directory"
|
(unless (string-prefix-p "_" (file-name-nondirectory file))
|
||||||
(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)
|
||||||
|
"Recursively load all files in directory DIR.
|
||||||
|
DIR should be relative to the user's configuration directory."
|
||||||
(interactive "f")
|
(interactive "f")
|
||||||
"Recursively load all files in a given directory, relative to the user's
|
|
||||||
configuration directory"
|
|
||||||
(setq config-dir (file-name-concat user-init-dir dir))
|
(setq config-dir (file-name-concat user-init-dir dir))
|
||||||
(dolist (file (directory-files-recursively config-dir ""))
|
(dolist (file (directory-files-recursively config-dir ""))
|
||||||
(load-user-file file)))
|
(load-user-file file)))
|
||||||
|
|
||||||
|
|
||||||
|
;; 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 all user-defined configuration files:
|
||||||
|
|
||||||
(load-user-file "editor.el")
|
(load-user-file "editor.el")
|
||||||
@ -54,8 +67,11 @@
|
|||||||
;; 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.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
|
'(git-gutter:added-sign " +")
|
||||||
|
'(git-gutter:deleted-sign " -")
|
||||||
|
'(git-gutter:modified-sign " *")
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(yaml-mode toml-mode markdown-mode yasnippet which-key super-save solaire-mode smartparens rainbow-delimiters magit hl-todo git-gutter flycheck diminish crux)))
|
'(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.
|
||||||
|
@ -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
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
;; https://github.com/flycheck/flycheck
|
;; https://github.com/flycheck/flycheck
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
|
||||||
:diminish flycheck-mode
|
:diminish flycheck-mode
|
||||||
:config
|
:config
|
||||||
(setq flycheck-standard-error-navigation nil)
|
(setq flycheck-standard-error-navigation nil)
|
||||||
|
6
pkg/lsp.el
Normal file
6
pkg/lsp.el
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
;; Language server protocol support.
|
||||||
|
;; https://github.com/emacs-lsp/lsp-mode
|
||||||
|
(use-package lsp-mode
|
||||||
|
:ensure t
|
||||||
|
:commands (lsp lsp-deferred)
|
||||||
|
:hook ((lsp-mode . lsp-enable-which-key-integration)))
|
8
pkg/nerd-icons-dired.el
Normal file
8
pkg/nerd-icons-dired.el
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
;; Use nerd icons in dired mode.
|
||||||
|
;; https://github.com/rainstormstudio/nerd-icons-dired
|
||||||
|
(use-package nerd-icons-dired
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
|
:diminish nerd-icons-dired-mode
|
||||||
|
:hook
|
||||||
|
(dired-mode . nerd-icons-dired-mode))
|
6
pkg/nerd-icons.el
Normal file
6
pkg/nerd-icons.el
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
;; Nerd Font icons.
|
||||||
|
;; https://github.com/rainstormstudio/nerd-icons.el
|
||||||
|
(use-package nerd-icons
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(nerd-icons-font-family "FiraCode Nerd Font"))
|
4
pkg/savehist.el
Normal file
4
pkg/savehist.el
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
;; Persist history over Emacs restarts.
|
||||||
|
(use-package savehist
|
||||||
|
:init
|
||||||
|
(savehist-mode))
|
@ -2,7 +2,7 @@
|
|||||||
;; https://github.com/bbatsov/super-save
|
;; https://github.com/bbatsov/super-save
|
||||||
(use-package super-save
|
(use-package super-save
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
|
||||||
:diminish super-save-mode
|
:diminish super-save-mode
|
||||||
:config
|
:config
|
||||||
|
(setq super-save-auto-save-when-idle t)
|
||||||
(super-save-mode +1))
|
(super-save-mode +1))
|
||||||
|
9
pkg/vertico.el
Normal file
9
pkg/vertico.el
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
;; Vertical interactive completion.
|
||||||
|
;; https://github.com/minad/vertico
|
||||||
|
(use-package vertico
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(vertico-count 3)
|
||||||
|
(vertico-cycle t)
|
||||||
|
:init
|
||||||
|
(vertico-mode))
|
Loading…
Reference in New Issue
Block a user