2019-06-06 09:57:55 +00:00
|
|
|
;;; init.el --- My custom Emacs configuration file. -*- lexical-binding: t; -*-
|
2019-04-12 08:35:58 +00:00
|
|
|
|
2020-07-22 00:48:25 +00:00
|
|
|
;;; Commentary:
|
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;================================================================================
|
|
|
|
;;
|
|
|
|
;; Jessie Hildebrandt's
|
|
|
|
;; Run-Anywhere Emacs Config
|
|
|
|
;;
|
2020-07-22 00:48:25 +00:00
|
|
|
;; This configuration file was designed to work with Emacs 27, but should work
|
|
|
|
;; with Emacs 26.
|
|
|
|
;;
|
|
|
|
;; Generic keybinds are documented at the top of the "Key Bindings" subsection,
|
|
|
|
;; and package-specific keybinds are documented above each "use-package" statement
|
|
|
|
;; in the "EXTERNAL PACKAGES" section.
|
|
|
|
;;
|
2017-11-15 04:15:29 +00:00
|
|
|
;;================================================================================
|
|
|
|
|
2020-07-22 00:48:25 +00:00
|
|
|
;;; Code:
|
2018-08-04 23:32:42 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;========================================
|
|
|
|
;;
|
|
|
|
;; EMACS CONFIGURATION
|
|
|
|
;;
|
|
|
|
;;========================================
|
|
|
|
|
|
|
|
;;====================
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Garbage Collector
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
|
2020-07-22 00:48:11 +00:00
|
|
|
;; Set the default garbage collection parameters. (~32MB)
|
2020-08-02 23:44:26 +00:00
|
|
|
(defconst init-file/gc-cons-threshold 32000000 "Preferred garbage collection threshold value.")
|
|
|
|
(defconst init-file/gc-cons-percentage 0.1 "Preferred garbage collection percentage value.")
|
2020-04-29 18:58:15 +00:00
|
|
|
|
|
|
|
;; Define some functions for deferring and restoring Emacs' garbage collection facilities.
|
|
|
|
(defun defer-garbage-collection ()
|
|
|
|
"Set the garbage collection threshold to the highest possible for collection avoidance."
|
|
|
|
(setq gc-cons-threshold most-positive-fixnum
|
|
|
|
gc-cons-percentage 0.6))
|
|
|
|
(defun restore-garbage-collection ()
|
|
|
|
"Restore the garbage collection threshold parameters in a deferred fashion."
|
|
|
|
(run-at-time
|
|
|
|
1 nil (lambda () (setq gc-cons-threshold init-file/gc-cons-threshold
|
|
|
|
gc-cons-percentage init-file/gc-cons-percentage))))
|
|
|
|
|
|
|
|
;; Defer garbage collection while Emacs is starting and restore the threshold to 8MB when we're done.
|
|
|
|
(defer-garbage-collection)
|
|
|
|
(add-hook 'emacs-startup-hook #'restore-garbage-collection)
|
|
|
|
|
|
|
|
;; Similarly raise and restore the garbage collection threshold for minibuffer commands.
|
|
|
|
(add-hook 'minibuffer-setup-hook #'defer-garbage-collection)
|
|
|
|
(add-hook 'minibuffer-exit-hook #'restore-garbage-collection)
|
2018-03-30 05:11:23 +00:00
|
|
|
|
2020-07-16 21:38:23 +00:00
|
|
|
;; Collect all garbage whenever the focus changes to/from Emacs.
|
2020-08-29 22:14:11 +00:00
|
|
|
(if (>= emacs-major-version 27)
|
|
|
|
(add-function :after after-focus-change-function #'garbage-collect)
|
2020-10-26 04:13:53 +00:00
|
|
|
(with-no-warnings (add-hook 'focus-out-hook #'garbage-collect)))
|
2018-03-30 05:11:23 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Variables/Basic Config.
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Basic variable configuration.
|
2019-04-12 08:35:58 +00:00
|
|
|
(setq-default
|
|
|
|
initial-scratch-message "" ; Remove initial message
|
|
|
|
frame-title-format '("Emacs - %b") ; Window title formatting
|
2020-08-29 21:27:41 +00:00
|
|
|
truncate-lines t ; Truncate lines instead of wrapping
|
|
|
|
message-truncate-lines t ; Truncate messages in the echo area
|
2019-04-12 08:35:58 +00:00
|
|
|
inhibit-startup-screen t ; Don't show startup screen
|
|
|
|
inhibit-splash-screen t ; Don't show splash screen
|
|
|
|
x-gtk-use-system-tooltips nil ; Don't use system tooltips
|
|
|
|
mouse-wheel-progressive-speed nil ; Don't accelerate mouse scrolling
|
|
|
|
scroll-preserve-screen-position 1 ; Don't move cursor while scrolling
|
2020-03-02 07:23:33 +00:00
|
|
|
scroll-conservatively 101 ; Only scroll one line at a time
|
|
|
|
scroll-margin 5 ; Maintain a margin of 5 lines while scrolling
|
2017-11-15 04:15:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;; Set backup behavior.
|
2019-04-12 08:35:58 +00:00
|
|
|
(setq-default
|
2020-06-03 22:06:57 +00:00
|
|
|
backup-by-copying t ; Don't delink hardlinks
|
|
|
|
version-control t ; Use version numbers on backups
|
|
|
|
delete-old-versions t ; Do not keep old backups
|
|
|
|
kept-new-versions 5 ; Keep 5 new versions
|
|
|
|
kept-old-versions 3 ; Keep 3 old versions
|
2017-11-15 04:15:29 +00:00
|
|
|
)
|
|
|
|
|
2020-03-02 08:15:05 +00:00
|
|
|
;; Configure user directory and file locations.
|
2020-08-02 23:44:26 +00:00
|
|
|
(defconst custom-backup-dir (concat user-emacs-directory "backups") "Preferred backup directory.")
|
2020-03-02 08:15:05 +00:00
|
|
|
(setq-default
|
|
|
|
custom-file (concat user-emacs-directory "custom.el") ; Use separate custom-vars file
|
|
|
|
backup-directory-alist `((".*" . ,custom-backup-dir)) ; Set backup file directory
|
|
|
|
auto-save-file-name-transforms `((".*" ,custom-backup-dir t)) ; Set autosave file directory
|
|
|
|
)
|
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;; Enable uniquify for better unique buffer names.
|
|
|
|
(require 'uniquify)
|
|
|
|
(setq
|
|
|
|
uniquify-buffer-name-style 'forward ; Show directory name before buffer name
|
|
|
|
uniquify-separator "/" ; Use a forward slash separator
|
|
|
|
uniquify-after-kill-buffer-p t ; Update buffer names after killing
|
|
|
|
uniquify-ignore-buffers-re "^\\*" ; Ignore special buffers
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Set the default styling rules to use.
|
2017-12-05 03:06:39 +00:00
|
|
|
(setq-default
|
2020-08-02 23:44:51 +00:00
|
|
|
indent-tabs-mode nil ; Don't use tabs for indentation
|
|
|
|
tab-width 4 ; Use 4 spaces for default by indentation
|
|
|
|
c-basic-offset 4 ; Same as above, but for C-like languages
|
|
|
|
c-default-style "bsd" ; Use BSD-style default styling rules for C-like languages
|
2018-03-07 06:58:26 +00:00
|
|
|
)
|
2019-11-02 00:08:23 +00:00
|
|
|
|
|
|
|
;; (OS-specific) Set the default working directory.
|
2020-07-21 04:18:02 +00:00
|
|
|
(if (eq system-type 'windows-nt)
|
2019-11-02 00:08:23 +00:00
|
|
|
(setq default-directory (getenv "USERPROFILE"))
|
|
|
|
(setq default-directory "~/"))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2020-10-26 04:13:41 +00:00
|
|
|
;; Disable the default terminal bell.
|
|
|
|
(setq ring-bell-function 'ignore)
|
|
|
|
|
2019-10-27 19:21:17 +00:00
|
|
|
;; Disable some unnecessary byte compilation warnings.
|
2019-04-12 08:35:58 +00:00
|
|
|
(setq byte-compile-warnings '(not
|
|
|
|
free-vars
|
|
|
|
unresolved
|
|
|
|
noruntime
|
|
|
|
lexical
|
|
|
|
make-local))
|
|
|
|
|
2019-10-27 19:21:17 +00:00
|
|
|
;; Set default buffer grouping in ibuffer
|
|
|
|
(setq ibuffer-saved-filter-groups
|
|
|
|
(quote (("default"
|
|
|
|
("Emacs" (or
|
2019-10-29 08:45:43 +00:00
|
|
|
(name . "^\\*.*\\*.*$")
|
2019-10-27 19:21:17 +00:00
|
|
|
(name . "^magit.*:.*$")))))))
|
|
|
|
(add-hook 'ibuffer-mode-hook (lambda () (ibuffer-switch-to-saved-filter-groups "default")))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Temporarily disable file handler checking during startup to save time.
|
|
|
|
(defvar temp--file-name-handler-alist file-name-handler-alist)
|
|
|
|
(setq file-name-handler-alist nil)
|
|
|
|
(add-hook 'emacs-startup-hook (lambda () (setq file-name-handler-alist temp--file-name-handler-alist)))
|
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;; Add a hook to trailing whitespaces before saving a file.
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Misc. Mode Config
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Enable Modes
|
|
|
|
(mapc (lambda (mode) (funcall mode 1))
|
|
|
|
'(
|
2019-04-12 08:35:58 +00:00
|
|
|
global-subword-mode ; Treats camel-case names as multiple words
|
|
|
|
global-auto-revert-mode ; Automatically revert buffers on file changes
|
|
|
|
global-hl-line-mode ; Highlight the currently-selected line
|
|
|
|
ido-mode ; Better directory and buffer completion
|
|
|
|
column-number-mode ; Show column number in the mode line
|
|
|
|
show-paren-mode ; Highlight matching parenthesis
|
|
|
|
size-indication-mode ; Show buffer size in the mode line
|
|
|
|
))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2018-07-14 03:07:07 +00:00
|
|
|
;; Disable Modes
|
|
|
|
(mapc (lambda (mode) (funcall mode 0))
|
2019-04-12 08:35:58 +00:00
|
|
|
`(
|
|
|
|
menu-bar-mode ; Disable the menu bar
|
|
|
|
))
|
|
|
|
|
|
|
|
;; Hooked Modes
|
|
|
|
(add-hook 'prog-mode-hook 'electric-pair-local-mode) ; Automatic delimiter pairing
|
2018-07-14 03:07:07 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;; Mode Configuration
|
|
|
|
(setq
|
2020-08-29 21:27:41 +00:00
|
|
|
ido-max-prospects 8 ; (ido-mode) - Limit max on-screen matches to 8 items
|
|
|
|
ido-max-window-height 10 ; (ido-mode) - Limit max minibuffer height to 10 lines
|
2017-11-15 04:15:29 +00:00
|
|
|
show-paren-delay 0.0 ; (show-paren-mode) - Parenthesis highlighting delay
|
|
|
|
visual-line-fringe-indicators t ; (visual-line-mode) - Shows fringe indicators for wrapping
|
|
|
|
)
|
|
|
|
|
2017-12-11 00:04:55 +00:00
|
|
|
;;====================
|
2020-07-21 00:01:35 +00:00
|
|
|
;; New Frame Config
|
2017-12-11 00:04:55 +00:00
|
|
|
;;====================
|
|
|
|
|
2020-07-21 00:01:35 +00:00
|
|
|
;; Define a function that will configure new Emacs frames.
|
2020-08-29 21:29:40 +00:00
|
|
|
(defvar init-file/theme-loaded nil "Whether or not the theme has been loaded yet.")
|
2020-07-21 00:01:35 +00:00
|
|
|
(defun configure-new-frame (frame)
|
|
|
|
"Configure new frame FRAME."
|
|
|
|
(when (display-graphic-p frame)
|
2019-04-12 08:35:58 +00:00
|
|
|
(select-frame frame)
|
2020-07-21 00:01:35 +00:00
|
|
|
(let ((winid (frame-parameter frame 'outer-window-id)))
|
|
|
|
(call-process-shell-command
|
|
|
|
(concat "xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark -id " winid)))
|
2019-04-12 08:35:58 +00:00
|
|
|
(tool-bar-mode 0)
|
2020-08-29 21:29:40 +00:00
|
|
|
(scroll-bar-mode 0)
|
2020-08-29 22:13:19 +00:00
|
|
|
(when (and
|
|
|
|
(daemonp)
|
|
|
|
(not init-file/theme-loaded))
|
2020-08-29 21:29:40 +00:00
|
|
|
(load-theme 'mood-one t)
|
|
|
|
(setq init-file/theme-loaded t))))
|
2020-07-21 00:01:35 +00:00
|
|
|
|
2020-08-29 21:29:40 +00:00
|
|
|
;; Define a function that will inhibit startup messages for new Emacs frames.
|
2020-07-21 00:01:35 +00:00
|
|
|
(defun inhibit-new-frame-message ()
|
|
|
|
"Inhibit startup messages in new frames."
|
|
|
|
(setq inhibit-message t)
|
|
|
|
(run-with-idle-timer 0 nil (lambda () (setq inhibit-message nil))))
|
|
|
|
|
|
|
|
;; Hook the frame configuration function into all newly-created frames.
|
|
|
|
(add-hook 'after-make-frame-functions #'configure-new-frame)
|
|
|
|
|
|
|
|
;; Hook the startup message inhibition function into all newly-created frames.
|
|
|
|
(add-hook 'server-after-make-frame-hook #'inhibit-new-frame-message)
|
|
|
|
|
|
|
|
;; Run for any already-existing frames
|
|
|
|
(mapc 'configure-new-frame (frame-list))
|
2017-12-11 00:04:55 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Package Manager
|
|
|
|
;;====================
|
|
|
|
|
2019-09-03 00:29:10 +00:00
|
|
|
;; Temporary fix for bugged package archive retrieval in Emacs 26.2.
|
|
|
|
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Configure the package manager.
|
|
|
|
(eval-and-compile
|
|
|
|
|
|
|
|
;; Configure the package manager and use-package settings.
|
|
|
|
(setq load-prefer-newer t
|
|
|
|
package-user-dir (concat user-emacs-directory "elpa")
|
|
|
|
package-check-signature nil
|
|
|
|
package-enable-at-startup nil
|
|
|
|
package--init-file-ensured t
|
|
|
|
use-package-always-ensure t
|
|
|
|
use-package-always-defer t)
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Make sure that the package directory exists to prevent errors.
|
|
|
|
(unless (file-directory-p package-user-dir)
|
|
|
|
(make-directory package-user-dir t))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Manually assemble the load-path during startup to save time.
|
|
|
|
(setq load-path (append load-path (directory-files package-user-dir t "^[^.]" t))))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Initialize the package management system (only at compile time).
|
|
|
|
(eval-when-compile
|
|
|
|
|
|
|
|
;; Require the package manager.
|
|
|
|
(require 'package)
|
|
|
|
|
|
|
|
;; Enable the MELPA repository.
|
|
|
|
(unless (assoc-default "melpa" package-archives)
|
|
|
|
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t))
|
|
|
|
|
|
|
|
;; Initialize the package manager.
|
|
|
|
(package-initialize)
|
2017-11-15 04:15:29 +00:00
|
|
|
(package-refresh-contents)
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Check for use-package. Install it if not already present.
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
(package-install 'use-package))
|
|
|
|
(require 'use-package))
|
2018-08-04 23:45:20 +00:00
|
|
|
|
|
|
|
;;====================
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Key Bindings
|
2018-08-04 23:45:20 +00:00
|
|
|
;;====================
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Custom Bindings:
|
2019-10-01 20:51:51 +00:00
|
|
|
;; [ F6 ] -> Toggle line-wrapping
|
|
|
|
;; [ F7 ] -> Toggle linum-mode/display-line-numbers-mode
|
|
|
|
;; [ F10 ] -> (Overwritten) Open the menubar in a minibuffer
|
|
|
|
;; [ C-z ] -> (Overwritten) Undo (and don't suspend, thanks)
|
2020-07-21 04:19:49 +00:00
|
|
|
;; [ C-c o ] -> Focus on minibuffer window
|
|
|
|
;; [ C-c r ] -> Revert buffer without confirmation
|
2020-07-21 04:20:50 +00:00
|
|
|
;; [ C-c s ] -> Open scratch buffer in the current window
|
2020-07-21 04:19:49 +00:00
|
|
|
;; [ C-c RET ] -> Open terminal in the current window
|
2019-10-01 20:51:51 +00:00
|
|
|
;; [ C-x C-b ] -> (Overwritten) Invoke ibuffer
|
|
|
|
;; [ M-n / M-p ] -> Scroll up/down by one line
|
|
|
|
;; [ C-M-n / C-M-p ] -> Move forward/back by one paragraph
|
|
|
|
;; [ C-c C-<i,j,k,l> ] -> Focus on the window in <direction>
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;; Require bind-key. (Bundled with use-package)
|
|
|
|
(require 'bind-key)
|
|
|
|
|
|
|
|
(defun switch-to-minibuffer-window ()
|
|
|
|
"Switch to the minibuffer window (if active)."
|
2018-08-04 23:46:46 +00:00
|
|
|
(interactive)
|
2019-04-12 08:35:58 +00:00
|
|
|
(when (active-minibuffer-window)
|
|
|
|
(select-window (active-minibuffer-window))))
|
2018-08-04 23:46:46 +00:00
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
(defun revert-buffer-no-confirm ()
|
|
|
|
"Revert the current buffer without confirmation."
|
|
|
|
(interactive)
|
|
|
|
(if (not (buffer-modified-p))
|
|
|
|
(revert-buffer :ignore-auto :noconfirm)
|
|
|
|
(when (yes-or-no-p "The contents of this buffer have been modified. Really revert? ")
|
|
|
|
(revert-buffer :ignore-auto :noconfirm))))
|
|
|
|
|
2020-07-22 00:25:39 +00:00
|
|
|
(defun open-scratch-buffer ()
|
|
|
|
"Open the scratch buffer, (re)creating it if not present."
|
2020-07-21 04:20:50 +00:00
|
|
|
(interactive)
|
|
|
|
(if (get-buffer "*scratch*")
|
|
|
|
(switch-to-buffer "*scratch*")
|
|
|
|
(progn
|
|
|
|
(switch-to-buffer (get-buffer-create "*scratch*"))
|
|
|
|
(lisp-interaction-mode))))
|
|
|
|
|
2020-07-21 04:19:49 +00:00
|
|
|
(defun open-default-shell ()
|
2020-10-17 22:12:40 +00:00
|
|
|
"Opens the default system shell in a terminal emulator, opening existing shell session if present."
|
2020-07-21 04:19:49 +00:00
|
|
|
(interactive)
|
2020-10-17 22:12:40 +00:00
|
|
|
(if (get-buffer "*terminal*")
|
|
|
|
(switch-to-buffer "*terminal*")
|
|
|
|
(progn
|
|
|
|
(ansi-term shell-file-name)
|
|
|
|
(rename-buffer "*terminal*"))))
|
2020-07-21 04:19:49 +00:00
|
|
|
|
2019-10-01 20:51:51 +00:00
|
|
|
;; Set up all custom bindings (non-package-specific)
|
2019-10-10 01:27:05 +00:00
|
|
|
(bind-keys ([f6] . visual-line-mode)
|
|
|
|
([f7] . display-line-numbers-mode)
|
|
|
|
([f10] . tmm-menubar)
|
|
|
|
("C-z" . undo)
|
|
|
|
("C-c o" . switch-to-minibuffer-window)
|
|
|
|
("C-c r" . revert-buffer-no-confirm)
|
2020-07-22 00:25:39 +00:00
|
|
|
("C-c s" . open-scratch-buffer)
|
2020-07-21 04:19:49 +00:00
|
|
|
("C-c RET" . open-default-shell)
|
2019-10-10 01:27:05 +00:00
|
|
|
("C-x C-b" . ibuffer)
|
|
|
|
("M-n" . scroll-up-line)
|
|
|
|
("M-p" . scroll-down-line)
|
|
|
|
("C-M-n" . forward-paragraph)
|
|
|
|
("C-M-p" . backward-paragraph))
|
|
|
|
(bind-keys* ("C-c C-i" . windmove-up)
|
|
|
|
("C-c C-k" . windmove-down)
|
|
|
|
("C-c C-j" . windmove-left)
|
|
|
|
("C-c C-l" . windmove-right))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;;====================
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Init File
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
|
2020-07-21 00:16:31 +00:00
|
|
|
(defun init-file/open-init-file ()
|
|
|
|
"Opens the init file in a buffer."
|
|
|
|
(interactive)
|
|
|
|
(find-file user-init-file))
|
|
|
|
|
2019-10-01 06:25:36 +00:00
|
|
|
(defun init-file/download-latest-init-file ()
|
2019-04-12 08:35:58 +00:00
|
|
|
"Download the latest init file from jessieh.net."
|
|
|
|
(interactive)
|
|
|
|
(when (yes-or-no-p "Download latest init file from jessieh.net? ")
|
|
|
|
(message "Updating init file...")
|
2019-04-16 13:10:29 +00:00
|
|
|
(url-copy-file "https://jessieh.net/emacs" (concat user-emacs-directory "init.el") t)
|
2019-10-01 06:25:36 +00:00
|
|
|
(init-file/byte-compile-init-file)))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2019-10-01 06:25:36 +00:00
|
|
|
(defun init-file/byte-compile-init-file ()
|
2019-04-12 08:35:58 +00:00
|
|
|
"Byte compile the init file."
|
|
|
|
(interactive)
|
|
|
|
(save-restriction
|
|
|
|
(message "Byte-compiling init file...")
|
|
|
|
(byte-compile-file (concat user-emacs-directory "init.el"))))
|
|
|
|
|
2019-10-01 06:25:36 +00:00
|
|
|
(defun init-file/refresh-packages ()
|
|
|
|
"Refresh all packages that have been configured for use in the init file."
|
2019-04-12 08:35:58 +00:00
|
|
|
(interactive)
|
2019-10-01 06:25:36 +00:00
|
|
|
(when (yes-or-no-p "Redownload and refresh packages? ")
|
|
|
|
(message "Refreshing packages...")
|
2019-04-12 08:35:58 +00:00
|
|
|
(delete-directory package-user-dir t)
|
2019-10-01 06:25:36 +00:00
|
|
|
(init-file/byte-compile-init-file)))
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;; Make sure that this init file is byte-compiled whenever it changes.
|
|
|
|
(if (file-newer-than-file-p
|
|
|
|
(concat user-emacs-directory "init.el")
|
|
|
|
(concat user-emacs-directory "init.elc"))
|
2019-10-01 06:25:36 +00:00
|
|
|
(add-hook 'emacs-startup-hook 'init-file/byte-compile-init-file))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;;========================================
|
|
|
|
;;
|
2019-04-12 08:35:58 +00:00
|
|
|
;; THEME CONFIGURATION
|
2017-11-15 04:15:29 +00:00
|
|
|
;;
|
|
|
|
;;========================================
|
|
|
|
|
2018-07-14 03:04:45 +00:00
|
|
|
;;====================
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Default Face
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Set up styling for the default face.
|
|
|
|
(set-face-attribute 'default nil
|
2020-10-26 04:13:26 +00:00
|
|
|
:family "Fira Code Regular"
|
2020-10-17 22:29:37 +00:00
|
|
|
:height 100)
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Theme
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load "mood-one"
|
2019-06-06 09:57:55 +00:00
|
|
|
(use-package mood-one-theme
|
2020-08-29 22:13:19 +00:00
|
|
|
:after
|
|
|
|
(solaire-mode)
|
2019-06-06 09:57:55 +00:00
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
2020-09-02 18:11:04 +00:00
|
|
|
(mood-one-theme-arrow-fringe-bmp-enable)
|
2019-06-06 09:57:55 +00:00
|
|
|
(setq diff-hl-fringe-bmp-function #'mood-one-theme-diff-hl-fringe-bmp-function)
|
2019-10-01 06:26:07 +00:00
|
|
|
(eval-after-load 'flycheck #'mood-one-theme-flycheck-fringe-bmp-enable)
|
2019-10-10 01:27:38 +00:00
|
|
|
(eval-after-load 'flymake #'mood-one-theme-flymake-fringe-bmp-enable)
|
2020-07-16 21:37:31 +00:00
|
|
|
(eval-after-load 'neotree #'mood-one-theme-neotree-configuration-enable)
|
|
|
|
(load-theme 'mood-one t))
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Mode-Line
|
2018-07-14 03:04:45 +00:00
|
|
|
;;====================
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Load "mood-line"
|
|
|
|
(use-package mood-line
|
|
|
|
:demand
|
|
|
|
t
|
2018-07-14 03:04:45 +00:00
|
|
|
:config
|
2019-06-06 10:47:25 +00:00
|
|
|
(mood-line-mode))
|
2019-04-12 08:35:58 +00:00
|
|
|
|
2020-08-29 21:29:40 +00:00
|
|
|
;;====================
|
|
|
|
;; Solaire-Mode
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load "solaire-mode"
|
|
|
|
(use-package solaire-mode
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:custom
|
|
|
|
(solaire-mode-themes-to-face-swap '("mood-one"))
|
|
|
|
(solaire-mode-remap-modeline nil)
|
|
|
|
(solaire-mode-real-buffer-fn
|
|
|
|
(lambda ()
|
|
|
|
(and (not (string-equal major-mode "neotree-mode"))
|
|
|
|
(buffer-name (buffer-base-buffer))
|
|
|
|
(not (string-match "\*Echo Area" (buffer-name (buffer-base-buffer)))))))
|
|
|
|
:hook
|
|
|
|
(change-major-mode-hook . turn-on-solaire-mode)
|
|
|
|
(term-mode . (lambda () (set-face-background 'term (face-background 'solaire-default-face))))
|
|
|
|
:config
|
|
|
|
(solaire-global-mode t))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;========================================
|
|
|
|
;;
|
|
|
|
;; EXTERNAL PACKAGE CONFIGURATION
|
|
|
|
;;
|
|
|
|
;;========================================
|
2018-07-14 03:04:45 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Language Modes
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Currently Supported:
|
2020-04-29 03:17:15 +00:00
|
|
|
;; Lua, PHP, Rust, Fish, C#, Dart, Kotlin, GDScript
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;; Load Lua Mode
|
|
|
|
;; (Associated files: .lua)
|
|
|
|
(use-package lua-mode
|
|
|
|
:mode
|
|
|
|
("\\.lua\\'" . lua-mode))
|
|
|
|
|
2020-07-21 00:16:51 +00:00
|
|
|
;; Load Web Mode
|
2020-08-29 21:28:17 +00:00
|
|
|
;; (Associated files: .php, .html)
|
2020-10-17 22:12:33 +00:00
|
|
|
;; (In js-jsx-mode: .jsx)
|
2020-07-21 00:16:51 +00:00
|
|
|
(use-package web-mode
|
2020-07-21 00:30:34 +00:00
|
|
|
:custom
|
|
|
|
(web-mode-markup-indent-offset 2)
|
2020-07-21 00:55:27 +00:00
|
|
|
(web-mode-enable-auto-quoting nil)
|
2017-11-15 04:15:29 +00:00
|
|
|
:mode
|
2020-07-21 00:16:51 +00:00
|
|
|
(("\\.php\\'" . web-mode)
|
2020-08-29 21:28:17 +00:00
|
|
|
("\\.html\\'" . web-mode)
|
2020-10-17 22:12:33 +00:00
|
|
|
("\\.jsx\\'" . js-jsx-mode)))
|
|
|
|
|
|
|
|
;; Load TypeScript mode
|
|
|
|
;; (Associated files: .ts, .tsx)
|
|
|
|
(use-package typescript-mode
|
|
|
|
:mode
|
|
|
|
(("\\.tsx?\\'" . typescript-mode)))
|
2020-07-21 00:16:51 +00:00
|
|
|
|
|
|
|
;; Load JSON Mode
|
|
|
|
;; (Associated files: .json)
|
|
|
|
(use-package json-mode
|
|
|
|
:mode
|
|
|
|
("\\.json\\'" . json-mode))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;; Load Rust Mode
|
|
|
|
;; (Associated files: .rs)
|
|
|
|
(use-package rust-mode
|
|
|
|
:mode
|
2019-04-12 08:35:58 +00:00
|
|
|
("\\.rs\\'" . rust-mode))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;; Load Fish Mode
|
|
|
|
;; (Associated files: .fish)
|
|
|
|
(use-package fish-mode
|
|
|
|
:mode
|
|
|
|
("\\.fish\\'" . fish-mode))
|
|
|
|
|
2019-10-30 08:25:51 +00:00
|
|
|
;; Load C Sharp Mode
|
|
|
|
;; (Associated files: .cs)
|
|
|
|
(use-package csharp-mode
|
|
|
|
:mode
|
2019-11-04 00:03:33 +00:00
|
|
|
("\\.cs\\'" . csharp-mode))
|
2019-10-30 08:25:51 +00:00
|
|
|
|
2020-03-10 10:09:23 +00:00
|
|
|
;; Load Dart Mode
|
|
|
|
;; (Associated files: .dart)
|
|
|
|
(use-package dart-mode
|
|
|
|
:mode
|
|
|
|
("\\.dart\\'" . dart-mode))
|
|
|
|
|
|
|
|
;; Load Kotlin Mode
|
|
|
|
;; (Associated files: .kt)
|
|
|
|
(use-package kotlin-mode
|
|
|
|
:mode
|
|
|
|
("\\.kt\\'" . kotlin-mode))
|
|
|
|
|
2020-04-29 03:17:15 +00:00
|
|
|
;; Load GDScript Mode
|
|
|
|
;; (Associated files: .gd, .tscn)
|
|
|
|
(use-package gdscript-mode
|
|
|
|
:mode
|
|
|
|
("\\.gd\\'" . gdscript-mode)
|
|
|
|
("\\.tscn\\'" . gdscript-mode))
|
|
|
|
|
2020-07-16 23:49:09 +00:00
|
|
|
;;====================
|
|
|
|
;; LSP Mode (Language Server Support)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load LSP Mode
|
2020-10-17 22:12:33 +00:00
|
|
|
;; Associated languages: HTML, JavaScript, TypeScript, CSS, JSON, GDScript, Rust
|
2020-07-16 23:49:09 +00:00
|
|
|
(use-package lsp-mode
|
|
|
|
:hook
|
2020-07-21 00:58:07 +00:00
|
|
|
(web-mode . lsp-deferred)
|
2020-07-16 23:49:09 +00:00
|
|
|
(js-mode . lsp-deferred)
|
2020-10-17 22:12:33 +00:00
|
|
|
(typescript-mode . lsp-deferred)
|
2020-08-29 21:28:17 +00:00
|
|
|
(css-mode . lsp-deferred)
|
2020-07-21 00:16:51 +00:00
|
|
|
(json-mode . lsp-deferred)
|
2020-07-16 23:49:09 +00:00
|
|
|
(gdscript-mode . lsp-deferred)
|
|
|
|
(rust-mode . lsp-deferred)
|
2020-08-29 21:28:17 +00:00
|
|
|
:custom
|
|
|
|
(lsp-signature-auto-activate nil)
|
|
|
|
(lsp-signature-render-documentation nil)
|
|
|
|
(lsp-eldoc-hook nil)
|
2020-07-16 23:49:09 +00:00
|
|
|
:commands
|
|
|
|
(lsp
|
|
|
|
lsp-deferred))
|
|
|
|
|
2020-08-29 21:28:17 +00:00
|
|
|
;; Load LSP UI
|
|
|
|
(use-package lsp-ui
|
|
|
|
:custom
|
|
|
|
(lsp-ui-imenu-enable nil)
|
|
|
|
(lsp-ui-peek-enable t)
|
|
|
|
(lsp-ui-peek-always-show t)
|
|
|
|
(lsp-ui-doc-enable nil)
|
|
|
|
(lsp-ui-doc-max-width 50)
|
|
|
|
(lsp-ui-doc-max-height 10)
|
2020-08-31 20:04:42 +00:00
|
|
|
(lsp-ui-doc-position 'top)
|
|
|
|
(lsp-ui-doc-alignment 'window)
|
2020-08-29 21:28:17 +00:00
|
|
|
(lsp-ui-doc-header t)
|
|
|
|
(lsp-ui-doc-include-signature t)
|
|
|
|
:config
|
|
|
|
(setq lsp-ui-doc-border (face-background 'lsp-ui-doc-background))
|
|
|
|
:bind
|
|
|
|
(:map lsp-ui-mode-map
|
2020-08-30 20:11:28 +00:00
|
|
|
("M-," . lsp-ui-doc-mode)
|
2020-08-29 21:28:17 +00:00
|
|
|
("M-." . lsp-ui-peek-find-definitions)
|
|
|
|
("M-?" . lsp-ui-peek-find-references)))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Package-Lint (Elisp Package Linter)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Package-Lint
|
|
|
|
(use-package package-lint
|
|
|
|
:commands
|
|
|
|
(package-lint-current-buffer))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; FlyCheck (Syntax Checker)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings
|
|
|
|
;; [ C-c e ] -> Open error list window
|
|
|
|
|
|
|
|
;; Load FlyCheck
|
|
|
|
(use-package flycheck
|
2019-04-12 08:35:58 +00:00
|
|
|
:hook
|
|
|
|
(prog-mode . flycheck-mode)
|
|
|
|
(c++-mode-hook . (lambda () (setq flycheck-clang-standard "c++17")))
|
2020-08-29 21:28:17 +00:00
|
|
|
:config
|
|
|
|
(advice-add 'flycheck-eslint-config-exists-p :override (lambda() t))
|
2019-10-01 06:26:29 +00:00
|
|
|
:custom
|
|
|
|
(flycheck-python-flake8-executable "flake8")
|
|
|
|
(flycheck-python-pylint-executable "pylint")
|
|
|
|
(flycheck-python-mypy-executable "mypy")
|
2017-11-15 04:15:29 +00:00
|
|
|
:bind
|
|
|
|
("C-c e" . flycheck-list-errors))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; [Elisp Packages]
|
|
|
|
;; Load FlyCheck-Package
|
|
|
|
(use-package flycheck-package
|
|
|
|
:after
|
|
|
|
(flycheck)
|
|
|
|
:hook
|
|
|
|
(flycheck-mode-hook . flycheck-package-setup))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Company (Autocompletion)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Company
|
|
|
|
(use-package company
|
2019-10-01 20:52:00 +00:00
|
|
|
:defer
|
|
|
|
2
|
2019-04-12 08:35:58 +00:00
|
|
|
:config
|
|
|
|
(global-company-mode)
|
|
|
|
:custom
|
2020-03-02 08:18:13 +00:00
|
|
|
(company-idle-delay 0.3)
|
|
|
|
(company-dabbrev-downcase nil))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;; [Lua]
|
|
|
|
;; Load Company-Lua
|
|
|
|
(use-package company-lua
|
2019-04-12 08:35:58 +00:00
|
|
|
:after
|
|
|
|
(company)
|
|
|
|
:hook
|
|
|
|
(lua-mode my-lua-mode-company-init))
|
|
|
|
|
|
|
|
;; [PHP]
|
|
|
|
;; Load Company-PHP
|
|
|
|
(use-package company-php
|
|
|
|
:after
|
|
|
|
(company))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2020-08-30 20:11:11 +00:00
|
|
|
;;====================
|
|
|
|
;; yasnippet (Snippet Insertion/Completion)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load yasnippet
|
|
|
|
(use-package yasnippet
|
|
|
|
:demand
|
|
|
|
t
|
2020-08-31 20:04:42 +00:00
|
|
|
:custom
|
|
|
|
(yas-also-auto-indent-first-line t)
|
|
|
|
(yas-also-indent-empty-lines t)
|
2020-08-30 20:11:11 +00:00
|
|
|
:config
|
|
|
|
(yas-global-mode t))
|
|
|
|
|
2020-07-16 23:48:55 +00:00
|
|
|
;;====================
|
|
|
|
;; Projectile (Project Interaction)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ C-c p ... ] -> Projectile key map prefix
|
|
|
|
|
|
|
|
;; Load Projectile
|
|
|
|
(use-package projectile
|
2020-07-17 00:03:19 +00:00
|
|
|
:demand
|
2020-07-16 23:48:55 +00:00
|
|
|
t
|
|
|
|
:config
|
|
|
|
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
|
|
|
|
(projectile-mode t))
|
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Smex (M-x Autocompletion)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ M-x ] (Overwritten) -> Open Smex
|
|
|
|
|
|
|
|
;; Load Smex
|
|
|
|
(use-package smex
|
2019-04-12 08:35:58 +00:00
|
|
|
:config
|
|
|
|
(smex-initialize)
|
2020-08-29 21:27:41 +00:00
|
|
|
:custom
|
|
|
|
(smex-prompt-string "Cmd: ")
|
2017-11-15 04:15:29 +00:00
|
|
|
:bind
|
|
|
|
("M-x" . smex))
|
|
|
|
|
2018-03-07 06:56:17 +00:00
|
|
|
;;====================
|
|
|
|
;; Undo Tree
|
|
|
|
;;====================
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Bindings:
|
|
|
|
;; [ C-x u ] (Overwritten) -> Open Undo Tree
|
|
|
|
|
2018-03-07 06:56:17 +00:00
|
|
|
;; Load Undo Tree
|
|
|
|
(use-package undo-tree
|
2019-04-12 08:35:58 +00:00
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
|
|
|
(global-undo-tree-mode))
|
2018-03-07 06:56:17 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Diff-HL (VCS Diff Highlighting)
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;; Load Diff-HL
|
|
|
|
(use-package diff-hl
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:hook
|
|
|
|
(diff-hl-mode-hook . diff-hl-flydiff-mode)
|
|
|
|
:config
|
|
|
|
(global-diff-hl-mode))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Neotree (File Browser)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
2020-08-29 21:28:52 +00:00
|
|
|
;; [ C-c w ] -> (Overwritten) Do nothing (neotree-mode)
|
2019-04-12 08:35:58 +00:00
|
|
|
;; [ F5 ] -> (Overwritten) Do nothing (neotree-mode)
|
|
|
|
;; [ F6 ] -> (Overwritten) Do nothing (neotree-mode)
|
|
|
|
;; [ F7 ] -> (Overwritten) Do nothing (neotree-mode)
|
|
|
|
;; [ F8 ] -> Toggle Neotree window
|
|
|
|
;; [ C-c t ] -> Switch to Neotree window
|
|
|
|
|
|
|
|
;; Load Neotree
|
|
|
|
(use-package neotree
|
|
|
|
:custom
|
2020-07-21 00:47:57 +00:00
|
|
|
(neo-confirm-create-file #'off-p)
|
|
|
|
(neo-confirm-create-directory #'off-p)
|
2019-04-12 08:35:58 +00:00
|
|
|
(neo-show-updir-line nil)
|
2020-09-02 18:10:45 +00:00
|
|
|
(neo-smart-open t)
|
2019-04-12 08:35:58 +00:00
|
|
|
(neo-window-width 30)
|
|
|
|
(neo-theme 'nerd)
|
2017-11-15 04:15:29 +00:00
|
|
|
:config
|
2019-04-12 08:35:58 +00:00
|
|
|
(defun neotree--setup (&rest _)
|
|
|
|
(make-local-variable 'auto-hscroll-mode)
|
|
|
|
(setq mode-line-format nil
|
|
|
|
line-spacing 3
|
|
|
|
truncate-lines t
|
|
|
|
word-wrap nil
|
2019-10-10 01:27:38 +00:00
|
|
|
auto-hscroll-mode nil))
|
2019-04-12 08:35:58 +00:00
|
|
|
(add-hook 'neo-after-create-hook #'neotree--setup)
|
2017-11-15 04:15:29 +00:00
|
|
|
:bind
|
2019-04-12 08:35:58 +00:00
|
|
|
(([f8] . neotree-toggle)
|
|
|
|
("C-c t" . neotree)
|
|
|
|
:map neotree-mode-map
|
2020-08-29 21:28:52 +00:00
|
|
|
("C-c w" . (lambda () (interactive) nil))
|
2019-04-12 08:35:58 +00:00
|
|
|
([f5] . (lambda () (interactive) nil))
|
|
|
|
([f6] . (lambda () (interactive) nil))
|
|
|
|
([f7] . (lambda () (interactive) nil))))
|
2017-11-15 04:15:29 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Resize-Window (Resizing)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ C-c w ] -> Toggle window sizing mode
|
|
|
|
|
|
|
|
;; Load Resize-Window
|
|
|
|
(use-package resize-window
|
|
|
|
:bind
|
|
|
|
("C-c w" . resize-window))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Writeroom-Mode
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ F5 ] -> Toggle
|
|
|
|
;; [ F6 ] -> (Overwritten) Decrease writeroom width (writeroom-mode)
|
|
|
|
;; [ F7 ] -> (Overwritten) Increase writeroom width (writeroom-mode)
|
|
|
|
|
|
|
|
;; Load Writeroom-Mode
|
|
|
|
(use-package writeroom-mode
|
|
|
|
:custom
|
|
|
|
(writeroom-global-effects nil)
|
|
|
|
(writeroom-maximize-window nil)
|
|
|
|
(writeroom-fringes-outside-margins nil)
|
|
|
|
:bind
|
|
|
|
(([f5] . writeroom-mode)
|
|
|
|
:map writeroom-mode-map
|
|
|
|
([f6] . writeroom-decrease-width)
|
|
|
|
([f7] . writeroom-increase-width)))
|
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Multiple-Cursors
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ C-> ] -> Mark next like this
|
|
|
|
;; [ C-< ] -> Mark previos like this
|
|
|
|
;; [ C-c C-> || C-c C-< ] -> Mark all like this
|
|
|
|
|
|
|
|
;; Load Multiple-Cursors
|
|
|
|
(use-package multiple-cursors
|
2019-04-12 08:35:58 +00:00
|
|
|
:custom
|
|
|
|
(mc/always-run-for-all nil)
|
2017-11-15 04:15:29 +00:00
|
|
|
:bind
|
|
|
|
(("C->" . mc/mark-next-like-this)
|
|
|
|
("C-<" . mc/mark-previous-like-this)
|
|
|
|
("C-c C->" . mc/mark-all-like-this)
|
|
|
|
("C-c C-<" . mc/mark-all-like-this)))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Rainbow-Delimiters (Delimiter Highlighting)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Rainbow-Delimiters
|
|
|
|
(use-package rainbow-delimiters
|
|
|
|
:hook
|
|
|
|
(prog-mode . rainbow-delimiters-mode))
|
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; HL-Todo (TODO/FIXME Highlighting)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load HL-Todo
|
|
|
|
(use-package hl-todo
|
|
|
|
:custom
|
|
|
|
(hl-todo-keyword-faces
|
|
|
|
'(("TODO" . ,(face-foreground 'hl-todo))
|
|
|
|
("DEBUG" . ,(face-foreground 'hl-todo))
|
|
|
|
("FIXME" . ,(face-foreground 'hl-todo))
|
|
|
|
("HACK" . ,(face-foreground 'hl-todo))))
|
|
|
|
:hook
|
|
|
|
(prog-mode . hl-todo-mode))
|
2017-11-16 00:38:23 +00:00
|
|
|
|
2017-11-15 04:15:29 +00:00
|
|
|
;;====================
|
|
|
|
;; Magit (Git Interface)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Bindings:
|
|
|
|
;; [ C-c g ] -> Open Magit window
|
|
|
|
|
|
|
|
;; Load Magit
|
|
|
|
(use-package magit
|
2019-04-12 08:35:58 +00:00
|
|
|
:bind
|
2019-10-01 06:28:55 +00:00
|
|
|
("C-c g" . magit-status)
|
|
|
|
:custom
|
|
|
|
(magit-completing-read-function 'magit-ido-completing-read))
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;; [TODO Listing]
|
|
|
|
;; Load Magit-Todos
|
|
|
|
(use-package magit-todos
|
|
|
|
:hook
|
|
|
|
(magit-mode-hook))
|
|
|
|
|
2019-10-01 06:28:55 +00:00
|
|
|
;;====================
|
|
|
|
;; Crm-Custom (Additional Ido Compat.)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Crm-Custom
|
|
|
|
(use-package crm-custom
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
|
|
|
(crm-custom-mode 1))
|
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Ido-Completing-Read+ (Ido Everywhere)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Ido-Completing-Read+
|
|
|
|
(use-package ido-completing-read+
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
|
|
|
(ido-ubiquitous-mode t))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Ido-Vertical-Mode (Vertical Completions)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Ido-Vertical-Mode
|
|
|
|
(use-package ido-vertical-mode
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
|
|
|
(ido-vertical-mode t)
|
|
|
|
:custom
|
2020-08-29 21:27:41 +00:00
|
|
|
(ido-vertical-define-keys 'C-n-C-p-up-down-left-right)
|
2020-08-31 20:04:42 +00:00
|
|
|
(ido-vertical-indicator " →"))
|
2019-04-12 08:35:58 +00:00
|
|
|
|
|
|
|
;;====================
|
|
|
|
;; Flx-Ido (Ido Fuzzy Matching)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Flx-Ido
|
|
|
|
(use-package flx-ido
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:config
|
|
|
|
(flx-ido-mode t))
|
|
|
|
|
2020-08-29 21:27:41 +00:00
|
|
|
;;====================
|
|
|
|
;; Swiper (Inline Search w/ Overview)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
(use-package swiper
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:custom
|
|
|
|
(ivy-dynamic-exhibit-delay-ms 250)
|
|
|
|
(ivy-count-format "")
|
|
|
|
(swiper-include-line-number-in-search t)
|
|
|
|
:bind
|
|
|
|
("C-s" . swiper)
|
|
|
|
("C-r" . swiper-backward))
|
|
|
|
|
2019-04-12 08:35:58 +00:00
|
|
|
;;====================
|
|
|
|
;; Anzu (Search Mode Info Display)
|
|
|
|
;;====================
|
|
|
|
|
|
|
|
;; Load Anzu
|
|
|
|
(use-package anzu
|
|
|
|
:demand
|
|
|
|
t
|
|
|
|
:custom
|
|
|
|
(anzu-cons-mode-line-p nil)
|
|
|
|
:config
|
|
|
|
(global-anzu-mode t)
|
|
|
|
:bind
|
|
|
|
(("<remap> <query-replace>" . 'anzu-query-replace)
|
|
|
|
("<remap> <query-replace-regexp>" . 'anzu-query-replace-regexp)))
|
|
|
|
|
|
|
|
;;========================================
|
|
|
|
;;
|
|
|
|
;; END OF INIT FILE
|
|
|
|
;;
|
|
|
|
;;========================================
|
|
|
|
|
|
|
|
;;; init.el ends here
|