emacs tweaks
This commit is contained in:
parent
2942ad9525
commit
7f81dfb76b
|
@ -1,111 +0,0 @@
|
||||||
;; Added by Package.el. This must come before configurations of
|
|
||||||
;; installed packages. Don't delete this line. If you don't want it,
|
|
||||||
;; just comment it out by adding a semicolon to the start of the line.
|
|
||||||
;; You may delete these explanatory comments.
|
|
||||||
(require 'package)
|
|
||||||
;; remove the load path for nix profiles
|
|
||||||
;; todo: fix woman
|
|
||||||
(eval-after-load 'woman '(error "fix the path from /nix/*-emacs-*/..site-start.el first"))
|
|
||||||
|
|
||||||
(require 'seq)
|
|
||||||
(setq load-path
|
|
||||||
(seq-difference load-path (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
|
|
||||||
(split-string (or (getenv "NIX_PROFILES") "")))))
|
|
||||||
|
|
||||||
(package-initialize 'noactivate)
|
|
||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(custom-safe-themes
|
|
||||||
(quote
|
|
||||||
("8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
|
|
||||||
'(notmuch-saved-searches
|
|
||||||
(quote
|
|
||||||
((:name "unread" :query "tag:unread" :key "u")
|
|
||||||
(:name "flagged" :query "tag:flagged" :key "f")
|
|
||||||
(:name "sent" :query "tag:sent" :key "t")
|
|
||||||
(:name "drafts" :query "tag:draft" :key "d")
|
|
||||||
(:name "all mail" :query "*" :key "a")
|
|
||||||
(:name "inbox" :query "tag:inbox"))))
|
|
||||||
'(safe-local-variable-values
|
|
||||||
(quote
|
|
||||||
((eval c-set-offset
|
|
||||||
(quote inlambda)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-cont-nonempty)
|
|
||||||
(quote
|
|
||||||
(c-lineup-gcc-asm-reg c-lineup-arglist)))
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-close)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-intro)
|
|
||||||
(quote ++))
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote case-label)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote statement-case-open)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote access-label)
|
|
||||||
(quote -))
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote substatement-open)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-cont-nonempty)
|
|
||||||
(quote +))
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-cont)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote arglist-intro)
|
|
||||||
(quote +))
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote inline-open)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote defun-open)
|
|
||||||
0)
|
|
||||||
(eval c-set-offset
|
|
||||||
(quote innamespace)
|
|
||||||
0)
|
|
||||||
(indicate-empty-lines . t)))))
|
|
||||||
|
|
||||||
(setq org-modules '(org-bbdb org-bibtex org-docview org-gnus org-habit
|
|
||||||
org-info org-irc org-mhe org-rmail org-w3m))
|
|
||||||
(setq max-lisp-eval-depth 10000)
|
|
||||||
(setq max-specpdl-size 13000)
|
|
||||||
(org-babel-load-file "~/dotfiles/emacs/emacs.org")
|
|
||||||
;(add-to-list 'custom-theme-load-path "~/tmp/emacs-color-theme-solarized")
|
|
||||||
;; (defun set-solarized-theme (frame theme)
|
|
||||||
;; (set-frame-parameter frame 'background-mode theme)
|
|
||||||
;; (set-terminal-parameter frame 'background-mode theme)
|
|
||||||
;; (load-theme 'solarized)
|
|
||||||
;; ;; transparent background
|
|
||||||
;; (when (not (display-graphic-p)) (set-face-background 'default "unspecified-bg" frame)))
|
|
||||||
;; (add-hook 'after-make-frame-functions
|
|
||||||
;; (lambda (frame)
|
|
||||||
;; (let ((mode (if (display-graphic-p frame) 'light 'dark)))
|
|
||||||
;; (set-solarized-theme frame mode)
|
|
||||||
;; )))
|
|
||||||
(xterm-mouse-mode 1)
|
|
||||||
(define-key local-function-key-map "\033[73;5~" [(control return)])
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(evil-goggles-change-face ((t (:inherit diff-removed))))
|
|
||||||
'(evil-goggles-delete-face ((t (:inherit diff-removed))))
|
|
||||||
'(evil-goggles-paste-face ((t (:inherit diff-added))))
|
|
||||||
'(evil-goggles-undo-redo-add-face ((t (:inherit diff-added))))
|
|
||||||
'(evil-goggles-undo-redo-change-face ((t (:inherit diff-changed))))
|
|
||||||
'(evil-goggles-undo-redo-remove-face ((t (:inherit diff-removed))))
|
|
||||||
'(evil-goggles-yank-face ((t (:inherit diff-changed)))))
|
|
||||||
|
|
||||||
|
|
36
emacs/early-init.el
Normal file
36
emacs/early-init.el
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
;; installed by home-manager
|
||||||
|
;; temporarily disable GC
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
|
||||||
|
gc-cons-percentage 0.6)
|
||||||
|
|
||||||
|
;; re-enable GC later
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(setq gc-cons-threshold 100000000
|
||||||
|
gc-cons-percentage 0.1)))
|
||||||
|
|
||||||
|
;; disable toolbars before GUI shows
|
||||||
|
(tool-bar-mode 0)
|
||||||
|
(menu-bar-mode 0)
|
||||||
|
(scroll-bar-mode 0)
|
||||||
|
|
||||||
|
;; we use a tiling WM, so don't attempt any window resizes
|
||||||
|
(setq frame-inhibit-implied-resize t)
|
||||||
|
|
||||||
|
;; magic package quickstart feature
|
||||||
|
(setq package-quickstart 't)
|
||||||
|
|
||||||
|
(set-face-attribute 'default nil
|
||||||
|
:family "monospace"
|
||||||
|
:height 120
|
||||||
|
:weight 'normal
|
||||||
|
:width 'normal)
|
||||||
|
|
||||||
|
;; don't redisplay during startup
|
||||||
|
(setq-default inhibit-redisplay t
|
||||||
|
inhibit-message t)
|
||||||
|
(add-hook 'window-setup-hook
|
||||||
|
(lambda ()
|
||||||
|
(setq-default inhibit-redisplay nil
|
||||||
|
inhibit-message nil)
|
||||||
|
(redisplay)))
|
|
@ -2,6 +2,11 @@
|
||||||
#+AUTHOR: Yorick van Pelt
|
#+AUTHOR: Yorick van Pelt
|
||||||
|
|
||||||
* Prelims
|
* Prelims
|
||||||
|
** Workarounds?
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq max-lisp-eval-depth 10000)
|
||||||
|
(setq max-specpdl-size 13000)
|
||||||
|
#+END_SRC
|
||||||
** start server
|
** start server
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(server-start)
|
(server-start)
|
||||||
|
@ -18,6 +23,15 @@
|
||||||
(load custom-file)
|
(load custom-file)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Org stuff
|
* Org stuff
|
||||||
|
** Scratch buffer
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq initial-major-mode 'org-mode)
|
||||||
|
(setq initial-scratch-message "\
|
||||||
|
,#+TITLE: Scratch buffer
|
||||||
|
,#+AUTHOR: Yorick van Pelt
|
||||||
|
|
||||||
|
")
|
||||||
|
#+END_SRC
|
||||||
** modules
|
** modules
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -120,15 +134,6 @@
|
||||||
(setq org-ref-completion-library 'org-ref-ivy-cite))
|
(setq org-ref-completion-library 'org-ref-ivy-cite))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Look
|
* Look
|
||||||
** Fonts
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(set-face-attribute 'default nil
|
|
||||||
:family "monospace"
|
|
||||||
:height 120
|
|
||||||
:weight 'normal
|
|
||||||
:width 'normal)
|
|
||||||
|
|
||||||
#+END_SRC
|
|
||||||
** Solarized
|
** Solarized
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; (use-package solarized
|
;; (use-package solarized
|
||||||
|
@ -157,14 +162,14 @@
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Transparency
|
** Transparency
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(set-frame-parameter (selected-frame) 'alpha '(95 . 95))
|
;; todo: transparency is slow somehow
|
||||||
(add-to-list 'default-frame-alist '(alpha . (95 . 95)))
|
;; (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
|
||||||
|
;; (add-to-list 'default-frame-alist '(alpha . (95 . 95)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Cleaner frames
|
** Cleaner frames
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(tool-bar-mode 0)
|
;; toolbars are disabled in early-init.el
|
||||||
(menu-bar-mode 0)
|
(setq inhibit-startup-screen t)
|
||||||
(scroll-bar-mode 0)
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** hl-line
|
** hl-line
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -248,6 +253,7 @@ from https://vickychijwani.me/nuggets-from-my-emacs-part-i/
|
||||||
:diminish
|
:diminish
|
||||||
:bind (("C-s" . swiper)
|
:bind (("C-s" . swiper)
|
||||||
("C-c C-r" . ivy-resume)
|
("C-c C-r" . ivy-resume)
|
||||||
|
("C-x b" . ivy-switch-buffer)
|
||||||
("<f6>" . ivy-resume)))
|
("<f6>" . ivy-resume)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Counsel
|
** Counsel
|
||||||
|
@ -280,7 +286,6 @@ from https://vickychijwani.me/nuggets-from-my-emacs-part-i/
|
||||||
** ggtags
|
** ggtags
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ggtags
|
(use-package ggtags
|
||||||
:demand
|
|
||||||
:bind ("M-." . ggtags-find-tag-dwim))
|
:bind ("M-." . ggtags-find-tag-dwim))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** intuitive window resize
|
** intuitive window resize
|
||||||
|
@ -337,6 +342,11 @@ from https://vickychijwani.me/nuggets-from-my-emacs-part-i/
|
||||||
: move-border-down
|
: move-border-down
|
||||||
|
|
||||||
** TODO i3-emacs
|
** TODO i3-emacs
|
||||||
|
** Terminal
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(xterm-mouse-mode 1)
|
||||||
|
(define-key local-function-key-map "\033[73;5~" [(control return)])
|
||||||
|
#+END_SRC
|
||||||
* editing
|
* editing
|
||||||
** line numbers
|
** line numbers
|
||||||
*** relative
|
*** relative
|
||||||
|
@ -410,6 +420,8 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
** Evil
|
** Evil
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(global-undo-tree-mode)
|
(global-undo-tree-mode)
|
||||||
|
;; prevent .~undo-tree file pollution
|
||||||
|
(setq undo-tree-auto-save-history nil)
|
||||||
(setq evil-want-C-i-jump nil)
|
(setq evil-want-C-i-jump nil)
|
||||||
|
|
||||||
(use-package evil
|
(use-package evil
|
||||||
|
@ -417,9 +429,9 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
(evil-mode t)
|
(evil-mode t)
|
||||||
(evil-set-undo-system 'undo-tree)
|
(evil-set-undo-system 'undo-tree)
|
||||||
|
|
||||||
; change cursor based on mode
|
; change cursor based on mode
|
||||||
(add-hook 'evil-insert-state-entry-hook (lambda () (when (not (display-graphic-p)) (send-string-to-terminal "\033[5 q"))))
|
(add-hook 'evil-insert-state-entry-hook (lambda () (when (not (display-graphic-p)) (send-string-to-terminal "\033[5 q"))))
|
||||||
(add-hook 'evil-normal-state-entry-hook (lambda () (when (not (display-graphic-p)) (send-string-to-terminal "\033[0 q"))))
|
(add-hook 'evil-normal-state-entry-hook (lambda () (when (not (display-graphic-p)) (send-string-to-terminal "\033[0 q"))))
|
||||||
)
|
)
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:diminish
|
:diminish
|
||||||
|
@ -438,7 +450,9 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package evil-goggles
|
(use-package evil-goggles
|
||||||
:diminish
|
:diminish
|
||||||
:config (evil-goggles-mode)
|
:after evil
|
||||||
|
:config
|
||||||
|
(evil-goggles-mode)
|
||||||
(evil-goggles-use-diff-faces))
|
(evil-goggles-use-diff-faces))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** TODO [[https://github.com/emacs-evil/evil-surround][evil-surround]]
|
*** TODO [[https://github.com/emacs-evil/evil-surround][evil-surround]]
|
||||||
|
@ -448,7 +462,8 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
** TODO multiple-cursors
|
** TODO multiple-cursors
|
||||||
** crdt
|
** crdt
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package crdt)
|
(use-package crdt
|
||||||
|
:commands (crdt-connect))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
|
@ -530,12 +545,18 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:init
|
:init
|
||||||
(setq lsp-keymap-prefix "C-c s")
|
(setq lsp-keymap-prefix "C-c s")
|
||||||
:hook (lsp-mode . lsp-enable-which-key-integration)
|
:hook
|
||||||
:commands (lsp lsp-deferred))
|
(lsp-mode . lsp-enable-which-key-integration)
|
||||||
(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
|
:commands
|
||||||
(use-package lsp-ui :commands lsp-ui-mode)
|
(lsp lsp-deferred))
|
||||||
|
(use-package lsp-ivy
|
||||||
|
:commands lsp-ivy-workspace-symbol
|
||||||
|
:after lsp)
|
||||||
|
(use-package lsp-ui
|
||||||
|
:commands lsp-ui-mode
|
||||||
|
:after lsp)
|
||||||
(setq gc-cons-threshold 100000000)
|
(setq gc-cons-threshold 100000000)
|
||||||
(setq read-process-output-max (* 1024 1024 3)) ;; 3mb
|
(setq read-process-output-max (* 1024 1024 3)) ;; 3mb
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
|
|
4
emacs/init.el
Normal file
4
emacs/init.el
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
;; installed by home-manager
|
||||||
|
(setq org-modules '(org-bbdb org-bibtex org-docview org-gnus org-habit
|
||||||
|
org-info org-irc org-mhe org-rmail org-w3m))
|
||||||
|
(org-babel-load-file "~/dotfiles/emacs/emacs.org")
|
|
@ -129,6 +129,9 @@ in {
|
||||||
extraConfig.pull.ff = "only";
|
extraConfig.pull.ff = "only";
|
||||||
extraConfig."includeIf \"gitdir:~/serokell/\"".path =
|
extraConfig."includeIf \"gitdir:~/serokell/\"".path =
|
||||||
"~/serokell/.gitconfig";
|
"~/serokell/.gitconfig";
|
||||||
|
# ignores = [
|
||||||
|
# "*.~undo-tree~"
|
||||||
|
# ];
|
||||||
aliases = {
|
aliases = {
|
||||||
lg =
|
lg =
|
||||||
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative";
|
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative";
|
||||||
|
@ -255,9 +258,9 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.file.".emacs.d/init.el" = {
|
# todo: precompile?
|
||||||
source = (toString /home/yorick/dotfiles/emacs/.emacs.d/init.el);
|
home.file.".emacs.d/init.el".source = (toString /home/yorick/dotfiles/emacs/init.el);
|
||||||
};
|
home.file.".emacs.d/early-init.el".source = (toString /home/yorick/dotfiles/emacs/early-init.el);
|
||||||
xdg.configFile."nixpkgs/config.nix".text = ''
|
xdg.configFile."nixpkgs/config.nix".text = ''
|
||||||
import "${toString ../config.nix}"
|
import "${toString ../config.nix}"
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue