updated configuration
This commit is contained in:
194
config.el
194
config.el
@@ -1,5 +1,6 @@
|
||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
|
||||
;; --------------------------------------------------
|
||||
;; Theme / UI
|
||||
;; --------------------------------------------------
|
||||
@@ -18,69 +19,88 @@
|
||||
select-enable-primary t
|
||||
inhibit-splash-screen t)
|
||||
|
||||
;; --------------------------------------------------
|
||||
;; Completion (Company) – minimum, bezpečné
|
||||
;; --------------------------------------------------
|
||||
(after! company
|
||||
(setq company-idle-delay 0.1
|
||||
company-minimum-prefix-length 2
|
||||
company-selection-wrap-around t
|
||||
company-tooltip-limit 14
|
||||
company-show-numbers t
|
||||
company-require-match nil)
|
||||
;; ;; --------------------------------------------------
|
||||
;; ;; Completion (Company) – minimum, bezpečné
|
||||
;; ;; --------------------------------------------------
|
||||
;; (after! company
|
||||
;; (setq company-idle-delay 0.1
|
||||
;; company-minimum-prefix-length 2
|
||||
;; company-selection-wrap-around t
|
||||
;; company-tooltip-limit 14
|
||||
;; company-show-numbers t
|
||||
;; company-require-match nil)
|
||||
|
||||
;; Spolehlivé vyvolání v TTY
|
||||
(map! :i "C-." #'company-complete
|
||||
:n "C-." #'company-complete))
|
||||
;; ;; Spolehlivé vyvolání v TTY
|
||||
;; (map! :i "C-." #'company-complete
|
||||
;; :n "C-." #'company-complete))
|
||||
|
||||
;; --------------------------------------------------
|
||||
;; Robustní file completion "kdekoliv pod kurzorem"
|
||||
;; --------------------------------------------------
|
||||
(defun martin/complete-file-name-at-point ()
|
||||
"Doplň název souboru kolem kurzoru pomocí standardní file completion tabulky.
|
||||
;; ;; --------------------------------------------------
|
||||
;; ;; Robustní file completion "kdekoliv pod kurzorem"
|
||||
;; ;; --------------------------------------------------
|
||||
;; (defun martin/complete-file-name-at-point ()
|
||||
;; "Doplň název souboru kolem kurzoru pomocí standardní file completion tabulky.
|
||||
|
||||
Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
(interactive)
|
||||
(let* ((stop-chars '(?\s ?\t ?\n ?\r ?\" ?\' ?\( ?\) ?\[ ?\] ?\< ?\> ?\{ ?\} ?, ?\; ))
|
||||
(start (save-excursion
|
||||
(while (and (> (point) (point-min))
|
||||
(let ((c (char-before)))
|
||||
(and c (not (memq c stop-chars)))))
|
||||
(backward-char))
|
||||
(point)))
|
||||
(end (save-excursion
|
||||
(while (and (< (point) (point-max))
|
||||
(let ((c (char-after)))
|
||||
(and c (not (memq c stop-chars)))))
|
||||
(forward-char))
|
||||
(point))))
|
||||
(when (= start end)
|
||||
(setq start (point) end (point)))
|
||||
(let ((completion-category-defaults nil)
|
||||
(completion-category-overrides '((file (styles basic partial-completion)))))
|
||||
(completion-in-region start end #'completion-file-name-table))))
|
||||
;; Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
;; (interactive)
|
||||
;; (let* ((stop-chars '(?\s ?\t ?\n ?\r ?\" ?\' ?\( ?\) ?\[ ?\] ?\< ?\> ?\{ ?\} ?, ?\; ))
|
||||
;; (start (save-excursion
|
||||
;; (while (and (> (point) (point-min))
|
||||
;; (let ((c (char-before)))
|
||||
;; (and c (not (memq c stop-chars)))))
|
||||
;; (backward-char))
|
||||
;; (point)))
|
||||
;; (end (save-excursion
|
||||
;; (while (and (< (point) (point-max))
|
||||
;; (let ((c (char-after)))
|
||||
;; (and c (not (memq c stop-chars)))))
|
||||
;; (forward-char))
|
||||
;; (point))))
|
||||
;; (when (= start end)
|
||||
;; (setq start (point) end (point)))
|
||||
;; (let ((completion-category-defaults nil)
|
||||
;; (completion-category-overrides '((file (styles basic partial-completion)))))
|
||||
;; (completion-in-region start end #'completion-file-name-table))))
|
||||
|
||||
(map! :i "C-c f" #'martin/complete-file-name-at-point
|
||||
:n "C-c f" #'martin/complete-file-name-at-point)
|
||||
;; (map! :i "C-c f" #'martin/complete-file-name-at-point
|
||||
;; :n "C-c f" #'martin/complete-file-name-at-point)
|
||||
|
||||
(after! markdown-mode
|
||||
(add-hook 'markdown-mode-hook (lambda () (setq-local company-minimum-prefix-length 1)))
|
||||
(add-hook 'gfm-mode-hook (lambda () (setq-local company-minimum-prefix-length 1))))
|
||||
;; (after! markdown-mode
|
||||
;; (add-hook 'markdown-mode-hook (lambda () (setq-local company-minimum-prefix-length 1)))
|
||||
;; (add-hook 'gfm-mode-hook (lambda () (setq-local company-minimum-prefix-length 1))))
|
||||
|
||||
;;; ~/.doom.d/config.el --- Org config -*- lexical-binding: t; -*-
|
||||
|
||||
;; ------------------------------------------------------------
|
||||
;; ORG (Doom-friendly, minimal, bez zbytečných menu)
|
||||
;; ------------------------------------------------------------
|
||||
|
||||
(after! org
|
||||
;; 0) require packages
|
||||
(require 'ox-hugo)
|
||||
;; 1) Kde máš org soubory
|
||||
;; Uprav si cestu podle sebe. Tohle je typický Doom default.
|
||||
(setq org-directory "~/org/")
|
||||
(setq org-default-notes-file (expand-file-name "inbox.org" org-directory))
|
||||
|
||||
(setq org-agenda-files (list org-directory
|
||||
(expand-file-name "projects" org-directory)
|
||||
(expand-file-name "roam" org-directory)
|
||||
(expand-file-name "notes" org-directory)))
|
||||
|
||||
(setq org-todo-keywords
|
||||
'((sequence "TODO(t)" "NEXT(n)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELLED(c@)")))
|
||||
|
||||
(setq org-log-done 'time)
|
||||
|
||||
(setq org-refile-targets '((org-agenda-files :maxlevel . 5))
|
||||
org-outline-path-complete-in-steps nil
|
||||
org-refile-use-outline-path 'file)
|
||||
|
||||
(defun my/project-org-file ()
|
||||
"Return path to ./project.org in current Projectile project, if it exists."
|
||||
(when-let ((root (projectile-project-root)))
|
||||
(let ((f (expand-file-name "project.org" root)))
|
||||
(when (file-exists-p f) f))))
|
||||
|
||||
;; Pomocná funkce: vrátí plnou cestu k souboru v org-directory
|
||||
(defun ms/org-file (name)
|
||||
"Return absolute path to NAME inside `org-directory`."
|
||||
@@ -146,6 +166,11 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
;; ať se po capture vrací do stejného okna (někomu pomáhá)
|
||||
(setq org-capture-restore-window-after-quit t))
|
||||
|
||||
(after! org
|
||||
(add-hook 'org-export-before-processing-hook
|
||||
(lambda (_backend)
|
||||
(org-update-all-dblocks))))
|
||||
|
||||
|
||||
;; --------------------------------------------------
|
||||
;; Dired
|
||||
@@ -289,14 +314,15 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
:models (my/openwebui-models)))
|
||||
|
||||
;; 4) Default model: ekonomický a praktický
|
||||
;; Preferuj openai/gpt-4o-mini (levný, rychlý), jinak první dostupný model.
|
||||
;; (GPT-4o mini je běžně uváděn jako “fast, affordable” a na OpenRouter má id openai/gpt-4o-mini) :contentReference[oaicite:2]{index=2}
|
||||
;; Preferuj openai/gpt-5.2-mini (levný, rychlý), jinak první dostupný model.
|
||||
;; (GPT-5.2 mini je běžně uváděn jako “fast, affordable” a na OpenRouter má id openai/gpt-4o-mini) :contentReference[oaicite:2]{index=2}
|
||||
(let* ((models (my/openwebui-models))
|
||||
(preferred "openai/gpt-4o-mini"))
|
||||
(preferred "openai/gpt-5-mini"))
|
||||
(setq gptel-model (if (member preferred models)
|
||||
preferred
|
||||
(car models))))
|
||||
|
||||
|
||||
;; 5) Presety (rychlé přepínání podle úlohy) :contentReference[oaicite:3]{index=3}
|
||||
;; Pozn.: Presety jen nastavují model/backend/system atd. – žádná magie navíc.
|
||||
(gptel-make-preset 'fast
|
||||
@@ -459,6 +485,22 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
(setq user-mail-address "martin@sukany.cz"
|
||||
user-full-name "Martin Sukany")
|
||||
|
||||
(after! mu4e
|
||||
;; thread view
|
||||
(setq mu4e-headers-show-threads t)
|
||||
(setq mu4e-headers-include-related t)
|
||||
|
||||
;; pěkné zobrazení
|
||||
(setq mu4e-headers-fields
|
||||
'((:human-date . 12)
|
||||
(:flags . 6)
|
||||
(:from . 22)
|
||||
(:subject)))
|
||||
|
||||
;; strom vláken (lepší orientace)
|
||||
(setq mu4e-use-fancy-chars t))
|
||||
(after! mu4e
|
||||
(setq mu4e-headers-mark-for-thread t))
|
||||
|
||||
;;; ================================
|
||||
;;; Emacspeak robust ON/OFF for Doom
|
||||
@@ -596,3 +638,61 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||
;; elfeed-org musí být inicializovaný, jinak se elfeed.org nemusí načítat
|
||||
(require 'elfeed-org)
|
||||
(elfeed-org))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; CORFU CONFIGURATION (modern completion UI)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(after! corfu
|
||||
;; automatické completions
|
||||
(setq corfu-auto t
|
||||
corfu-auto-delay 0.15
|
||||
corfu-auto-prefix 2
|
||||
|
||||
;; cyklování kandidátů
|
||||
corfu-cycle t
|
||||
|
||||
;; předvybrat první kandidát
|
||||
corfu-preselect 'prompt
|
||||
|
||||
;; lepší UX
|
||||
corfu-quit-no-match 'separator
|
||||
corfu-preview-current nil)
|
||||
|
||||
;; zapnout globálně
|
||||
(global-corfu-mode))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; CAPE — zdroje completion
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; Corfu
|
||||
(after! corfu
|
||||
(setq corfu-auto t
|
||||
corfu-auto-delay 0.15
|
||||
corfu-auto-prefix 2
|
||||
corfu-cycle t)
|
||||
(global-corfu-mode))
|
||||
|
||||
;;; Cape (zdroje completion-at-point)
|
||||
(use-package! cape
|
||||
:after corfu
|
||||
:config
|
||||
(defun martin/cape-capf-setup ()
|
||||
"Zdroje doplňování použitelné téměř všude (bez LSP)."
|
||||
;; Slova z bufferů
|
||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev 0)
|
||||
;; Cesty k souborům
|
||||
(add-to-list 'completion-at-point-functions #'cape-file 0)
|
||||
;; Keywords (užitečné hlavně v prog-mode)
|
||||
(add-to-list 'completion-at-point-functions #'cape-keyword 0)
|
||||
;; Elisp symboly (jen když píšeš elisp, ale nevadí ani jinde)
|
||||
(add-to-list 'completion-at-point-functions #'cape-elisp-symbol 0))
|
||||
(add-hook 'prog-mode-hook #'martin/cape-capf-setup)
|
||||
(add-hook 'text-mode-hook #'martin/cape-capf-setup))
|
||||
|
||||
;; Corfu popup i v terminálu (iTerm2 / ssh / tmux)
|
||||
(use-package! corfu-terminal
|
||||
:when (not (display-graphic-p))
|
||||
:after corfu
|
||||
:config
|
||||
(corfu-terminal-mode +1))
|
||||
|
||||
Reference in New Issue
Block a user