Browse Source

Theming, switch to isearch modifications

* Moved diminish calls down to the bottom of the file so that they
don't miss any modes. Added auto-revert-mode
* Use isearch instead of swiper. Swiper was too slow. I bound keys so
that isearch feels like swiper though
* Made an unfortunate hack regarding desktops to ensure that when you
switch desktops you keep your theme. Desktops will no longer restore
frame configurations though
* Avy faces are now theme-appropriate, which looks nice
* Fixed closing parentheses being ridiculously slow (especially when
using multiple-cursors). Matching parens are now always displayed
instead of only displayed for a certain amount of time
Macoy Madson 4 years ago
  1. 76


@ -95,6 +95,8 @@
;; - Find file in dir (basically ido find file but actually useful; how does it work?)
;; - Macoy-Codesearch should have something for whole word searches as well as sanitizing regex symbols
;;*- IMPORTANT Codesearch ignore autogenerated files (maybe during building index?)
;; - Isearch: Make reversing the isearch not find the same thing again
;; - Isearch: Always put cursor at end of search (try searching backwards; it'll put it at the front)
;; Criticism improvements:
;; - [DONE] Select word at point
@ -148,6 +150,11 @@
;; make cursor movement stop in between camelCase words. (don't)
(global-subword-mode 0)
;; Always highlight matching parenthesis. This is a necessity when using multiple-cursors because
;; if show-paren-mode is disabled, typing multiple closing parentheses takes a long time due to
;; the pause to highlight after each one
(show-paren-mode 1)
;; Themes are generally safe
(setq custom-safe-themes t)
@ -174,10 +181,17 @@
;; save/restore opened files
(desktop-save-mode 1)
;; This is needed only for theming. Desktop frames hold on to color values for some reason. We don't
;; care too much about losing our frame configurations so this is okay
(setq desktop-restore-frames nil)
;; Automatically revert buffers if file changes underneath (unless there are unsaved changes)
(global-auto-revert-mode 1)
;; Hide toolbar (only needed on Linux?)
(tool-bar-mode -1)
(toggle-scroll-bar -1)
;; Set cursor to I-beam
(modify-all-frames-parameters (list (cons 'cursor-type '(bar . 2))))
@ -329,18 +343,6 @@
;; (delight 'abbrev-mode " Abv" "Abbrev")
(setq projectile-mode-line '(:eval (format " [%s]" (projectile-project-name))))
;; Hide these modes completely (for a more minimal look)
(require 'diminish)
(diminish 'abbrev-mode)
(diminish 'my-keys-minor-mode)
(diminish 'yas-minor-mode)
(diminish 'auto-complete-mode)
(diminish 'visual-line-mode)
(diminish 'org-indent-mode)
;; The following might not do anything/are unnecessary
(diminish 'adaptive-wrap-prefix-mode)
(diminish 'wrap-region-mode)
;; Instead of wrapping at character, wrap at word. This slightly improves readability
(setq visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))
(global-visual-line-mode 1)
@ -431,6 +433,7 @@
;; Multiple cursors
(require 'multiple-cursors)
;; Make sure to change this in my-keys-minor-mode-map too
(global-set-key (kbd "C-d") 'mc/mark-next-like-this)
;;(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
@ -716,6 +719,27 @@
(global-set-key (kbd "C-\\") 'macoy-tags-search)
(global-set-key (kbd "C-|") 'tags-loop-continue)
;; Isearch customizations
;; Go to next/previous result with arrow keys
(define-key isearch-mode-map (kbd "<up>") 'isearch-repeat-backward)
(define-key isearch-mode-map (kbd "<down>") 'isearch-repeat-forward)
;; Used for expanding the search by words
(define-key isearch-mode-map (kbd "C-'") 'isearch-yank-word-or-char)
;; If marked, use swiper to search mark
(defun macoy-isearch-search-mark ()
"If marked, use isearch to search mark. Otherwise, isearch normally"
(call-interactively 'isearch-forward)
(when (use-region-p)
;; (isearch-search)
;; (call-interactively 'isearch-forward)
(isearch-yank-string (buffer-substring (region-beginning) (region-end)))
(global-set-key (kbd "C-f") 'macoy-isearch-search-mark)
;; Swiper customizations
;; If marked, use swiper to search mark
(defun macoy-swiper-search-mark ()
"If marked, use swiper to search mark. Otherwise, open swiper normally"
@ -739,7 +763,7 @@
;; Use swiper for search instead of isearch (use e.g. space to fuzzy search)
(global-set-key (kbd "C-f") 'macoy-swiper-search-mark)
;; (global-set-key (kbd "C-f") 'macoy-swiper-search-mark)
(global-set-key (kbd "M-f") 'macoy-swiper-all-search-mark)
@ -1353,6 +1377,32 @@ static char *gnus-pointer[] = {
;; TODO: Should this be (setq base16-distinct-fringe-background nil) instead?
(set-face-background 'fringe (face-background 'default))
;; Make avy faces beautiful
;; Note that we swap foreground and background to emulate the inverse-video setting (there's probably
;;; a cleaner way of doing this, but oh well)
(set-face-foreground 'avy-lead-face (face-background 'match))
(set-face-background 'avy-lead-face (face-foreground 'match))
(set-face-foreground 'avy-lead-face-0 (face-background 'match))
(set-face-background 'avy-lead-face-0 (face-foreground 'match))
(set-face-foreground 'avy-lead-face-1 (face-background 'match))
(set-face-background 'avy-lead-face-1 (face-foreground 'match))
(set-face-foreground 'avy-lead-face-2 (face-background 'match))
(set-face-background 'avy-lead-face-2 (face-foreground 'match))
;; Hide these modes completely (for a more minimal look)
;; Diminish things down here so that we're sure we catch all modes
(require 'diminish)
(diminish 'abbrev-mode)
(diminish 'my-keys-minor-mode)
(diminish 'yas-minor-mode)
(diminish 'auto-complete-mode)
(diminish 'visual-line-mode)
(diminish 'org-indent-mode)
;; The following might not do anything/are unnecessary
(diminish 'adaptive-wrap-prefix-mode)
(diminish 'wrap-region-mode)
(diminish 'auto-revert-mode)
;; Macoy custom overrides end