#+TITLE: emprespresso's settings #+AUTHOR: emprespresso #+STARTUP: fold * melpa #+BEGIN_SRC emacs-lisp (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) #+END_SRC * macos hacks that have to be run before most stuff. ** image types. #+BEGIN_SRC emacs-lisp (setq image-types '(svg png gif tiff jpeg xpm xbm pbg)) #+END_SRC * yeah, be evil. whatcha gonna do about it?? huh?? >:P #+BEGIN_SRC emacs-lisp (use-package evil :init (setq evil-want-integration t) (setq evil-want-keybinding nil) (setq evil-want-C-u-scroll t) (setq evil-want-C-i-jump nil) (setq evil-shift-width {{ editorconfig.tab_width }}) (setq evil-cross-lines t) (setq evil-respect-visual-line-mode t) (setq evil-vsplit-window-below t) (setq evil-split-window-below t) (setq evil-undo-system 'undo-redo) :config (evil-mode 1) (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) (evil-global-set-key 'motion "j" 'evil-next-visual-line) (evil-global-set-key 'motion "k" 'evil-previous-visual-line) (add-hook 'evil-visual-activate-hook #'(lambda () (global-hl-line-mode 0))) (add-hook 'evil-visual-deactivate-hook #'(lambda () (global-hl-line-mode 1))) (setq evil-want-fine-undo t) (evil-set-initial-state 'messages-buffer-mode 'normal)) #+END_SRC * misc. emacs stuff ** files and autosaves #+BEGIN_SRC emacs-lisp (setq auto-save-default nil make-backup-files nil create-lockfiles nil) (global-auto-revert-mode t) ;; Change files on disk as they are updated #+END_SRC ** env.PATH #+BEGIN_SRC emacs-lisp (use-package exec-path-from-shell :ensure t :init (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize))) #+END_SRC ** case-region #+BEGIN_SRC emacs-lisp (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) #+END_SRC ** silence, bell #+BEGIN_SRC emacs-lisp (setq ring-bell-function 'ignore) #+END_SRC * appearance ** global #+BEGIN_SRC emacs-lisp ;; > expert users often turn off the menu bar ;; > https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bars.html ;; we're experts, right?? (*^.^*) (menu-bar-mode -1) ;; don't show startup screen, go straight to scratch (setq inhibit-startup-screen t) #+END_SRC ** gui *** clutter #+BEGIN_SRC emacs-lisp ;; don't show clutter (tool-bar-mode -1) ;; make line-wrap arrows basically invisible by setting the fringe area ;; dimensions to 1 (set-fringe-mode '(1 . 1)) ;; disable scroll bars (scroll-bar-mode -1) (horizontal-scroll-bar-mode -1) #+END_SRC *** line - related #+BEGIN_SRC emacs-lisp ;; move by whole line units, not visually (setq line-move-visual nil) ;; make comfy (setq line-spacing 0.24) ;; highlight current line (global-hl-line-mode) ;; fixes an "issue", where the frame doesn't use the entire space available given ;; by the window manager since the frame will resize only by factors of the line ;; height by default. ;; especially noticeable when tiling ヽ(ー_ー )ノ (setq frame-resize-pixelwise t) #+END_SRC *** transparency #+BEGIN_SRC emacs-lisp (set-frame-parameter (selected-frame) 'alpha '(90 90)) (add-to-list 'default-frame-alist '(alpha 90 90)) #+END_SRC *** icons must run ~(all-the-icons-install-fonts)~ and ~(nerd-fonts-install-fonts)~ #+BEGIN_SRC emacs-lisp (use-package all-the-icons :ensure t) (use-package nerd-icons :ensure t) #+END_SRC *** modeline #+BEGIN_SRC emacs-lisp (use-package doom-modeline :ensure t :config (doom-modeline-mode 1)) #+END_SRC *** themes #+BEGIN_SRC emacs-lisp (use-package doom-themes :ensure t :config (setq doom-themes-enable-bold t ; enable bold globally doom-themes-enable-italic t) ; enable italics globally ;; flash mode-line on errors (doom-themes-visual-bell-config) (doom-themes-neotree-config) ;; corrects (and improves) org-mode's native fontification. (doom-themes-org-config)) #+END_SRC *** eager loading of theme #+BEGIN_SRC emacs-lisp ;; TODO: figure out why this won't work when this is a symlink. (setq *theme-file* "~/.config/theme/emacs.el") (defun lazy-theme (event) (message "Event %S" event) (load-file *theme-file*)) (file-notify-add-watch *theme-file* '(change attribute-change) 'lazy-theme) (lazy-theme nil) #+END_SRC * neotree #+BEGIN_SRC emacs-lisp (use-package neotree :ensure t :bind ("C-c j" . 'neotree-toggle) :init ;; slow rendering (setq inhibit-compacting-font-caches t) ;; set icons theme (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) (setq neo-window-width 35) ;; every time when the neotree window is opened, let it find current file ;; and jump to node (setq neo-smart-open t) ;; when running ‘projectile-switch-project’ (C-c p p), ‘neotree’ ;; will change root automatically (setq projectile-switch-project-action 'neotree-projectile-action) ;; show hidden files (setq-default neo-show-hidden-files t)) #+END_SRC * org mode ** misc vars #+BEGIN_SRC emacs-lisp (setq org-startup-indented t org-html-postamble nil org-html-preamble t org-src-tab-acts-natively t) #+END_SRC ** roam #+BEGIN_SRC emacs-lisp (use-package org-roam :straight t) #+END_SRC ** babel #+BEGIN_SRC emacs-lisp (org-babel-do-load-languages 'org-babel-load-languages '((lisp . t) (emacs-lisp . t) (python . t))) #+END_SRC ** org-bullets #+BEGIN_SRC emacs-lisp (use-package org-bullets :ensure t :init (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+END_SRC ** org-appear #+BEGIN_SRC emacs-lisp (use-package org-appear :ensure t :init (add-hook 'org-mode-hook 'org-appear-mode)) #+END_SRC ** presentations #+BEGIN_SRC emacs-lisp (use-package org-present :ensure t :straight '(org-present :type git :host github :repo "rlister/org-present")) #+END_SRC * major modes ** markdown #+BEGIN_SRC emacs-lisp (use-package markdown-mode :ensure t :mode ("README\\.md\\'" . gfm-mode) :init (setq markdown-command "multimarkdown") :bind (:map markdown-mode-map ("C-c C-e" . markdown-do))) #+END_SRC * dev stuff ** completion #+BEGIN_SRC emacs-lisp ;; > yasnippet is a template system for emacs. ;; > it allows you to type an abbreviation and automatically expand it into ;; function templates. ;; https://github.com/joaotavora/yasnippet/blob/master/README.mdown (use-package yasnippet :ensure t :init (yas-global-mode 1)) #+END_SRC ** lsp #+BEGIN_SRC emacs-lisp ;; pip3 install epc orjson sexpdata six setuptools \ ;; paramiko rapidfuzz watchdog packaging (use-package lsp-bridge :straight '(lsp-bridge :type git :host github :repo "manateelazycat/lsp-bridge" :files (:defaults "*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources") :build (:not compile)) :init (global-lsp-bridge-mode)) #+END_SRC ** format #+BEGIN_SRC emacs-lisp (use-package format-all :ensure t :bind (("C-c C-f" . format-all-region))) #+END_SRC