updated configuration
This commit is contained in:
194
config.el
194
config.el
@@ -1,5 +1,6 @@
|
|||||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; Theme / UI
|
;; Theme / UI
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
@@ -18,69 +19,88 @@
|
|||||||
select-enable-primary t
|
select-enable-primary t
|
||||||
inhibit-splash-screen t)
|
inhibit-splash-screen t)
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; ;; --------------------------------------------------
|
||||||
;; Completion (Company) – minimum, bezpečné
|
;; ;; Completion (Company) – minimum, bezpečné
|
||||||
;; --------------------------------------------------
|
;; ;; --------------------------------------------------
|
||||||
(after! company
|
;; (after! company
|
||||||
(setq company-idle-delay 0.1
|
;; (setq company-idle-delay 0.1
|
||||||
company-minimum-prefix-length 2
|
;; company-minimum-prefix-length 2
|
||||||
company-selection-wrap-around t
|
;; company-selection-wrap-around t
|
||||||
company-tooltip-limit 14
|
;; company-tooltip-limit 14
|
||||||
company-show-numbers t
|
;; company-show-numbers t
|
||||||
company-require-match nil)
|
;; company-require-match nil)
|
||||||
|
|
||||||
;; Spolehlivé vyvolání v TTY
|
;; ;; Spolehlivé vyvolání v TTY
|
||||||
(map! :i "C-." #'company-complete
|
;; (map! :i "C-." #'company-complete
|
||||||
:n "C-." #'company-complete))
|
;; :n "C-." #'company-complete))
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; ;; --------------------------------------------------
|
||||||
;; Robustní file completion "kdekoliv pod kurzorem"
|
;; ;; Robustní file completion "kdekoliv pod kurzorem"
|
||||||
;; --------------------------------------------------
|
;; ;; --------------------------------------------------
|
||||||
(defun martin/complete-file-name-at-point ()
|
;; (defun martin/complete-file-name-at-point ()
|
||||||
"Doplň název souboru kolem kurzoru pomocí standardní file completion tabulky.
|
;; "Doplň název souboru kolem kurzoru pomocí standardní file completion tabulky.
|
||||||
|
|
||||||
Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
;; Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
||||||
(interactive)
|
;; (interactive)
|
||||||
(let* ((stop-chars '(?\s ?\t ?\n ?\r ?\" ?\' ?\( ?\) ?\[ ?\] ?\< ?\> ?\{ ?\} ?, ?\; ))
|
;; (let* ((stop-chars '(?\s ?\t ?\n ?\r ?\" ?\' ?\( ?\) ?\[ ?\] ?\< ?\> ?\{ ?\} ?, ?\; ))
|
||||||
(start (save-excursion
|
;; (start (save-excursion
|
||||||
(while (and (> (point) (point-min))
|
;; (while (and (> (point) (point-min))
|
||||||
(let ((c (char-before)))
|
;; (let ((c (char-before)))
|
||||||
(and c (not (memq c stop-chars)))))
|
;; (and c (not (memq c stop-chars)))))
|
||||||
(backward-char))
|
;; (backward-char))
|
||||||
(point)))
|
;; (point)))
|
||||||
(end (save-excursion
|
;; (end (save-excursion
|
||||||
(while (and (< (point) (point-max))
|
;; (while (and (< (point) (point-max))
|
||||||
(let ((c (char-after)))
|
;; (let ((c (char-after)))
|
||||||
(and c (not (memq c stop-chars)))))
|
;; (and c (not (memq c stop-chars)))))
|
||||||
(forward-char))
|
;; (forward-char))
|
||||||
(point))))
|
;; (point))))
|
||||||
(when (= start end)
|
;; (when (= start end)
|
||||||
(setq start (point) end (point)))
|
;; (setq start (point) end (point)))
|
||||||
(let ((completion-category-defaults nil)
|
;; (let ((completion-category-defaults nil)
|
||||||
(completion-category-overrides '((file (styles basic partial-completion)))))
|
;; (completion-category-overrides '((file (styles basic partial-completion)))))
|
||||||
(completion-in-region start end #'completion-file-name-table))))
|
;; (completion-in-region start end #'completion-file-name-table))))
|
||||||
|
|
||||||
(map! :i "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)
|
;; :n "C-c f" #'martin/complete-file-name-at-point)
|
||||||
|
|
||||||
(after! markdown-mode
|
;; (after! markdown-mode
|
||||||
(add-hook 'markdown-mode-hook (lambda () (setq-local company-minimum-prefix-length 1)))
|
;; (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))))
|
;; (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)
|
;; ORG (Doom-friendly, minimal, bez zbytečných menu)
|
||||||
;; ------------------------------------------------------------
|
;; ------------------------------------------------------------
|
||||||
|
|
||||||
(after! org
|
(after! org
|
||||||
|
;; 0) require packages
|
||||||
|
(require 'ox-hugo)
|
||||||
;; 1) Kde máš org soubory
|
;; 1) Kde máš org soubory
|
||||||
;; Uprav si cestu podle sebe. Tohle je typický Doom default.
|
;; Uprav si cestu podle sebe. Tohle je typický Doom default.
|
||||||
(setq org-directory "~/org/")
|
(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
|
(setq org-todo-keywords
|
||||||
'((sequence "TODO(t)" "NEXT(n)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELLED(c@)")))
|
'((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
|
;; Pomocná funkce: vrátí plnou cestu k souboru v org-directory
|
||||||
(defun ms/org-file (name)
|
(defun ms/org-file (name)
|
||||||
"Return absolute path to NAME inside `org-directory`."
|
"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á)
|
;; ať se po capture vrací do stejného okna (někomu pomáhá)
|
||||||
(setq org-capture-restore-window-after-quit t))
|
(setq org-capture-restore-window-after-quit t))
|
||||||
|
|
||||||
|
(after! org
|
||||||
|
(add-hook 'org-export-before-processing-hook
|
||||||
|
(lambda (_backend)
|
||||||
|
(org-update-all-dblocks))))
|
||||||
|
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; Dired
|
;; Dired
|
||||||
@@ -289,14 +314,15 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
:models (my/openwebui-models)))
|
:models (my/openwebui-models)))
|
||||||
|
|
||||||
;; 4) Default model: ekonomický a praktický
|
;; 4) Default model: ekonomický a praktický
|
||||||
;; Preferuj openai/gpt-4o-mini (levný, rychlý), jinak první dostupný model.
|
;; Preferuj openai/gpt-5.2-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}
|
;; (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))
|
(let* ((models (my/openwebui-models))
|
||||||
(preferred "openai/gpt-4o-mini"))
|
(preferred "openai/gpt-5-mini"))
|
||||||
(setq gptel-model (if (member preferred models)
|
(setq gptel-model (if (member preferred models)
|
||||||
preferred
|
preferred
|
||||||
(car models))))
|
(car models))))
|
||||||
|
|
||||||
|
|
||||||
;; 5) Presety (rychlé přepínání podle úlohy) :contentReference[oaicite:3]{index=3}
|
;; 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.
|
;; Pozn.: Presety jen nastavují model/backend/system atd. – žádná magie navíc.
|
||||||
(gptel-make-preset 'fast
|
(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"
|
(setq user-mail-address "martin@sukany.cz"
|
||||||
user-full-name "Martin Sukany")
|
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
|
;;; 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
|
;; elfeed-org musí být inicializovaný, jinak se elfeed.org nemusí načítat
|
||||||
(require 'elfeed-org)
|
(require 'elfeed-org)
|
||||||
(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))
|
||||||
|
|||||||
3
init.el
3
init.el
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
(doom! :input
|
(doom! :input
|
||||||
:completion
|
:completion
|
||||||
company
|
;;company
|
||||||
|
corfu
|
||||||
vertico
|
vertico
|
||||||
|
|
||||||
:app
|
:app
|
||||||
|
|||||||
@@ -53,10 +53,10 @@
|
|||||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||||
;; (unpin! t)
|
;; (unpin! t)
|
||||||
|
|
||||||
|
;; Corfu completion requirements:
|
||||||
;; ;; Copilot
|
(package! cape)
|
||||||
;; (package! copilot
|
(package! kind-icon)
|
||||||
;; :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist")))
|
(package! corfu-terminal)
|
||||||
|
|
||||||
;; GPTEl
|
;; GPTEl
|
||||||
(package! gptel :recipe (:nonrecursive t))
|
(package! gptel :recipe (:nonrecursive t))
|
||||||
|
|||||||
Reference in New Issue
Block a user