mirror of
https://codeberg.org/frosty/init.el.git
synced 2024-09-19 11:46:39 -04:00
more organization
This commit is contained in:
parent
f11c94e725
commit
41ec997a68
217
README.org
217
README.org
|
@ -56,22 +56,21 @@
|
||||||
:config (mode-line-bell-mode))
|
:config (mode-line-bell-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
* Input and Text Manipulation
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
;;; Buffer input and interaction
|
|
||||||
|
|
||||||
;; Better mouse scrolling
|
;; Better mouse scrolling
|
||||||
(setq mouse-wheel-progressive-speed nil)
|
(setq mouse-wheel-progressive-speed nil)
|
||||||
|
|
||||||
;; Use short yes/no answers
|
|
||||||
(setq-default use-short-answers t)
|
|
||||||
|
|
||||||
;; Auto-pair parenthesis
|
;; Auto-pair parenthesis
|
||||||
(electric-pair-mode 1)
|
(electric-pair-mode 1)
|
||||||
|
|
||||||
;; VIM emulation
|
;; Automatically trim trailing whitespace on save
|
||||||
(unless (package-installed-p 'evil)
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||||
(package-install 'evil))
|
|
||||||
|
;;; VIM emulation
|
||||||
|
(use-package evil
|
||||||
|
:ensure t
|
||||||
|
:init
|
||||||
(setq
|
(setq
|
||||||
;; Scroll up with C-u
|
;; Scroll up with C-u
|
||||||
evil-want-C-u-scroll t
|
evil-want-C-u-scroll t
|
||||||
|
@ -81,151 +80,137 @@
|
||||||
evil-split-window-below t
|
evil-split-window-below t
|
||||||
;; Create vsplit windows to the right
|
;; Create vsplit windows to the right
|
||||||
evil-vsplit-window-right t)
|
evil-vsplit-window-right t)
|
||||||
(require 'evil)
|
:config (evil-mode))
|
||||||
(evil-mode 1)
|
|
||||||
|
|
||||||
;; Automatically trim trailing whitespace on save
|
;; Org extension for Evil
|
||||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
(use-package evil-org
|
||||||
|
:ensure t
|
||||||
|
:after org
|
||||||
|
:hook (org-mode . evil-org-mode))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
;;; General interface
|
* General Interface Improvements
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; Completion UI
|
;; Use short yes/no answers
|
||||||
(unless (package-installed-p 'vertico)
|
(setq-default use-short-answers t)
|
||||||
(package-install 'vertico))
|
|
||||||
(require 'vertico)
|
|
||||||
(vertico-mode 1)
|
|
||||||
|
|
||||||
|
;;; Completion UI
|
||||||
|
(use-package vertico
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(vertico-mode)
|
||||||
;; Improve directory navigation
|
;; Improve directory navigation
|
||||||
(define-key vertico-map (kbd "RET") #'vertico-directory-enter)
|
(define-key vertico-map (kbd "RET") #'vertico-directory-enter)
|
||||||
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-word)
|
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-word)
|
||||||
(define-key vertico-map (kbd "M-d") #'vertico-directory-delete-char)
|
(define-key vertico-map (kbd "M-d") #'vertico-directory-delete-char))
|
||||||
|
|
||||||
|
;;; Completion style
|
||||||
|
(use-package orderless
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(setq completion-styles '(orderless basic)
|
||||||
|
completion-category-overrides '((file (styles basic partial-completion)))))
|
||||||
|
|
||||||
;;; Extended completion utilities
|
;;; Extended completion utilities
|
||||||
(unless (package-installed-p 'consult)
|
(use-package consult
|
||||||
(package-install 'consult))
|
:ensure t
|
||||||
|
:config
|
||||||
(global-set-key [rebind switch-to-buffer] #'consult-buffer)
|
(global-set-key [rebind switch-to-buffer] #'consult-buffer)
|
||||||
(global-set-key (kbd "C-c j") #'consult-line)
|
(global-set-key (kbd "C-c j") #'consult-line)
|
||||||
(global-set-key (kbd "C-c i") #'consult-imenu)
|
(global-set-key (kbd "C-c i") #'consult-imenu))
|
||||||
|
|
||||||
|
;; Completion options
|
||||||
(setq read-buffer-completion-ignore-case t
|
(setq read-buffer-completion-ignore-case t
|
||||||
read-file-name-completion-ignore-case t
|
read-file-name-completion-ignore-case t
|
||||||
completion-ignore-case t)
|
completion-ignore-case t)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
;;; LSP Support
|
* Programming Extensions
|
||||||
(unless (package-installed-p 'eglot)
|
#+BEGIN_SRC emacs-lisp
|
||||||
(package-install 'eglot))
|
;;; LSP support
|
||||||
|
(use-package eglot
|
||||||
|
:ensure t
|
||||||
;; Enable LSP support by default in programming buffers
|
;; Enable LSP support by default in programming buffers
|
||||||
(add-hook 'prog-mode-hook #'eglot-ensure)
|
:hook (prog-mode-hook . eglot-ensure)
|
||||||
|
:config
|
||||||
;; Create a memorable alias for `eglot-ensure'.
|
;; Create a memorable alias for `eglot-ensure'.
|
||||||
(defalias 'start-lsp-server #'eglot)
|
(defalias 'start-lsp-server #'eglot))
|
||||||
|
|
||||||
;; Completion style
|
|
||||||
(unless (package-installed-p 'orderless)
|
|
||||||
(package-install 'orderless))
|
|
||||||
(require 'orderless)
|
|
||||||
(setq completion-styles '(orderless basic)
|
|
||||||
completion-category-overrides '((file (styles basic partial-completion))))
|
|
||||||
|
|
||||||
;; Persist history over restarts
|
|
||||||
(require 'savehist)
|
|
||||||
(savehist-mode 1)
|
|
||||||
|
|
||||||
|
|
||||||
;;; Inline static analysis
|
|
||||||
|
|
||||||
;; Enabled inline static analysis
|
|
||||||
(add-hook 'prog-mode-hook #'flymake-mode)
|
|
||||||
|
|
||||||
|
;;; Static analysis
|
||||||
|
(use-package flymake
|
||||||
|
:hook (prog-mode-hook . flymake-mode)
|
||||||
|
:config
|
||||||
;; Display messages when idle, without prompting
|
;; Display messages when idle, without prompting
|
||||||
(setq help-at-pt-display-when-idle t)
|
(setq help-at-pt-display-when-idle t)
|
||||||
|
|
||||||
;; Message navigation bindings
|
;; Message navigation bindings
|
||||||
(with-eval-after-load 'flymake
|
|
||||||
(define-key flymake-mode-map (kbd "C-c n") #'flymake-goto-next-error)
|
(define-key flymake-mode-map (kbd "C-c n") #'flymake-goto-next-error)
|
||||||
(define-key flymake-mode-map (kbd "C-c p") #'flymake-goto-prev-error))
|
(define-key flymake-mode-map (kbd "C-c p") #'flymake-goto-prev-error))
|
||||||
|
|
||||||
;;; Pop-up completion
|
;;; Pop-up completion
|
||||||
(unless (package-installed-p 'corfu)
|
(use-package corfu
|
||||||
(package-install 'corfu))
|
:ensure t
|
||||||
|
|
||||||
;; Enable autocompletion by default in programming buffers
|
;; Enable autocompletion by default in programming buffers
|
||||||
(add-hook 'prog-mode-hook #'corfu-mode)
|
:hook (prog-mode-hook . corfu-mode)
|
||||||
|
;; Enable automatic completion
|
||||||
;; Enable automatic completion.
|
:init (setq corfu-auto t))
|
||||||
(setq corfu-auto t)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Git client
|
;;; Git client
|
||||||
(unless (package-installed-p 'magit)
|
(use-package magit
|
||||||
(package-install 'magit))
|
:ensure t
|
||||||
|
:config
|
||||||
;; Bind the `magit-status' command to a convenient key.
|
;; Bind the `magit-status' command to a convenient key.
|
||||||
(global-set-key (kbd "C-c g") #'magit-status)
|
(global-set-key (kbd "C-c g") #'magit-status))
|
||||||
|
|
||||||
;;; Indication of local VCS changes
|
|
||||||
(unless (package-installed-p 'diff-hl)
|
|
||||||
(package-install 'diff-hl))
|
|
||||||
|
|
||||||
|
;;; Diff indication
|
||||||
|
(use-package diff-hl
|
||||||
|
:ensure t
|
||||||
;; Enable `diff-hl' support by default in programming buffers
|
;; Enable `diff-hl' support by default in programming buffers
|
||||||
(add-hook 'prog-mode-hook #'diff-hl-mode)
|
:hook (prog-mode-hook . diff-hl-mode))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Go Support
|
|
||||||
(unless (package-installed-p 'go-mode)
|
|
||||||
(package-install 'go-mode))
|
|
||||||
|
|
||||||
;;; JSON Support
|
|
||||||
(unless (package-installed-p 'json-mode)
|
|
||||||
(package-install 'json-mode))
|
|
||||||
|
|
||||||
;;; Lua Support
|
|
||||||
(unless (package-installed-p 'lua-mode)
|
|
||||||
(package-install 'lua-mode))
|
|
||||||
|
|
||||||
;;; Rust Support
|
|
||||||
(unless (package-installed-p 'rust-mode)
|
|
||||||
(package-install 'rust-mode))
|
|
||||||
|
|
||||||
;;; YAML Support
|
|
||||||
(unless (package-installed-p 'yaml-mode)
|
|
||||||
(package-install 'yaml-mode))
|
|
||||||
|
|
||||||
;;; Markdown support
|
|
||||||
(unless (package-installed-p 'markdown-mode)
|
|
||||||
(package-install 'markdown-mode))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;; Extra language modes
|
||||||
|
(use-package go-mode
|
||||||
|
:ensure t)
|
||||||
|
(use-package json-mode
|
||||||
|
:ensure t)
|
||||||
|
(use-package lua-mode
|
||||||
|
:ensure t)
|
||||||
|
(use-package rust-mode
|
||||||
|
:ensure t)
|
||||||
|
(use-package yaml-mode
|
||||||
|
:ensure t)
|
||||||
|
(use-package markdown-mode
|
||||||
|
:ensure t)
|
||||||
|
|
||||||
;;; EditorConfig support
|
;;; EditorConfig support
|
||||||
(unless (package-installed-p 'editorconfig)
|
(use-package editorconfig
|
||||||
(package-install 'editorconfig))
|
:ensure t
|
||||||
|
:config (editorconfig-mode))
|
||||||
|
|
||||||
;; Enable EditorConfig
|
;;; Terminal emulator
|
||||||
(editorconfig-mode t)
|
(use-package eat
|
||||||
|
:ensure t
|
||||||
;;; In-Emacs Terminal Emulation
|
:config
|
||||||
(unless (package-installed-p 'eat)
|
(setq
|
||||||
(package-install 'eat))
|
;; Close the terminal buffer when the shell terminates
|
||||||
|
eat-kill-buffer-on-exit t
|
||||||
;; Close the terminal buffer when the shell terminates.
|
;; Enable mouse support
|
||||||
(setq eat-kill-buffer-on-exit t)
|
eat-enable-mouse t))
|
||||||
|
|
||||||
;; Enable mouse-support.
|
|
||||||
(setq eat-enable-mouse t)
|
|
||||||
|
|
||||||
;;; Jump to arbitrary positions
|
;;; Jump to arbitrary positions
|
||||||
(unless (package-installed-p 'avy)
|
(use-package avy
|
||||||
(package-install 'avy))
|
:ensure t
|
||||||
(global-set-key (kbd "C-c z") #'avy-goto-word-1)
|
:config
|
||||||
|
(global-set-key (kbd "C-c z") #'avy-goto-word-1))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
;; Store automatic customisation options elsewhere
|
* Etcetera
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
;; Store automatic customization options elsewhere
|
||||||
(setq custom-file (locate-user-emacs-file "custom.el"))
|
(setq custom-file (locate-user-emacs-file "custom.el"))
|
||||||
(when (file-exists-p custom-file)
|
(when (file-exists-p custom-file)
|
||||||
(load custom-file))
|
(load custom-file))
|
||||||
|
|
||||||
|
;; Persist history over restarts
|
||||||
|
(use-package savehist
|
||||||
|
:config (savehist-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
Loading…
Reference in a new issue