mirror of
https://github.com/vale981/dotfiles
synced 2025-03-06 01:51:40 -05:00
Emacs Hacks
This commit is contained in:
parent
b5cf7f5a7c
commit
2b42ef1d77
1 changed files with 58 additions and 22 deletions
|
@ -1,10 +1,13 @@
|
||||||
;;; General Tweaks
|
;;; general Tweaks
|
||||||
(setq inhibit-startup-screen t)
|
(setq inhibit-startup-screen t)
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(blink-cursor-mode 0)
|
(blink-cursor-mode 0)
|
||||||
(server-start)
|
(server-start)
|
||||||
|
;; (set-frame-font "Source Code Pro" nil t)
|
||||||
|
(set-frame-font "Fira Code" nil t)
|
||||||
|
(set-face-attribute 'default t :font "Fira Code")
|
||||||
|
|
||||||
;;; Backup
|
;;; Backup
|
||||||
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
|
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
|
||||||
|
@ -30,14 +33,14 @@
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(custom-safe-themes
|
'(custom-safe-themes
|
||||||
(quote
|
(quote
|
||||||
("8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "065efdd71e6d1502877fd5621b984cded01717930639ded0e569e1724d058af8" default)))
|
("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" "8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "065efdd71e6d1502877fd5621b984cded01717930639ded0e569e1724d058af8" default)))
|
||||||
'(haskell-interactive-popup-errors 0)
|
'(haskell-interactive-popup-errors 0)
|
||||||
'(haskell-process-auto-import-loaded-modules t)
|
'(haskell-process-auto-import-loaded-modules t)
|
||||||
'(haskell-process-log t)
|
'(haskell-process-log t)
|
||||||
'(haskell-process-suggest-remove-import-lines t)
|
'(haskell-process-suggest-remove-import-lines t)
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
(quote
|
(quote
|
||||||
(pretty-mode lispy slime-company slime info-beamer auctex-latexmk indium ag flow-minor-mode company-flow flycheck-flow js-doc yasnippet-classic-snippets yasnippet-snippets ivy-yasnippet counsel sage-shell-mode frames-only-mode dummyparens anaconda-mode magit-filenotify docker-compose-mode docker xref-js2 js2-refactor flycheck-rtags flycheck ivy-rtags rtags auctex magit php-mode flycheck-rust avy-flycheck company racer cargo rust-mode restart-emacs nix-mode json-mode multiple-cursors swiper ivy xresources-theme powerline)))
|
(counsel-notmuch circe-notifications circe pretty-mode lispy slime-company slime info-beamer auctex-latexmk indium ag flow-minor-mode company-flow flycheck-flow js-doc yasnippet-classic-snippets yasnippet-snippets ivy-yasnippet counsel sage-shell-mode frames-only-mode dummyparens anaconda-mode magit-filenotify docker-compose-mode docker xref-js2 js2-refactor flycheck-rtags flycheck ivy-rtags rtags auctex magit php-mode flycheck-rust avy-flycheck company racer cargo rust-mode restart-emacs nix-mode json-mode multiple-cursors swiper ivy xresources-theme powerline)))
|
||||||
'(safe-local-variable-values (quote ((TeX-master . t))))
|
'(safe-local-variable-values (quote ((TeX-master . t))))
|
||||||
'(show-paren-mode t)
|
'(show-paren-mode t)
|
||||||
'(tramp-syntax (quote default) nil (tramp)))
|
'(tramp-syntax (quote default) nil (tramp)))
|
||||||
|
@ -46,7 +49,10 @@
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
)
|
'(circe-highlight-nick-face ((t (:foreground "red" :weight bold))))
|
||||||
|
'(circe-prompt-face ((t (:foreground "dim gray" :weight bold))))
|
||||||
|
'(circe-server-face ((t (:foreground "olive drab"))))
|
||||||
|
'(lui-irc-colors-fg-2-face ((t (:foreground "dim gray")))))
|
||||||
|
|
||||||
(defun unpop-to-mark-command ()
|
(defun unpop-to-mark-command ()
|
||||||
"Unpop off mark ring. Does nothing if mark ring is empty."
|
"Unpop off mark ring. Does nothing if mark ring is empty."
|
||||||
|
@ -212,27 +218,42 @@
|
||||||
;; 107))
|
;; 107))
|
||||||
;; nil))))))
|
;; nil))))))
|
||||||
|
|
||||||
(defmacro replace-seqs (chars modes)
|
;; (defmacro replace-seqs (chars modes)
|
||||||
`(progn ,@(loop for char in chars collect `(replace-seq ,(first char) ,(second char) ,modes))
|
;; `(progn ,@(loop for char in chars collect `(replace-seq ,(first char) ,(second char) ,modes))
|
||||||
nil))
|
;; nil))
|
||||||
|
|
||||||
(defmacro replace-seq (char replacement modes)
|
;; (defmacro replace-seq (char replacement modes)
|
||||||
(let ((fname (gensym)))
|
;; (let ((fname (gensym)))
|
||||||
`(progn
|
;; `(progn
|
||||||
(defun ,fname ()
|
;; (defun ,fname ()
|
||||||
(font-lock-add-keywords
|
;; (font-lock-add-keywords
|
||||||
nil
|
;; nil
|
||||||
'((,char (0
|
;; '((,char (0
|
||||||
(progn
|
;; (progn
|
||||||
(compose-region (match-beginning 0)
|
;; (compose-region (match-beginning 0)
|
||||||
(match-end 0)
|
;; (match-end 0)
|
||||||
,replacement)
|
;; ,replacement)
|
||||||
nil))))))
|
;; nil))))))
|
||||||
|
|
||||||
,@(loop for mode in modes collect `(add-hook ,mode (quote ,fname)))
|
;; ,@(loop for mode in modes collect `(add-hook ,mode (quote ,fname)))
|
||||||
nil)))
|
;; nil)))
|
||||||
|
|
||||||
(replace-seqs (("#'" "⍘") ("\\<lambda\\>" "λ") ("\\<funcall\\>" "⨐")) ('slime-mode-hook 'emacs-lisp-mode-hook 'slime-repl-mode-hook))
|
;; (replace-seqs (("#'" "⍘") ("\\<lambda\\>" "λ") ("\\<funcall\\>" "⨐")) ('slime-mode-hook 'emacs-lisp-mode-hook 'slime-repl-mode-hook))
|
||||||
|
|
||||||
|
(defun my-add-to-multiple-hooks (function hooks)
|
||||||
|
(mapc (lambda (hook)
|
||||||
|
(add-hook hook function))
|
||||||
|
hooks))
|
||||||
|
|
||||||
|
(my-add-to-multiple-hooks
|
||||||
|
#'(lambda ()
|
||||||
|
(mapc (lambda (pair) (push pair prettify-symbols-alist))
|
||||||
|
'(;; Syntax
|
||||||
|
("funcall" . #x2A10)
|
||||||
|
("#'" . #x2358))))
|
||||||
|
'(emacs-lisp-mode-hook
|
||||||
|
lisp-mode-hook
|
||||||
|
lisp-interaction-mode-hook))
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook #'lispy-mode)
|
(add-hook 'emacs-lisp-mode-hook #'lispy-mode)
|
||||||
(add-hook 'eval-expression-minibuffer-setup-hook #'lispy-mode)
|
(add-hook 'eval-expression-minibuffer-setup-hook #'lispy-mode)
|
||||||
|
@ -240,6 +261,7 @@
|
||||||
(add-hook 'lisp-mode-hook #'lispy-mode)
|
(add-hook 'lisp-mode-hook #'lispy-mode)
|
||||||
(add-hook 'lisp-interaction-mode-hook #'lispy-mode)
|
(add-hook 'lisp-interaction-mode-hook #'lispy-mode)
|
||||||
(add-hook 'scheme-mode-hook #'lispy-mode)
|
(add-hook 'scheme-mode-hook #'lispy-mode)
|
||||||
|
|
||||||
(with-eval-after-load 'lispy
|
(with-eval-after-load 'lispy
|
||||||
(define-key lispy-mode-map (kbd "M-(") #'lispy-parens-auto-wrap))
|
(define-key lispy-mode-map (kbd "M-(") #'lispy-parens-auto-wrap))
|
||||||
|
|
||||||
|
@ -345,6 +367,7 @@
|
||||||
;;; Email
|
;;; Email
|
||||||
;;use org mode for eml files (useful for thunderbird plugin)
|
;;use org mode for eml files (useful for thunderbird plugin)
|
||||||
(add-to-list 'auto-mode-alist '("\\.eml\\'" . org-mode))
|
(add-to-list 'auto-mode-alist '("\\.eml\\'" . org-mode))
|
||||||
|
(global-prettify-symbols-mode 1)
|
||||||
|
|
||||||
;;; Ricing
|
;;; Ricing
|
||||||
;;(require 'xresources-theme)
|
;;(require 'xresources-theme)
|
||||||
|
@ -352,9 +375,22 @@
|
||||||
(powerline-default-theme)
|
(powerline-default-theme)
|
||||||
(global-set-key (kbd "M-g w") 'avy-goto-word-1)
|
(global-set-key (kbd "M-g w") 'avy-goto-word-1)
|
||||||
(put 'upcase-region 'disabled nil)
|
(put 'upcase-region 'disabled nil)
|
||||||
|
(global-pretty-mode t)
|
||||||
|
(pretty-activate-groups
|
||||||
|
'(:sub-and-superscripts :greek :arithmetic-nary :arrows :arithmetic))
|
||||||
|
|
||||||
;;; Avy
|
;;; Avy
|
||||||
(global-set-key (kbd "M-g w") 'avy-goto-word-1)
|
(global-set-key (kbd "M-g w") 'avy-goto-word-1)
|
||||||
(global-set-key (kbd "M-g f") 'avy-goto-line)
|
(global-set-key (kbd "M-g f") 'avy-goto-line)
|
||||||
(global-set-key (kbd "C-'") 'avy-goto-char-2)
|
(global-set-key (kbd "C-'") 'avy-goto-char-2)
|
||||||
|
|
||||||
|
|
||||||
|
;;; IRC
|
||||||
|
(setq circe-network-options
|
||||||
|
'(("Freenode"
|
||||||
|
:tls t
|
||||||
|
:nick "hiro98"
|
||||||
|
:sasl-username "hiro98"
|
||||||
|
:sasl-password "valentin981"
|
||||||
|
:channels ("#emacs-circe")
|
||||||
|
)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue