switch to ido and some small fixes

This commit is contained in:
Grigory Shipunov 2022-01-25 15:34:11 +01:00
parent 73bc533ebf
commit 087e438558
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C

119
init.el
View file

@ -74,10 +74,6 @@
(straight-use-package 'nyan-mode) (straight-use-package 'nyan-mode)
(nyan-mode 1) (nyan-mode 1)
(straight-use-package 'git-gutter)
(global-git-gutter-mode 1)
(diminish 'git-gutter-mode)
(straight-use-package 'which-key) (straight-use-package 'which-key)
(which-key-mode) (which-key-mode)
(diminish 'which-key-mode) (diminish 'which-key-mode)
@ -105,9 +101,17 @@
(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)
(straight-use-package 'color-theme-sanityinc-tomorrow) (use-package modus-themes
(load-theme 'sanityinc-tomorrow-night t nil) :straight t
(color-theme-sanityinc-tomorrow-night) :init
(setq modus-themes-italic-constructs t
modus-themes-bold-constructs t
modus-themes-mixed-fonts nil
modus-themes-subtle-line-numbers t)
(modus-themes-load-themes)
:config
(modus-themes-load-operandi)
:bind (:map oxamap ("\\" . modus-themes-toggle)))
;; 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)
@ -121,7 +125,7 @@
"Function to enable tab indentation in buffer." "Function to enable tab indentation in buffer."
(setq indent-tabs-mode t)) (setq indent-tabs-mode t))
(add-hook 'cc-mode-hook 'tabs-yay) (add-hook 'c-mode-hook 'tabs-yay)
;; highlight the parens ;; highlight the parens
(setq show-paren-delay 0) (setq show-paren-delay 0)
@ -138,13 +142,31 @@
version-control t) version-control t)
;; completion framework ;; completion framework
(straight-use-package 'ivy) (use-package ido
(ivy-mode 1) :init
(diminish 'ivy-mode) (setq ido-enable-flex-matching t)
(straight-use-package 'counsel) (setq ido-everywhere t)
(counsel-mode 1) (setq ido-auto-merge-work-directories-length -1)
(diminish 'counsel-mode) (setq ido-use-filename-at-point 'guess)
(global-set-key (kbd "M-s M-s") 'swiper) (setq ido-create-new-buffer 'always)
(setq ido-file-extensions-order
'(".org" ".scm" ".rkt" ".py" ".jl" ".txt" ".tex" ".bib"))
:config
(ido-mode t)
(ido-everywhere t))
(use-package smex
:straight t
:commands (smex
emex-major-mode-commands)
:bind (("M-x" . smex)
("M-X" . smex-major-mode-commands))
:config (smex-initialize))
(use-package ido-completing-read+
:straight t
:after ido
:config (ido-ubiquitous-mode 1))
;; autocompletion by default ;; autocompletion by default
(straight-use-package 'company) (straight-use-package 'company)
@ -162,7 +184,7 @@
(awk-mode . "awk") (awk-mode . "awk")
(c-mode . "linux") (c-mode . "linux")
(c++-mode . "stroustrup") (c++-mode . "stroustrup")
(other . "linux"))) (other . "stroustrup")))
(require 'calendar) (require 'calendar)
(setq calendar-week-start-day 1) (setq calendar-week-start-day 1)
@ -176,15 +198,23 @@
:defer t :defer t
:straight auctex :straight auctex
:init :init
;; reftex
(require 'reftex) (require 'reftex)
;; basic config
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode) (add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)
(add-hook 'LaTeX-mode-hook 'reftex-mode) (add-hook 'LaTeX-mode-hook 'reftex-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
:config
(setq TeX-parse-self t) (setq TeX-parse-self t)
(setq reftex-plug-into-AUCTeX t) (setq reftex-plug-into-AUCTeX t)
;; preview
(setq TeX-view-program-selection '((output-pdf "PDF Tools")) (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-surce-correlate-start-server t) TeX-source-correlate-mode t
TeX-source-correlate-start-server t)
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
;; completion for LaTeX ;; completion for LaTeX
(use-package company-auctex (use-package company-auctex
:straight t :straight t
@ -202,6 +232,8 @@
(use-package org (use-package org
:straight t :straight t
:commands (org-agenda
org-capture)
: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)
@ -209,10 +241,10 @@
("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 nil
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 'fold) org-startup-folded 'content)
;; default agenda files ;; default agenda files
(setq org-agenda-files (cond ((string= oxa-workplace "home") '("~/org/" (setq org-agenda-files (cond ((string= oxa-workplace "home") '("~/org/"
"~/Seafile/ORG/")) "~/Seafile/ORG/"))
@ -226,6 +258,9 @@
'(("n" "note" entry '(("n" "note" entry
(file+headline "~/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")
("t" "TODO" entry
(file+headline "~/org/random.org" "Tasks")
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
("w" "IFW Note" entry ("w" "IFW Note" entry
(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")
@ -234,14 +269,7 @@
"**** %U %?\n") "**** %U %?\n")
("b" "Bookmark" entry ("b" "Bookmark" entry
(file+headline "~/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")
'(("t" "IFW TODO" entry
(file+headline "D:/Seafile/ORG/ifw.org" "ifw-tasks")
"** TODO %?\n%i\n%U")
("n" "IFW Note" entry
(file+headline "D:/Seafile/ORG/ifw.org" "ifw-notes")
"** %?\n%i\n%U\n")))))
;; autosave advises for agenda and org-capture ;; autosave advises for agenda and org-capture
(advice-add 'org-agenda-quit :before 'org-save-all-org-buffers) (advice-add 'org-agenda-quit :before 'org-save-all-org-buffers)
(advice-add 'org-capture-finalize :after 'org-save-all-org-buffers) (advice-add 'org-capture-finalize :after 'org-save-all-org-buffers)
@ -249,11 +277,20 @@
;; latex preview settings ;; latex preview settings
(setq org-preview-latex-image-directory "~/.emacs.d/org-latex-preview/") ; Hide all previews in one place (setq org-preview-latex-image-directory "~/.emacs.d/org-latex-preview/") ; Hide all previews in one place
;; habits support
(require 'org-habit)
(add-to-list 'org-modules 'org-habit)
;; babel
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)))
;; org-id - link by UUID ;; org-id - link by UUID
(require 'org-id) (require 'org-id)
(setq org-id-method 'uuid (setq org-id-method 'uuid
org-id-link-to-org-use-id t) org-id-link-to-org-use-id t)
:config
;; abbrev expansion in org-mode ;; abbrev expansion in org-mode
(require 'org-tempo)) (require 'org-tempo))
@ -265,6 +302,7 @@
(use-package magit (use-package magit
:straight t :straight t
:init (setq magit-completing-read-function 'magit-ido-completing-read)
:bind (("C-x G" . magit-dispatch) :bind (("C-x G" . magit-dispatch)
("C-x g" . magit-status))) ("C-x g" . magit-status)))
@ -307,11 +345,21 @@
(use-package ess (use-package ess
:straight t :straight t
:init :init
(setq ess-use-ido t)
(setq ess-use-flymake nil)) (setq ess-use-flymake nil))
(use-package poly-R (use-package poly-R
:straight t) :straight t)
;; Julia
(use-package julia-mode
:straight t)
(use-package julia-snail
:straight t
:after vterm
:hook (julia-mode . julia-snail-mode))
;; scheming ;; scheming
;; (use-package racket-mode ;; (use-package racket-mode
;; :straight t) ;; :straight t)
@ -321,6 +369,10 @@
(use-package scheme (use-package scheme
:init (setq scheme-program-name "petite")) :init (setq scheme-program-name "petite"))
(use-package slime
:straight t
:config
(setq inferior-lisp-program "sbcl"))
;; make lambda lambda :D ;; make lambda lambda :D
(add-hook 'scheme-mode-hook 'prettify-symbols-mode) (add-hook 'scheme-mode-hook 'prettify-symbols-mode)
@ -345,16 +397,13 @@
(yas-global-mode t) (yas-global-mode t)
(diminish 'yas-minor-mode) (diminish 'yas-minor-mode)
;; projectile
(use-package projectile
:straight t
:commands projectile-command-map
:bind (:map oxamap ("p" . projectile-command-map)))
;; 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")
(load custom-file 'noerror) (load custom-file 'noerror)
;; start server
(server-start)
(provide 'init) (provide 'init)
;;; init.el ends here ;;; init.el ends here