From ad7530599a9913bb4fc21632e4050b3fad939ad2 Mon Sep 17 00:00:00 2001 From: Levi Olson Date: Fri, 13 Sep 2019 17:14:24 -0500 Subject: [PATCH] Switch to Ivy/Counsel/Swiper; Cleaning up odd-n-ends --- init.el | 3 + lisp/custom-binds.el | 1 + lisp/custom-early-init.el | 3 +- lisp/custom-exwm.el | 138 ++++++++++++ lisp/custom-functions.el | 3 +- lisp/custom-init.el | 6 +- lisp/custom-ligatures.el | 370 +++++++++++++++++++++++++++++++++ lisp/custom-package-setup.el | 5 +- lisp/custom-packages-config.el | 17 ++ lisp/custom-packages.el | 292 +++++++++++++++++++------- 10 files changed, 758 insertions(+), 80 deletions(-) create mode 100644 lisp/custom-exwm.el create mode 100644 lisp/custom-ligatures.el create mode 100644 lisp/custom-packages-config.el diff --git a/init.el b/init.el index 6a5d4d9..df7469b 100644 --- a/init.el +++ b/init.el @@ -11,7 +11,10 @@ (require 'custom-binds) (require 'custom-init) (require 'custom-functions) +(require 'custom-exwm) +(require 'custom-ligatures) (require 'custom-packages) +(require 'custom-packages-config) (server-start) diff --git a/lisp/custom-binds.el b/lisp/custom-binds.el index 45640c0..0d15c44 100644 --- a/lisp/custom-binds.el +++ b/lisp/custom-binds.el @@ -12,6 +12,7 @@ (bind-key "" 'eshell) (bind-key "" 'ansi-term) +(bind-key "C-c r" '(lambda () (interactive) (load-file user-init-file))) (provide 'custom-binds) ;;; custom-binds.el ends here diff --git a/lisp/custom-early-init.el b/lisp/custom-early-init.el index 8889391..fdbb0b3 100644 --- a/lisp/custom-early-init.el +++ b/lisp/custom-early-init.el @@ -17,6 +17,7 @@ Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)") (setq safe-local-variable-values (quote ( (eval org-content 2) + (eval org-content 3) (whitespace-line-column . 120) ))) @@ -25,7 +26,7 @@ Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)") (add-hook 'after-init-hook `(lambda () (setq file-name-handler-alist file-name-handler-alist-old - gc-cons-threshold 800000 + gc-cons-threshold 20000000 gc-cons-percentage 0.1) (garbage-collect)) t) diff --git a/lisp/custom-exwm.el b/lisp/custom-exwm.el new file mode 100644 index 0000000..6e1f28f --- /dev/null +++ b/lisp/custom-exwm.el @@ -0,0 +1,138 @@ +;;; custom-exwm --- Provide EXWM specific config + +;;; Commentary: + +;;; Code: + +(defun leo/which-session () + "Return the current Xsession name. i.e. i3, exwm, etc..." + (shell-command-to-string "cat ~/.dmrc | tail -n1 | awk -F'=' '{print $2}' | tr -d \"\n\"")) + +(when (string-equal "exwm" (eval (leo/which-session))) + ;; https://github.com/ch11ng/exwm + (use-package exwm + :ensure t + :demand t + :bind + ("" . (lambda() (interactive) (shell-command-to-string "amixer sset Master 2%-"))) + ("" . (lambda() (interactive) (shell-command-to-string "amixer sset Master 2%+"))) + ("" . (lambda() (interactive) (shell-command-to-string "amixer sset Master 0"))) + ("" . (lambda() (interactive) (shell-command-to-string "playerctl play-pause"))) + ("" . (lambda() (interactive) (shell-command-to-string "playerctl next"))) + ("" . (lambda() (interactive) (shell-command-to-string "playerctl prev"))) + :custom + (exwm-workspace-show-all-buffers t "Show all buffers regardless of current workspace.") + (exwm-workspace-warp-cursor t "Move cursor when window focus changes.") + :config + (require 'exwm-config) + (exwm-config-default) + + (display-time-mode 1) + (display-battery-mode 1) + + (require 'exwm-systemtray) + (exwm-systemtray-enable) + + (require 'exwm-randr) + (defun leo/exwm-change-screen-hook () + (let ((xrandr-output-regexp "\n\\([^ ]+\\) connected ") + default-output) + (with-temp-buffer + (call-process "xrandr" nil t nil) + (goto-char (point-min)) + (re-search-forward xrandr-output-regexp nil 'noerror) + (setq default-output (match-string 1)) + (forward-line) + (if (not (re-search-forward xrandr-output-regexp nil 'noerror)) + (call-process "xrandr" nil nil nil "--output" default-output "--auto") + (call-process + "xrandr" nil nil nil + "--output" default-output "--primary" "--auto" + "--output" (match-string 1) "--off") + (setq exwm-randr-workspace-output-plist (list 0 default-output)))))) + (add-hook 'exwm-randr-screen-change-hook 'leo/exwm-change-screen-hook) + (exwm-randr-enable) + + ;; (start-process "polybar" "*polybar*" "~/scripts/polybar/polybar_launch") + + (setq exwm-workspace-index-map (lambda (i) (number-to-string (1+ i)))) + + (dolist (k '(XF86AudioLowerVolume + XF86AudioRaiseVolume + XF86AudioMude + pause + XF86AudioPrev + XF86AudioNext)) + (push k exwm-input-prefix-keys)) + + (setq exwm-input-simulation-keys + '( + ;; movement + ([?\C-b] . [left]) + ([?\M-b] . [C-left]) + ([?\C-f] . [right]) + ([?\M-f] . [C-right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ([?\C-d] . [delete]) + ([?\C-k] . [S-end delete]) + ;; cut/paste. + ([?\C-w] . [?\C-x]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]) + ;; search + ([?\C-s] . [?\C-f]))) + + (setq exwm-input-global-keys + `( + ;; Bind "s-r" to exit char-mode and fullscreen mode. + ([?\s-r] . exwm-reset) + ;; Super + R to restart exwm + ([8388690] . exwm-restart) + + ;; Bind "s-w" to switch workspace interactively. + ([?\s-w] . exwm-workspace-switch) + + ;; Bind "s-!" to "s-^" to switch to a workspace by its index. + ([8388641] . (lambda ()(interactive) (exwm-workspace-switch-create 1))) + ([8388672] . (lambda ()(interactive) (exwm-workspace-switch-create 2))) + ([8388643] . (lambda ()(interactive) (exwm-workspace-switch-create 3))) + ([8388644] . (lambda ()(interactive) (exwm-workspace-switch-create 4))) + ([8388645] . (lambda ()(interactive) (exwm-workspace-switch-create 5))) + ([8388702] . (lambda ()(interactive) (exwm-workspace-switch-create 6))) + ([8388649] . (lambda ()(interactive) (exwm-workspace-switch-create 0))) + + ;; Open ST in other window + ([s-return] . (lambda ()(interactive) (split-window-right) (other-window) (start-process "" nil "st"))) + + ;; Bind "s-" to "slock", a simple X display locker. + ;; ([s-f2] . (lambda () + ;; (interactive) + ;; (start-process "" nil "/usr/bin/slock"))))) + ) + ) + ) + + (use-package exwm-edit + :ensure t + :config + (defun ag-exwm/on-exwm-edit-compose () + (spacemacs/toggle-visual-line-navigation-on) + (funcall 'markdown-mode)) + + ;; (add-hook 'exwm-edit-compose-hook 'ag-exwm/on-exwm-edit-compose)) + ) + + ;; https://github.com/emacsmirror/dmenu + (use-package dmenu + :ensure t + :bind ("s-SPC" . dmenu) + ) + ) + +(provide 'custom-exwm) +;;; custom-exwm.el ends here diff --git a/lisp/custom-functions.el b/lisp/custom-functions.el index c214e37..9bd5a92 100644 --- a/lisp/custom-functions.el +++ b/lisp/custom-functions.el @@ -85,7 +85,7 @@ (leo/jump-to-symbol)) (defun leo/last-car (list) - "Return only the item in the last position of a list." + "Return only the item in the last position of a LIST." (car (last list)) ) (defun leo/get-package-from-url (url) @@ -100,6 +100,5 @@ (message mode)) ) - (provide 'custom-functions) ;;; custom-functions.el ends here diff --git a/lisp/custom-init.el b/lisp/custom-init.el index 037c5e5..78ffef0 100644 --- a/lisp/custom-init.el +++ b/lisp/custom-init.el @@ -24,6 +24,8 @@ (global-auto-revert-mode t) ;; Highlight the current line (when window-system (global-hl-line-mode t)) +;; Global line numbering +(global-linum-mode 0) ;; Show the column number after the line number (i.e. 50:57) (column-number-mode t) ;; C-c | to undo|redo window changes like adding buffers. @@ -33,6 +35,9 @@ ;; Pretty Symbols (when window-system (global-prettify-symbols-mode t)) +;; Meta-b better defaults testStringHereToTestBelow_Setting +(global-subword-mode 1) + ;; Indent w/spaces only (setq indent-tabs-mode nil) ;; Prevent stale elisp bytecode @@ -62,6 +67,5 @@ "Display startup echo area message." (message "Initialized in %s" (emacs-init-time))) - (provide 'custom-init) ;;; custom-init.el ends here diff --git a/lisp/custom-ligatures.el b/lisp/custom-ligatures.el new file mode 100644 index 0000000..b822b28 --- /dev/null +++ b/lisp/custom-ligatures.el @@ -0,0 +1,370 @@ +;;; custom-ligatures --- PragmataPro specific ligatures + +;;; Commentary: +;; Enable ligatures without prettify-symbols + +;; All ligatures (for testing) + +;; [ERROR] +;; [DEBUG] +;; [INFO] +;; [WARN] +;; [WARNING] +;; [ERR] +;; [FATAL] +;; [TRACE] +;; !! +;; != +;; !== +;; !!! +;; !≡ +;; !≡≡ +;; !> +;; #( +;; #_ +;; #{ +;; #? +;; #> +;; ## +;; %= +;; %> +;; &% +;; && +;; &* +;; &+ +;; &- +;; &/ +;; &= +;; &&& +;; &> +;; *** +;; *= +;; */ +;; *> +;; ++ +;; +++ +;; += +;; +> +;; ++= +;; -- +;; -< +;; -<< +;; -= +;; -> +;; ->> +;; --- +;; --> +;; -+- +;; -\/ +;; .. +;; ... +;; ..< +;; .> +;; .~ +;; .= +;; /* +;; // +;; /> +;; /= +;; /== +;; /// +;; /** +;; :: +;; := +;; :≡ +;; :> +;; :=> +;; <$> +;; <* +;; <*> +;; <+> +;; <- +;; << +;; <<< +;; <<= +;; <= +;; <=> +;; <> +;; <|> +;; <<- +;; <| +;; <=< +;; <~ +;; <~~ +;; <<~ +;; <$ +;; <+ +;; +;; <@> +;; <#> +;; <%> +;; <^> +;; <&> +;; +;; <.> +;; +;; <\> +;; <"> +;; <:> +;; <~> +;; <**> +;; <<^ +;; +;; +;; |=> +;; |==> +;; ~= +;; ~> +;; ~~> +;; ~>> +;; "> + +;;; Code: + +(defconst pragmatapro-fontlock-keywords-alist + (mapcar (lambda (regex-char-pair) + `(,(car regex-char-pair) + (0 (prog1 () + (compose-region (match-beginning 1) + (match-end 1) + ,(concat (list ?\C-i) + (list (decode-char 'ucs (cadr regex-char-pair))))))))) + '(("\\(\\[ERROR\\]\\)" #XE380) + ("\\(\\[DEBUG\\]\\)" #XE381) + ("\\(\\[INFO\\]\\)" #XE382) + ("\\(\\[WARN\\]\\)" #XE383) + ("\\(\\[WARNING\\]\\)" #XE384) + ("\\(\\[ERR\\]\\)" #XE385) + ("\\(\\[FATAL\\]\\)" #XE386) + ("\\(\\[TRACE\\]\\)" #XE387) + ("\\(!!\\)" #XE900) + ("\\(!=\\)" #XE901) + ("\\(!==\\)" #XE902) + ("\\(!!!\\)" #XE903) + ("\\(!≡\\)" #XE904) + ("\\(!≡≡\\)" #XE905) + ("[^<]\\(!>\\)" #XE906) + ("\\(#(\\)" #XE920) + ("\\(#_\\)" #XE921) + ("\\(#{\\)" #XE922) + ("\\(#\\?\\)" #XE923) + ("[^<]\\(#>\\)" #XE924) + ("\\(##\\)" #XE925) + ("\\(%=\\)" #XE930) + ("[^<]\\(%>\\)" #XE931) + ("\\(&%\\)" #XE940) + ("\\(&&\\)" #XE941) + ("\\(&\\*\\)" #XE942) + ("\\(&\\+\\)" #XE943) + ("\\(&-\\)" #XE944) + ("\\(&/\\)" #XE945) + ("\\(&=\\)" #XE946) + ("\\(&&&\\)" #XE947) + ("[^<]\\(&>\\)" #XE948) + ("\\(\\*\\*\\*\\)" #XE960) + ("\\(\\*=\\)" #XE961) + ("\\(\\*/\\)" #XE962) + ("[^<]\\(\\*>\\)" #XE963) + ("\\(\\+\\+\\)" #XE970) + ("\\(\\+\\+\\+\\)" #XE971) + ("[^\\+]\\(\\+=\\)" #XE972) + ("[^<]\\(\\+>\\)" #XE973) + ("\\(\\+\\+=\\)" #XE974) + ("\\(--\\)" #XE980) + ("[^-]\\(-<\\)" #XE981) + ("\\(-<<\\)" #XE982) + ("\\(-=\\)" #XE983) + ("[^|]\\(->\\)" #XE984) + ("[^|]\\(->>\\)" #XE985) + ("\\(---\\)" #XE986) + ("\\(-->\\)" #XE987) + ("\\(-\\+-\\)" #XE988) + ("\\(-\\\\/\\)" #XE989) + ("[^\\^]\\(\\.\\.\\)" #XE990) + ("\\(\\.\\.\\.\\)" #XE991) + ("\\(\\.\\.<\\)" #XE992) + ("\\(\\.>\\)" #XE993) + ("\\(\\.~\\)" #XE994) + ("\\(\\.=\\)" #XE995) + ("\\(/\\*\\)" #XE9A0) + ("\\(//\\)" #XE9A1) + ("[^<]\\(/>\\)" #XE9A2) + ("[^=]\\(/=\\)" #XE9A3) + ("\\(/==\\)" #XE9A4) + ("\\(///\\)" #XE9A5) + ("\\(/\\*\\*\\)" #XE9A6) + ("\\(::\\)" #XE9B0) + ("\\(:=\\)" #XE9B1) + ("[^≡]\\(:≡\\)" #XE9B2) + ("\\(:>\\)" #XE9B3) + ("\\(:=>\\)" #XE9B4) + ("\\(<\\*\\)" #XE9C1) + ("\\(<\\*>\\)" #XE9C2) + ("[^<]\\(<-\\)" #XE9C4) + ("[^-]\\(<<\\)" #XE9C5) + ("\\(<<<\\)" #XE9C6) + ("\\(<<=\\)" #XE9C7) + ("[^<]\\(<=\\)" #XE9C8) + ("\\(<=>\\)" #XE9C9) + ("\\(<>\\)" #XE9CA) + ("\\(<<-\\)" #XE9CC) + ("\\(<|\\)" #XE9CD) + ("\\(<|>\\)" #XE9CB) + ("\\(<=<\\)" #XE9CE) + ("[^<]\\(<~\\)" #XE9CF) + ("\\(<~~\\)" #XE9D0) + ("\\(<<~\\)" #XE9D1) + ("\\(<\\$\\)" #XE9D2) + ("\\(<\\$>\\)" #XE9C0) + ("\\(<\\+\\)" #XE9D3) + ("\\(<\\+>\\)" #XE9C3) + ("\\(<~>\\)" #XE9E0) + ("\\(<\\*\\*>\\)" #XE9E1) + ("\\(<<\\^\\)" #XE9E2) + ("\\(\\)" #XE9D4) + ("\\(<@\\)" #XE9E4) + ("\\(<#\\)" #XE9E5) + ("\\(<#>\\)" #XE9D6) + ("\\(<%\\)" #XE9E6) + ("\\(<%>\\)" #XE9D7) + ("[^<]\\(<\\^\\)" #XE9E7) + ("\\(<&\\)" #XE9E8) + ("\\(<&>\\)" #XE9D9) + ("\\(<\\?\\)" #XE9E9) + ("\\(<\\.\\)" #XE9EA) + ("\\(<\\.>\\)" #XE9DB) + ("\\(\\)" #XE9DC) + ("\\(<\\\\\\)" #XE9EC) + ("\\(<\"\\)" #XE9ED) + ("\\(<\">\\)" #XE9DE) + ("\\(<:\\)" #XE9EE) + ("\\(<:>\\)" #XE9DF) + ("\\(<->\\)" #XE9EF) + ("\\(\\)" #XEA66) + ("\\(|=>\\)" #XEA67) + ("\\(|==>\\)" #XEA68) + ("\\(~=\\)" #XEA70) + ("[^~<]\\(~>\\)" #XEA71) + ("\\(~~>\\)" #XEA72) + ("\\(~>>\\)" #XEA73) + ("[^<]\\(\">\\)" #XEA90)))) + +(defun add-pragmatapro-symbol-keywords () + "Add the symbols to font-lock." + (font-lock-add-keywords nil pragmatapro-fontlock-keywords-alist)) + +(add-hook 'prog-mode-hook + #'add-pragmatapro-symbol-keywords) +(add-hook 'emacs-lisp-mode-hook + #'add-pragmatapro-symbol-keywords) + +(provide 'custom-ligatures) +;;; custom-ligatures.el ends here diff --git a/lisp/custom-package-setup.el b/lisp/custom-package-setup.el index 1a79c13..2b95ea6 100644 --- a/lisp/custom-package-setup.el +++ b/lisp/custom-package-setup.el @@ -51,7 +51,10 @@ (bind-keys :prefix-map my-ctrl-x-b-map :prefix "C-x b") (bind-keys :prefix-map my-ctrl-x-ctrl-l-map - :prefix "C-x C-l")) + :prefix "C-x C-l") + (bind-keys :prefix-map my-ctrl-c-h-map + :prefix "C-c h") + ) (provide 'custom-package-setup) ;;; custom-package-setup.el ends here diff --git a/lisp/custom-packages-config.el b/lisp/custom-packages-config.el new file mode 100644 index 0000000..dd3d5a1 --- /dev/null +++ b/lisp/custom-packages-config.el @@ -0,0 +1,17 @@ +;;; custom-packages-config --- Provide all the config that doesn't fit in use-package + +;;; Commentary: + +;;; Code: + + +;; Diminish +(diminish 'eldoc-mode) +(diminish 'subword-mode) + +;; Dired +(setq list-directory-brief-switches "-al") + + +(provide 'custom-packages-config) +;;; custom-packages-config.el ends here diff --git a/lisp/custom-packages.el b/lisp/custom-packages.el index f21251b..7f0a454 100644 --- a/lisp/custom-packages.el +++ b/lisp/custom-packages.el @@ -33,26 +33,15 @@ ;;; Code: -;; https://github.com/jwiegley/use-package/blob/master/bind-key.el -(use-package bind-key - :ensure t - :bind - ("C-" . leo/tidy) - ("C-;" . leo/comment-or-uncomment-region-or-line) - ("C-c e" . leo/find-user-init-file) - ("M-q" . leo/kill-this-buffer-unless-scratch) - ("C-c d" . leo/duplicate-thing) - ("M-n" . leo/jump-to-next-symbol) - ("M-p" . leo/jump-to-prev-symbol) - ("M-u" . upcase-dwim) - ("M-c" . capitalize-dwim) - ("M-l" . downcase-dwim) - ) - ;; https://github.com/myrjola/diminish.el (use-package diminish :ensure t - :demand t) + :demand t + ) + +;; https://elpa.gnu.org/packages/delight.html +(use-package delight + :ensure t) ;; https://github.com/winterTTr/ace-jump-mode (use-package ace-jump-mode @@ -62,6 +51,7 @@ ;; https://github.com/abo-abo/ace-window (use-package ace-window + :disabled :ensure t :bind ([remap other-window] . ace-window) @@ -70,6 +60,7 @@ ;; https://github.com/hlissner/emacs-doom-themes (use-package doom-themes + :disabled :ensure t :config (load-theme 'doom-one t)) @@ -81,8 +72,16 @@ :config (load-theme 'base16-onedark t)) +;; https://github.com/NicolasPetton/zerodark-theme +(use-package zerodark-theme + :ensure t + :config + (load-theme 'zerodark t) + (zerodark-setup-modeline-format)) + ;; https://github.com/Malabarba/beacon (use-package beacon + :diminish :ensure t :commands beacon-mode :demand t @@ -107,14 +106,18 @@ :defer 5 :commands (engine/get-query engine/execute-search) :config + ;; C-x / to start (defengine google "https://www.google.com/search?q=%s" :keybinding "g") (defengine duckduckgo "https://duckduckgo.com/?q=%s" :keybinding "d") + (defengine melpa "https://melpa.org/#/?q=%s" + :keybinding "m") (engine-mode 1)) ;; https://github.com/coldnew/linum-relative (use-package linum-relative + :disabled :ensure t :config (linum-relative-mode)) @@ -124,19 +127,19 @@ :ensure t :hook (prog-mode . rainbow-delimiters-mode)) +;; rainbow-mode +(use-package rainbow-mode + :ensure t + :hook prog-mode) + ;; M-x all-the-icons-install-fonts (use-package all-the-icons :ensure t) -;; https://github.com/tarsius/minions -(use-package minions - :ensure t - :config - (minions-mode 1)) - (use-package doom-modeline + :disabled :ensure t - :after (all-the-icons minions) + :after (all-the-icons) :hook (after-init . doom-modeline-mode) :commands (doom-modeline-def-modeline doom-modeline-set-modeline) :init @@ -146,8 +149,8 @@ (setq doom-modeline-minor-modes (featurep 'minions)) :config (doom-modeline-def-modeline 'leo/custom-modeline - '(bar matches buffer-info remote-host buffer-position parrot selection-info) - '(misc-info minor-modes input-method buffer-encoding major-mode process vcs checker " ")) + '(bar matches buffer-info remote-host buffer-position parrot selection-info) + '(misc-info minor-modes input-method buffer-encoding major-mode process vcs checker " ")) (defun leo/setup-custom-doom-modeline () (doom-modeline-set-modeline 'leo/custom-modeline 'default)) (add-hook 'doom-modeline-mode-hook 'leo/setup-custom-doom-modeline) @@ -160,10 +163,10 @@ :init (setq dashboard-items '((recents . 6) (bookmarks . 5) - ;; (projects . 5) + (projects . 5) (agenda . 5))) (setq dashboard-center-content t) - (setq dashboard-banner-logo-title "Let's begin...") + (setq dashboard-banner-logo-title "Let's do this...") (setq dashboard-startup-banner 1) (setq dashboard-show-shortcuts t) (setq show-week-agenda-p t) @@ -171,34 +174,45 @@ :config (dashboard-setup-startup-hook)) -(use-package helm +;; counsel +(use-package counsel :ensure t - :commands (helm-M-x helm-buffers-list helm-find-files helm-candidate-number-at-point) :demand t :bind - ("M-x" . helm-M-x) - ("C-c b" . helm-buffers-list) - ("C-x C-f" . helm-find-files) + ;; ("M-x" . counsel-M-x) + ("C-c k" . counsel-rg) + ("C-x C-f" . counsel-find-file) + ("C-x f" . counsel-recentf) + ("C-x C-d" . counsel-dired) + ("C-x p" . counsel-package) + ("C-x b" . counsel-bookmark) + ("C-x c" . counsel-colors-web) + ("C-c C-d" . counsel-org-capture) + + ;; Describe Replacements + ("C-h f" . counsel-describe-function) + ("C-h v" . counsel-describe-variable) + ("C-h b" . counsel-descbinds) + + ("M-y" . counsel-yank-pop) + ;; Ivy + ("C-c b" . ivy-switch-buffer) + ("C-c c" . ivy-resume) + + ;; Swiper + ("C-s" . swiper) :config - (declare-function helm-candidate-number-at-point "helm.el") + (ivy-mode 1) ) -;; https://github.com/emacsorphanage/helm-swoop -(use-package helm-swoop +;; https://github.com/DarwinAwardWinner/amx +(use-package amx :ensure t - :after (helm) - :bind - ("C-s" . helm-swoop) - :config - ;; If you prefer fuzzy matching - (setq helm-swoop-use-fuzzy-match t)) - -;; https://github.com/syohex/emacs-helm-ag -(use-package helm-ag - :ensure t - :after (helm) - :bind - ("C-c k" . helm-ag)) + :demand t + :commands (execute-extended-command) + :after (counsel) + :init + (amx-mode 1)) ;; https://github.com/magnars/expand-region.el (use-package expand-region @@ -207,6 +221,18 @@ ("C-@" . er/expand-region) ("C-#" . er/contract-region)) +;; https://github.com/thanhvg/emacs-howdoyou +(use-package howdoyou + :ensure t + :commands (howdoyou-query howdoyou-next-link howdoyou-previous-link howdoyou-go-back-to-first-link howdoyou-reload-link) + :bind + ("C-c h q" . howdoyou-query) + ("C-c h n" . howdoyou-next-link) + ("C-c h p" . howdoyou-previous-link) + ("C-c h f" . howdoyou-go-back-to-first-link) + ("C-c h r" . howdoyou-reload-link) + ) + ;; https://github.com/magnars/multiple-cursors.el (use-package multiple-cursors :ensure t @@ -218,6 +244,7 @@ ;; https://github.com/joodland/bm (use-package bm + :disabled :ensure t :demand t :bind (("C-x b b" . bm-toggle) @@ -257,8 +284,14 @@ ;; link (use-package elfeed :ensure t - :commands (elfeed) - :bind ("C-x C-l e" . elfeed) + :commands (elfeed elfeed-search-set-filter) + :bind + (("C-x C-l e" . elfeed) + :map elfeed-search-mode-map + ("a" . (lambda () (interactive) (elfeed-search-set-filter ""))) + ("e" . (lambda () (interactive) (elfeed-search-set-filter "+emacs"))) + ("d" . (lambda () (interactive) (elfeed-search-set-filter "+daily"))) + ("x" . (lambda () (interactive) (elfeed-search-set-filter "xkcd")))) :init (setq elfeed-feeds '( @@ -271,7 +304,13 @@ ("http://planet.emacsen.org/atom.xml" emacs) ("http://feeds.feedburner.com/XahsEmacsBlog" emacs) ("http://emacs.stackexchange.com/feeds" emacs) - ))) + ("https://www.google.com/alerts/feeds/13353713273807811484/2710948715805064535" tesla) + ("https://www.google.com/alerts/feeds/13353713273807811484/17638090915837343269" pixel4) + ("https://www.google.com/alerts/feeds/13353713273807811484/14416938028701328804" stadia) + )) + :config + (elfeed-update) + ) ;; https://github.com/rmuslimov/browse-at-remote (use-package browse-at-remote @@ -279,19 +318,20 @@ ;; https://github.com/justbur/emacs-which-key (use-package which-key + :diminish :ensure t :config (which-key-setup-minibuffer) (which-key-mode)) -;; https://github.com/lewang/fic-mode +;; TODO https://github.com/lewang/fic-mode (use-package fic-mode :ensure t - :hook prog-mode - :init - (defface fic-face '((t :foreground "red" :weight bold)) "Specify face used for fic-mode highlighting" :group 'basic-faces) - (defface fic-author-face '((t :foreground "red" :underline t)) "Specify face used for fic-mode highlighting" :group 'basic-faces) - ) + :hook (prog-mode js-mode javascript-mode) + :commands fic-mode + :custom-face + (fic-face ((t :foreground "red" :weight bold))) + (fic-author-face ((t :foreground "red" :underline t)))) ;; https://github.com/joaotavora/yasnippet (use-package yasnippet @@ -310,7 +350,17 @@ :ensure t :defer 5 :commands (company-mode) - :hook (prog-mode . company-mode)) + :hook (prog-mode . company-mode) + :bind + (:map company-active-map + ("M-n" . nil) + ("M-p" . nil) + ("C-n" . company-select-next) + ("C-p" . company-select-previous)) + :config + (setq company-idle-delay 0.1) + (setq company-minimum-prefix-length 4) + ) ;; https://github.com/pashky/restclient.el (use-package restclient @@ -326,17 +376,38 @@ (use-package magit :commands magit-status :ensure t - :init - (setq magit-completing-read-function 'helm-completing-read-default-handler) :bind ("C-x g" . magit-status) ("C-c g" . magit-status)) ;; https://github.com/bbatsov/projectile (use-package projectile + :delight '(:eval (concat " [" (projectile-project-name) "]")) :ensure t :bind-keymap ("C-c p" . projectile-command-map) + :init + ;; (setq projectile-mode-line-prefix " P") + (setq projectile-completion-system 'ivy) + :config + (projectile-mode 1) + ;; (projectile-register-project-type 'npm '("package.json") + ;; :compile "npm install" + ;; :test "npm test" + ;; :run "npm start" + ;; :test-suffix ".test") + ) + +;; https://github.com/rudolfolah/angularjs-mode +(use-package angular-mode + :ensure t + :defer t + ) + +;; https://github.com/magnars/angular-snippets.el +(use-package angular-snippets + :ensure t + :defer t ) ;; https://github.com/magit/git-modes @@ -380,6 +451,7 @@ ;; https://github.com/flycheck/flycheck (use-package flycheck + :diminish :ensure t :preface (defvar flycheck-emacs-lisp-load-path) @@ -438,21 +510,42 @@ (verbatim . "%s")) ) :config + (when (version<= "9.2" (org-version)) + (require 'org-tempo)) (org-babel-do-load-languages 'org-babel-load-languages '((js . t) (shell . t) (emacs-lisp . t))) - (add-to-list 'org-structure-template-alist - (list "e" (concat "#+BEGIN_SRC emacs-lisp :results silent\n" - "\n" - "#+END_SRC"))) - (add-to-list 'org-structure-template-alist - (list "j" (concat "#+BEGIN_SRC js :cmd \"/usr/local/bin/babel-node\" :results output code\n" - "\n" - "#+END_SRC"))) - (add-to-list 'org-structure-template-alist - (list "r" (concat "#+BEGIN_SRC restclient :results raw\n" - "\n" - "#+END_SRC"))) + (setq org-structure-template-alist + '(("r" . "src restclient :results raw") + ("j" . "src js :cmd \"/usr/local/bin/babel-node\" :results output code") + ("e" . "src emacs-lisp :results silent") + ("a" . "export ascii") + ("c" . "center") + ("C" . "comment") + ("E" . "export") + ("h" . "export html") + ("l" . "export latex") + ("q" . "quote") + ("s" . "src") + ("v" . "verse"))) + (defconst checkbox-fontlock-keywords-alist + (mapcar (lambda (regex-char-pair) + `(,(car regex-char-pair) + (0 (prog1 () + (compose-region (match-beginning 1) + (match-end 1) + ,(concat (list ?\C-i) + (list (decode-char 'ucs (cadr regex-char-pair))))))))) + '(("\\(\\[ \\]\\)" #XF096);2B1C + ("\\(\\[-\\]\\)" #XF147);29C7;F458 + ("\\(\\[X\\]\\)" #XF046);2BBD + ))) + + (defun add-checkbox-symbol-keywords () + "Add checkbox font to font-lock." + (font-lock-add-keywords nil checkbox-fontlock-keywords-alist)) + + (add-hook 'org-mode-hook 'add-checkbox-symbol-keywords) ) ;; https://github.com/sabof/org-bullets @@ -484,8 +577,6 @@ "* %a\n%?\n") ("d" "store link w/drawer" entry (file+olp org-default-notes-file "Links" "Unfiled") "* %?\n%l\n:COPIED_TEXT:\n %i\n:END:\n") - ("f" "dotfile" entry (file+headline "~/Dropbox/Org/dotfiles.org" "Other") - "* %?\n:PROPERTIES:\n:CUSTOM_ID: %(org-id-get-create)\n:END:\n") )) ) @@ -495,6 +586,57 @@ :defer t :commands (org-link-minor-mode)) +;; https://github.com/marsmining/ox-twbs +(use-package ox-twbs + :ensure t + :demand t + :after (org)) + +;; https://github.com/hniksic/emacs-htmlize +(use-package htmlize + :ensure t + :defer 5) + +;; https://github.com/jwiegley/use-package/blob/master/bind-key.el +(use-package bind-key + :ensure t + :bind + ("C-" . leo/tidy) + ("C-;" . leo/comment-or-uncomment-region-or-line) + ("C-c e" . leo/find-user-init-file) + ("M-q" . leo/kill-this-buffer-unless-scratch) + ("C-c d" . leo/duplicate-thing) + ("M-n" . leo/jump-to-next-symbol) + ("M-p" . leo/jump-to-prev-symbol) + ("M-u" . upcase-dwim) + ("M-c" . capitalize-dwim) + ("M-l" . downcase-dwim) + ) + +;; https://github.com/nflath/sudo-edit +(use-package sudo-edit + :ensure t + :defer t + :commands (sudo-edit)) + +;; https://github.com/yuya373/emacs-slack +(use-package slack + :disabled + :commands (slack-start) + :init + (setq slack-buffer-emojify t) + (setq slack-prefer-current-team t) + :config + (advice-add 'slack-counts-update :override #'ignore) + (slack-register-team + :name "EC-Vlocity" + :default t + :client-id "noversion-1568385126.809" + :client-secret "" + :token "xoxc-538115686545-538717634210-755920422288-984144199ae517b9b68ddf733cbedbd18f77ec9e93788f7bb9725e476b67d5c1" ;;xoxp-538115686545-538717634210-753084048993-466bb2259d72a129118bd4d97b8c80b2" + :subscribed-channels '(general vlocity) + :full-and-display-names t)) + (provide 'custom-packages) ;;; custom-packages.el ends here