Skip to content

Instantly share code, notes, and snippets.

@DogLooksGood

DogLooksGood/.emacs

Last active Mar 1, 2021
Embed
What would you like to do?
Meow dot emacs
(setq package-archives '(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(require 'package)
(package-initialize)
(setq package-selected-packages
'(modus-themes
selectrum
meow
company
smartparens
magit))
(unless package-archive-contents
(package-refresh-contents))
(package-install-selected-packages)
(defun meow-setup ()
(setq meow-cheatsheet-layout meow-cheatsheet-layout-dvp)
(meow-leader-define-key
'("." . meow-find-ref)
'("," . meow-pop-marker)
'("e" . meow-eval-last-exp)
'("o" . delete-other-windows)
'("w" . other-window)
'("q" . delete-window)
'("-" . split-window-below)
'("\\" . split-window-right))
(meow-normal-define-key
'("*" . meow-expand-0)
'("=" . meow-expand-9)
'("!" . meow-expand-8)
'("[" . meow-expand-7)
'("]" . meow-expand-6)
'("{" . meow-expand-5)
'("+" . meow-expand-4)
'("}" . meow-expand-3)
'(")" . meow-expand-2)
'("(" . meow-expand-1)
'("1" . digit-argument)
'("2" . digit-argument)
'("3" . digit-argument)
'("4" . digit-argument)
'("5" . digit-argument)
'("6" . digit-argument)
'("7" . digit-argument)
'("8" . digit-argument)
'("9" . digit-argument)
'("0" . digit-argument)
'("-" . negative-argument)
'(";" . meow-reverse)
'("," . meow-inner-of-thing)
'("." . meow-bounds-of-thing)
'("<" . meow-beginning-of-thing)
'(">" . meow-end-of-thing)
'("a" . meow-append)
'("A" . meow-open-below)
'("b" . meow-back-word)
'("B" . meow-back-symbol)
'("c" . meow-change)
'("C" . meow-change-save)
'("d" . meow-delete)
'("e" . meow-line)
'("f" . meow-find)
'("F" . meow-find-expand)
'("g" . meow-cancel)
'("G" . meow-goto-line)
'("h" . meow-left)
'("H" . meow-left-expand)
'("i" . meow-insert)
'("I" . meow-open-above)
'("j" . meow-join)
'("J" . delete-indentation)
'("k" . meow-kill)
'("l" . meow-till)
'("L" . meow-till-expand)
'("m" . meow-mark-word)
'("M" . meow-mark-symbol)
'("n" . meow-next)
'("N" . meow-next-expand)
'("o" . meow-block)
'("O" . meow-block-expand)
'("p" . meow-prev)
'("P" . meow-prev-expand)
'("q" . meow-grab)
'("r" . meow-replace)
'("R" . meow-replace-save)
'("s" . meow-search)
'("S" . meow-pop-search)
'("t" . meow-right)
'("T" . meow-right-expand)
'("u" . meow-undo)
'("v" . meow-visit)
'("w" . meow-next-word)
'("W" . meow-next-symbol)
'("x" . meow-save)
'("y" . meow-yank)
'("z" . meow-pop)
'("Z" . meow-pop-all-selection)
'("&" . meow-query-replace)
'("%" . meow-query-replace-regexp)
'("<f2>" . meow-quick-kmacro)
'("<f3>" . meow-start-kmacro)
'("<f4>" . meow-end-or-call-kmacro)
'("<escape>" . meow-last-buffer)))
(require 'meow)
(meow-setup)
(meow-global-mode t)
(meow-setup-indicator)
(with-eval-after-load "meow"
(custom-set-faces
'(meow-grab ((t (:inherit secondary-selection))))
'(meow-normal-indicator ((t ())))
'(meow-motion-indicator ((t ())))
'(meow-keypad-indicator ((t ())))
'(meow-insert-indicator ((t ()))))
(add-to-list 'meow-expand-exclude-mode-list 'dired-mode)
(add-to-list 'meow-expand-exclude-mode-list 'wdired-mode))
(require 'selectrum)
(require 'prescient)
(require 'selectrum-prescient)
(selectrum-mode 1)
(selectrum-prescient-mode 1)
(with-eval-after-load "selectrum"
(define-key selectrum-minibuffer-map (kbd "{") #'selectrum-previous-candidate)
(define-key selectrum-minibuffer-map (kbd "}") #'selectrum-next-candidate))
(require 'company)
(add-hook 'prog-mode-hook #'company-mode)
(add-hook 'conf-mode-hook #'company-mode)
(with-eval-after-load "company"
(define-key company-active-map (kbd "{") #'company-select-previous)
(define-key company-active-map (kbd "}") #'company-select-next))
(require 'smartparens-config)
(require 'smartparens)
(add-hook 'prog-mode-hook #'smartparens-mode)
(add-hook 'conf-mode-hook #'smartparens-mode)
(with-eval-after-load "smartparens"
(define-key smartparens-mode-map (kbd "C-)") #'sp-forward-slurp-sexp)
(define-key smartparens-mode-map (kbd "C-}") #'sp-forward-barf-sexp)
(define-key smartparens-mode-map (kbd "M-r") #'sp-raise-sexp)
(define-key smartparens-mode-map (kbd "M-s") #'sp-splice-sexp))
(autoload #'magit "magit" nil t)
(global-set-key (kbd "C-x g") #'magit)
(require 'modus-themes)
(load-theme 'modus-operandi t)
(set-frame-font "DejaVu Sans Mono-12")
(scroll-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(blink-cursor-mode -1)
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
(add-hook 'conf-mode-hook #'display-line-numbers-mode)
(setq-default inhibit-startup-screen t
indent-tabs-mode nil
line-spacing 3)
(global-unset-key (kbd "C-x C-n"))
(global-unset-key (kbd "C-x C-p"))
(global-unset-key (kbd "C-x C-b"))
(global-unset-key (kbd "C-x C-o"))
(global-set-key (kbd "<down>") 'scroll-up-line)
(global-set-key (kbd "<up>") 'scroll-down-line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment