YOLO
This commit is contained in:
parent
1c93d64e7d
commit
9ca2aa7b8a
1 changed files with 116 additions and 100 deletions
216
init.el
216
init.el
|
@ -48,22 +48,27 @@
|
||||||
(setq auto-save-default nil)
|
(setq auto-save-default nil)
|
||||||
(setq visible-bell t)
|
(setq visible-bell t)
|
||||||
|
|
||||||
|
;; I'm the only cowboy on this mainframe
|
||||||
|
(setq create-lockfiles nil)
|
||||||
|
|
||||||
|
;; X is dead
|
||||||
|
(setq inhibit-x-resources t)
|
||||||
|
|
||||||
|
;; use ibuffer instead of standard buffer list
|
||||||
|
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
||||||
|
|
||||||
;; my personal keymap
|
;; my personal keymap
|
||||||
(define-prefix-command 'oxamap)
|
(define-prefix-command 'oxamap)
|
||||||
(global-set-key (kbd "C-z") 'oxamap)
|
(global-set-key (kbd "C-z") 'oxamap)
|
||||||
|
|
||||||
;; declutter modeline with diminish
|
|
||||||
(straight-use-package 'diminish)
|
|
||||||
|
|
||||||
(fset 'yes-or-no-p 'y-or-n-p)
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||||||
(setq confirm-nonexistent-file-or-buffer nil)
|
(setq confirm-nonexistent-file-or-buffer nil)
|
||||||
|
|
||||||
(if window-system
|
;; italicize comments
|
||||||
(progn
|
|
||||||
(straight-use-package 'zenburn-theme)
|
|
||||||
(load-theme 'zenburn t)))
|
|
||||||
(set-face-italic 'font-lock-comment-face 1)
|
(set-face-italic 'font-lock-comment-face 1)
|
||||||
(set-face-italic 'font-lock-comment-delimiter-face nil)
|
(set-face-italic 'font-lock-comment-delimiter-face nil)
|
||||||
|
;; make the region more visible
|
||||||
|
(custom-set-faces '(region ((t (:background "yellow" :foreground "black" :bold t)))) )
|
||||||
|
|
||||||
(defadvice term-handle-exit
|
(defadvice term-handle-exit
|
||||||
(after term-kill-buffer-on-exit activate)
|
(after term-kill-buffer-on-exit activate)
|
||||||
|
@ -78,6 +83,19 @@
|
||||||
(add-hook 'prog-mode-hook #'my-whitespace-hook)
|
(add-hook 'prog-mode-hook #'my-whitespace-hook)
|
||||||
(add-hook 'text-mode-hook #'my-whitespace-hook)
|
(add-hook 'text-mode-hook #'my-whitespace-hook)
|
||||||
|
|
||||||
|
;; (use-package modus-themes
|
||||||
|
;; :straight t
|
||||||
|
;; :init
|
||||||
|
;; (setq modus-themes-slanted-constructs t
|
||||||
|
;; modus-themes-bold-constructs t
|
||||||
|
;; modus-themes-no-mixed-fonts t)
|
||||||
|
;; (modus-themes-load-themes)
|
||||||
|
;; :config
|
||||||
|
;; (modus-themes-load-vivendi)
|
||||||
|
;; ;; dirty hack for emacsclient
|
||||||
|
;; (setq default-frame-alist '((cursor-color . "white")))
|
||||||
|
;; :bind (:map oxamap ("\\" . modus-themes-toggle)))
|
||||||
|
|
||||||
;; let's try to fix the pile of burning garbage that emacs calls a
|
;; let's try to fix the pile of burning garbage that emacs calls a
|
||||||
;; tab. If anyone reading actually knows why mixing tabs and spaces or
|
;; tab. If anyone reading actually knows why mixing tabs and spaces or
|
||||||
;; deleting the tab one space at a time is a good idea, please drop me
|
;; deleting the tab one space at a time is a good idea, please drop me
|
||||||
|
@ -87,10 +105,9 @@
|
||||||
(setq whitespace-display-mappings
|
(setq whitespace-display-mappings
|
||||||
'((tab-mark 9 [187 9] [92 9])))
|
'((tab-mark 9 [187 9] [92 9])))
|
||||||
(set-face-inverse-video 'whitespace-tab nil)
|
(set-face-inverse-video 'whitespace-tab nil)
|
||||||
(set-face-foreground 'whitespace-tab "#3c3c3c")
|
(set-face-foreground 'whitespace-tab "#4f4f4f")
|
||||||
(set-face-background 'whitespace-tab nil)
|
(set-face-background 'whitespace-tab nil)
|
||||||
(add-hook 'prog-mode-hook #'whitespace-mode)
|
(add-hook 'prog-mode-hook #'whitespace-mode)
|
||||||
(diminish 'whitespace-mode)
|
|
||||||
|
|
||||||
;; let's delete a tab as a whole...
|
;; let's delete a tab as a whole...
|
||||||
(setq backward-delete-char-untabify-method 'nil)
|
(setq backward-delete-char-untabify-method 'nil)
|
||||||
|
@ -100,10 +117,8 @@
|
||||||
(smart-tabs-insinuate 'c 'c++)
|
(smart-tabs-insinuate 'c 'c++)
|
||||||
|
|
||||||
(setq-default indent-tabs-mode 'nil)
|
(setq-default indent-tabs-mode 'nil)
|
||||||
;;helper functions to switch tab expansion off when needed
|
|
||||||
(defun tabs-yay ()
|
(defun tabs-yay ()
|
||||||
"Function to enable tab indentation in buffer."
|
"Function to enable tab indentation in buffer."
|
||||||
;;(local-set-key (kbd "TAB") 'tab-to-tab-stop)
|
|
||||||
(setq indent-tabs-mode t))
|
(setq indent-tabs-mode t))
|
||||||
|
|
||||||
(add-hook 'cc-mode-hook 'tabs-yay)
|
(add-hook 'cc-mode-hook 'tabs-yay)
|
||||||
|
@ -117,9 +132,8 @@
|
||||||
|
|
||||||
;; mac-emacs spooky path shit
|
;; mac-emacs spooky path shit
|
||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
(use-package exec-path-from-shell
|
(progn
|
||||||
:straight t
|
(straight-use-package 'exec-path-from-shell)
|
||||||
:config
|
|
||||||
(exec-path-from-shell-initialize)))
|
(exec-path-from-shell-initialize)))
|
||||||
|
|
||||||
;; backup management
|
;; backup management
|
||||||
|
@ -130,41 +144,37 @@
|
||||||
version-control t)
|
version-control t)
|
||||||
|
|
||||||
;; CC mode default styles
|
;; CC mode default styles
|
||||||
|
(require 'cc-mode)
|
||||||
(setq c-default-style '((java-mode . "java")
|
(setq c-default-style '((java-mode . "java")
|
||||||
(awk-mode . "awk")
|
(awk-mode . "awk")
|
||||||
(c-mode . "linux")
|
(c-mode . "linux")
|
||||||
(c++-mode . "stroustrup")
|
(c++-mode . "stroustrup")
|
||||||
(other . "linux")))
|
(other . "linux")))
|
||||||
|
|
||||||
;; swiper for search
|
|
||||||
(straight-use-package 'swiper)
|
|
||||||
(global-set-key "\C-s" 'swiper)
|
|
||||||
;; ivy for completion
|
|
||||||
(straight-use-package 'ivy)
|
|
||||||
(ivy-mode 1)
|
|
||||||
(diminish 'ivy-mode)
|
|
||||||
|
|
||||||
;; ignore substring order, except for swiper
|
|
||||||
(setq ivy-re-builders-alist
|
|
||||||
'((swiper . ivy--regex-plus)
|
|
||||||
(t . ivy--regex-ignore-order)))
|
|
||||||
;; do not use caret, quite often we want start typing from the middle
|
|
||||||
(eval-after-load 'counsel ;counsel modifies this var
|
|
||||||
(setq ivy-initial-inputs-alist nil))
|
|
||||||
|
|
||||||
;; counsel for ivy-powered alternatives
|
|
||||||
(straight-use-package 'counsel)
|
|
||||||
(counsel-mode 1)
|
|
||||||
(diminish 'counsel-mode)
|
|
||||||
|
|
||||||
;; completion by default - welcome to 2020
|
;; completion by default - welcome to 2020
|
||||||
(straight-use-package 'company)
|
(straight-use-package 'company)
|
||||||
(add-hook 'after-init-hook 'global-company-mode)
|
(add-hook 'after-init-hook 'global-company-mode)
|
||||||
(diminish 'company-mode)
|
|
||||||
|
|
||||||
;; healthy people weeks are starting on Monday
|
(require 'ido)
|
||||||
(use-package calendar
|
(ido-mode t)
|
||||||
:init (setq calendar-week-start-day 1))
|
(setq ido-enable-flex-matching t)
|
||||||
|
(setq ido-everywhere t)
|
||||||
|
(setq ido-auto-merge-work-directories-length -1)
|
||||||
|
(setq ido-use-filename-at-point 't)
|
||||||
|
(setq ido-create-new-buffer 'always)
|
||||||
|
(setq ido-file-extensions-order
|
||||||
|
'(".org" ".scm" ".rkt" ".py" ".jl" ".c" ".h" ".txt" ".tex" ".bib"))
|
||||||
|
|
||||||
|
(straight-use-package 'smex)
|
||||||
|
(global-set-key (kbd "M-x") 'smex)
|
||||||
|
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
|
||||||
|
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
|
||||||
|
|
||||||
|
(straight-use-package 'xclip)
|
||||||
|
(xclip-mode 1)
|
||||||
|
|
||||||
|
(require 'calendar)
|
||||||
|
(setq calendar-week-start-day 1)
|
||||||
|
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:straight t
|
:straight t
|
||||||
|
@ -183,10 +193,11 @@
|
||||||
:config
|
:config
|
||||||
(setq TeX-parse-self t)
|
(setq TeX-parse-self t)
|
||||||
(setq reftex-plug-into-AUCTeX t)
|
(setq reftex-plug-into-AUCTeX t)
|
||||||
|
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
|
||||||
|
TeX-surce-correlate-start-server t)
|
||||||
;; completion for LaTeX
|
;; completion for LaTeX
|
||||||
(use-package company-auctex
|
(use-package company-auctex
|
||||||
:straight t
|
:straight t
|
||||||
:diminish t
|
|
||||||
:config
|
:config
|
||||||
(company-auctex-init)))
|
(company-auctex-init)))
|
||||||
|
|
||||||
|
@ -200,7 +211,6 @@
|
||||||
(cc-mode . rainbow-delimiters-mode)))
|
(cc-mode . rainbow-delimiters-mode)))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:straight t
|
|
||||||
:bind (("C-c a" . org-agenda)
|
:bind (("C-c a" . org-agenda)
|
||||||
("C-c c" . org-capture)
|
("C-c c" . org-capture)
|
||||||
("C-c l" . org-store-link)
|
("C-c l" . org-store-link)
|
||||||
|
@ -208,13 +218,12 @@
|
||||||
("C-c 1" . org-time-stamp-inactive))
|
("C-c 1" . org-time-stamp-inactive))
|
||||||
:init
|
:init
|
||||||
;; we need indentation
|
;; we need indentation
|
||||||
(setq ;org-startup-indented t
|
(setq org-startup-indented t
|
||||||
org-indent-mode-turns-on-hiding-stars nil
|
org-indent-mode-turns-on-hiding-stars nil
|
||||||
org-hide-leading-stars nil
|
org-hide-leading-stars nil
|
||||||
org-startup-folded 'content)
|
org-startup-folded 'content)
|
||||||
;; default agenda files
|
;; default agenda files
|
||||||
(setq org-agenda-files (cond ((string= oxa-workplace "home") '("~/nextcloud/org/"
|
(setq org-agenda-files (cond ((string= oxa-workplace "home") '("~/org/"
|
||||||
"~/nextcloud/org/phone/"
|
|
||||||
"~/Seafile/ORG/"))
|
"~/Seafile/ORG/"))
|
||||||
((string= oxa-workplace "work") '("D:/Seafile/ORG/"))))
|
((string= oxa-workplace "work") '("D:/Seafile/ORG/"))))
|
||||||
;; default agenda view
|
;; default agenda view
|
||||||
|
@ -224,13 +233,13 @@
|
||||||
(setq org-capture-templates
|
(setq org-capture-templates
|
||||||
(cond ((string= oxa-workplace "home")
|
(cond ((string= oxa-workplace "home")
|
||||||
'(("t" "TODO" entry
|
'(("t" "TODO" entry
|
||||||
(file+headline "~/nextcloud/org/random.org" "Tasks")
|
(file+headline "~/org/random.org" "Tasks")
|
||||||
"** TODO %?\n%i")
|
"** TODO %?\n%i")
|
||||||
("T" "TODO+file" entry
|
("T" "TODO+file" entry
|
||||||
(file+headline "~/nextcloud/org/random.org" "Tasks")
|
(file+headline "~/org/random.org" "Tasks")
|
||||||
"** TODO %?\n%i\n%a")
|
"** TODO %?\n%i\n%a")
|
||||||
("n" "note" entry
|
("n" "note" entry
|
||||||
(file+headline "~/nextcloud/org/random.org" "Notes")
|
(file+headline "~/org/random.org" "Notes")
|
||||||
"** %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
"** %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
||||||
("W" "IFW TODO" entry
|
("W" "IFW TODO" entry
|
||||||
(file+headline "~/Seafile/ORG/ifw.org" "ifw-tasks")
|
(file+headline "~/Seafile/ORG/ifw.org" "ifw-tasks")
|
||||||
|
@ -239,10 +248,10 @@
|
||||||
(file+headline "~/Seafile/ORG/ifw.org" "ifw-notes")
|
(file+headline "~/Seafile/ORG/ifw.org" "ifw-notes")
|
||||||
"** %?\n%i\n%U\n:PROPERTIES:\n:CREATED: %U\n:END:\n")
|
"** %?\n%i\n%U\n:PROPERTIES:\n:CREATED: %U\n:END:\n")
|
||||||
("j" "Journal" entry
|
("j" "Journal" entry
|
||||||
(file+olp+datetree "~/nextcloud/org/log.org.gpg")
|
(file+olp+datetree "~/org/log.org.gpg")
|
||||||
"**** %U %?\n")
|
"**** %U %?\n")
|
||||||
("b" "Bookmark" entry
|
("b" "Bookmark" entry
|
||||||
(file+headline "~/nextcloud/org/bookmarks.org" "bookmarks-inbox")
|
(file+headline "~/org/bookmarks.org" "bookmarks-inbox")
|
||||||
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n[[%x]]\n")))
|
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n[[%x]]\n")))
|
||||||
((string= oxa-workplace "work")
|
((string= oxa-workplace "work")
|
||||||
'(("t" "IFW TODO" entry
|
'(("t" "IFW TODO" entry
|
||||||
|
@ -275,6 +284,25 @@
|
||||||
;; abbrev expansion in org-mode
|
;; abbrev expansion in org-mode
|
||||||
(require 'org-tempo))
|
(require 'org-tempo))
|
||||||
|
|
||||||
|
(use-package org-roam
|
||||||
|
:straight t
|
||||||
|
:after org
|
||||||
|
:bind (:map oxamap
|
||||||
|
("r t" . org-roam-dailies-goto-today)
|
||||||
|
("r f" . org-roam-node-find)
|
||||||
|
("r o" . org-roam-node-visit)
|
||||||
|
("r i" . org-roam-node-insert)
|
||||||
|
("r c" . org-roam-capture)
|
||||||
|
("r b" . org-roam-buffer-toggle))
|
||||||
|
:hook ('after-init-hook . 'org-roam-mode)
|
||||||
|
:init
|
||||||
|
(setq org-roam-directory "~/roam"
|
||||||
|
org-roam-v2-ack t
|
||||||
|
org-roam-completion-system 'ido
|
||||||
|
org-roam-completion-everywhere t)
|
||||||
|
:config
|
||||||
|
(org-roam-db-autosync-mode 1))
|
||||||
|
|
||||||
(use-package org-download
|
(use-package org-download
|
||||||
:straight t
|
:straight t
|
||||||
:init (setq org-download-method 'directory
|
:init (setq org-download-method 'directory
|
||||||
|
@ -287,17 +315,12 @@
|
||||||
("C-x g" . magit-status)))
|
("C-x g" . magit-status)))
|
||||||
|
|
||||||
;; I positively cannot spell :D
|
;; I positively cannot spell :D
|
||||||
(use-package ispell
|
(setq-default ispell-program-name (if (string= oxa-workplace "work")
|
||||||
:defer t
|
oxa-work-aspell
|
||||||
:config
|
"hunspell"))
|
||||||
(setq-default ispell-program-name (if (string= oxa-workplace "work")
|
|
||||||
oxa-work-aspell
|
|
||||||
"aspell")))
|
|
||||||
|
|
||||||
(use-package flyspell
|
(use-package flyspell
|
||||||
:straight t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:diminish t
|
|
||||||
:hook (('text-mode . (lambda () (flyspell-mode 1)))
|
:hook (('text-mode . (lambda () (flyspell-mode 1)))
|
||||||
('change-log-mode . (lambda () (flyspell-mode -1)))
|
('change-log-mode . (lambda () (flyspell-mode -1)))
|
||||||
('log-edit-mode . (lambda () (flyspell-mode -1)))
|
('log-edit-mode . (lambda () (flyspell-mode -1)))
|
||||||
|
@ -312,8 +335,6 @@
|
||||||
:init
|
:init
|
||||||
(setq comment-tags-require-colon 0))
|
(setq comment-tags-require-colon 0))
|
||||||
|
|
||||||
(use-package ibuffer
|
|
||||||
:bind ("C-x C-b" . ibuffer))
|
|
||||||
|
|
||||||
(use-package expand-region
|
(use-package expand-region
|
||||||
:straight t
|
:straight t
|
||||||
|
@ -326,56 +347,48 @@
|
||||||
:init
|
:init
|
||||||
(setq vterm-kill-buffer-on-exit t)))
|
(setq vterm-kill-buffer-on-exit t)))
|
||||||
|
|
||||||
(use-package racket-mode
|
;; checking
|
||||||
:straight t
|
(straight-use-package 'flycheck)
|
||||||
:defer t
|
(global-flycheck-mode)
|
||||||
:mode "\\.rkt\\'")
|
|
||||||
|
|
||||||
(use-package scheme-mode
|
;; language support and settings
|
||||||
:defer t
|
(straight-use-package 'nix-mode)
|
||||||
:init (setq scheme-program-name "petite"))
|
(straight-use-package 'markdown-mode)
|
||||||
|
(straight-use-package 'editorconfig)
|
||||||
|
|
||||||
(use-package flycheck
|
;; scheming
|
||||||
:straight t
|
(straight-use-package 'racket-mode)
|
||||||
:init (global-flycheck-mode))
|
(setq scheme-program-name "petite")
|
||||||
|
;; make lambda lambda :D
|
||||||
|
(add-hook 'scheme-mode-hook 'prettify-symbols-mode)
|
||||||
|
(add-hook 'inferior-scheme-mode-hook 'prettify-symbols-mode)
|
||||||
|
(add-hook 'racket-mode-hook 'prettify-symbols-mode)
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'prettify-symbols-mode)
|
||||||
|
|
||||||
(use-package nix-mode
|
;; python
|
||||||
:straight t
|
|
||||||
:defer t
|
|
||||||
:mode "\\.nix\\'")
|
|
||||||
|
|
||||||
(use-package markdown-mode
|
|
||||||
:straight t
|
|
||||||
:defer t
|
|
||||||
:mode (("README\\.md\\'" . gfm-mode)
|
|
||||||
("\\.md\\'" . markdown-mode)
|
|
||||||
("\\.markdown\\'" . markdown-mode)))
|
|
||||||
|
|
||||||
(if (not (string= system-type "windows-nt"))
|
|
||||||
(use-package direnv
|
|
||||||
:straight t
|
|
||||||
:config
|
|
||||||
(direnv-mode)))
|
|
||||||
|
|
||||||
(use-package editorconfig
|
|
||||||
:straight t
|
|
||||||
:diminish t
|
|
||||||
:config
|
|
||||||
(editorconfig-mode 1)
|
|
||||||
(diminish 'editorconfig-mode))
|
|
||||||
|
|
||||||
(use-package nyan-mode
|
|
||||||
:straight t
|
|
||||||
:config
|
|
||||||
(nyan-mode 1))
|
|
||||||
|
|
||||||
;; python stuff
|
|
||||||
(setq python-shell-interpreter "python")
|
(setq python-shell-interpreter "python")
|
||||||
(setq python-shell-interpreter-args "-m IPython --simple-prompt -i")
|
(setq python-shell-interpreter-args "-m IPython --simple-prompt -i")
|
||||||
(setq flycheck-python-pycompile-executable "python")
|
(setq flycheck-python-pycompile-executable "python")
|
||||||
|
|
||||||
|
;;; Interface
|
||||||
;; fill column
|
;; fill column
|
||||||
(setq-default fill-column 80)
|
(setq-default fill-column 80)
|
||||||
|
|
||||||
|
(straight-use-package 'nyan-mode)
|
||||||
|
(nyan-mode 1)
|
||||||
|
|
||||||
|
(straight-use-package 'direnv)
|
||||||
|
(direnv-mode)
|
||||||
|
|
||||||
|
(straight-use-package 'which-key)
|
||||||
|
(which-key-mode)
|
||||||
|
|
||||||
|
(straight-use-package 'yasnippet)
|
||||||
|
(yas-global-mode 1)
|
||||||
|
|
||||||
|
(use-package ess
|
||||||
|
:straight t)
|
||||||
|
|
||||||
;; use lsp if we have nativecomp - without it it's too slow :(
|
;; use lsp if we have nativecomp - without it it's too slow :(
|
||||||
(if oxa/using-native-comp
|
(if oxa/using-native-comp
|
||||||
(progn
|
(progn
|
||||||
|
@ -393,6 +406,9 @@
|
||||||
(use-package lsp-ui :straight t :commands lsp-ui-mode)
|
(use-package lsp-ui :straight t :commands lsp-ui-mode)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(when (require 'pdf-tools nil 'noerror)
|
||||||
|
(pdf-loader-install))
|
||||||
|
|
||||||
;; I use custom vars for local config, so let's put them to separate file, where
|
;; I use custom vars for local config, so let's put them to separate file, where
|
||||||
;; it's easier for git to ignore it
|
;; it's easier for git to ignore it
|
||||||
(setq custom-file "~/.emacs.d/custom.el")
|
(setq custom-file "~/.emacs.d/custom.el")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue