update
This commit is contained in:
38
config.el
38
config.el
@@ -34,14 +34,13 @@
|
|||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; Robustní file completion "kdekoliv pod kurzorem"
|
;; Robustní file completion "kdekoliv pod kurzorem"
|
||||||
;; Funguje i v Markdown odkazu [x](./tady), protože neřeší kontext – jen token okolo pointu.
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
(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)))
|
||||||
@@ -54,33 +53,19 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
(and c (not (memq c stop-chars)))))
|
(and c (not (memq c stop-chars)))))
|
||||||
(forward-char))
|
(forward-char))
|
||||||
(point))))
|
(point))))
|
||||||
;; Pokud nejsme "na tokenu", vezmi aspoň start=end=point (doplň odtud)
|
|
||||||
(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))))
|
||||||
|
|
||||||
;; Globální klávesa (funguje všude, i v TTY)
|
|
||||||
(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)
|
||||||
|
|
||||||
;; V Markdownu snížíme prefix, ať to jde hned po `./`
|
|
||||||
(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))))
|
||||||
|
|
||||||
;; --------------------------------------------------
|
|
||||||
;; Copilot
|
|
||||||
;; --------------------------------------------------
|
|
||||||
(use-package! copilot
|
|
||||||
:hook (prog-mode . copilot-mode)
|
|
||||||
:bind (:map copilot-completion-map
|
|
||||||
("<tab>" . copilot-accept-completion)
|
|
||||||
("TAB" . copilot-accept-completion)
|
|
||||||
("C-TAB" . copilot-accept-completion-by-word)
|
|
||||||
("C-<tab>" . copilot-accept-completion-by-word)))
|
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; Org
|
;; Org
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
@@ -137,7 +122,7 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
"^" #'dired-up-directory))
|
"^" #'dired-up-directory))
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; PlantUML (server) — TVOJE PŮVODNÍ ČÁST
|
;; PlantUML (server)
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
(add-to-list 'auto-mode-alist '("\\.puml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.puml\\'" . plantuml-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
||||||
@@ -157,7 +142,7 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
(append utf8 nil))))))
|
(append utf8 nil))))))
|
||||||
|
|
||||||
(defun my/plantuml-fix-png-header (file)
|
(defun my/plantuml-fix-png-header (file)
|
||||||
"Odstraní vše před PNG signaturou (řeší \\n před 89 50 4E 47)."
|
"Odstraní vše před PNG signaturou."
|
||||||
(let ((sig (unibyte-string #x89 ?P ?N ?G ?\r ?\n #x1a ?\n)))
|
(let ((sig (unibyte-string #x89 ?P ?N ?G ?\r ?\n #x1a ?\n)))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(set-buffer-multibyte nil)
|
(set-buffer-multibyte nil)
|
||||||
@@ -205,19 +190,14 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
(setq org-babel-python-command "python3")
|
(setq org-babel-python-command "python3")
|
||||||
(require 'ob-python))
|
(require 'ob-python))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
;; Low-vision základ
|
;; Low-vision základ
|
||||||
;; --------------------------------------------------
|
;; --------------------------------------------------
|
||||||
|
(setq doom-font (font-spec :family "JetBrains Mono" :size 20)
|
||||||
;; Větší font + pohodlnější řádkování
|
|
||||||
(setq doom-font (font-spec :family "JetBrains Mono" :size 20) ;; zkus 18–24
|
|
||||||
doom-variable-pitch-font (font-spec :family "SF Pro Text" :size 20))
|
doom-variable-pitch-font (font-spec :family "SF Pro Text" :size 20))
|
||||||
|
|
||||||
(setq-default line-spacing 0.25) ;; 0.20–0.35 dle chuti
|
(setq-default line-spacing 0.25)
|
||||||
|
|
||||||
;; Jednoduché zvětšení/zmenšení textu kdykoliv
|
|
||||||
(map! :n "C-=" #'text-scale-increase
|
(map! :n "C-=" #'text-scale-increase
|
||||||
:n "C--" #'text-scale-decrease
|
:n "C--" #'text-scale-decrease
|
||||||
:n "C-0" #'text-scale-set
|
:n "C-0" #'text-scale-set
|
||||||
@@ -225,8 +205,6 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
:i "C--" #'text-scale-decrease
|
:i "C--" #'text-scale-decrease
|
||||||
:i "C-0" #'text-scale-set)
|
:i "C-0" #'text-scale-set)
|
||||||
|
|
||||||
|
|
||||||
;; Automaticky ukládej org soubory po refilingu a změnách
|
|
||||||
(add-hook 'org-after-refile-insert-hook #'save-buffer)
|
(add-hook 'org-after-refile-insert-hook #'save-buffer)
|
||||||
(add-hook 'org-after-todo-state-change-hook #'save-buffer)
|
(add-hook 'org-after-todo-state-change-hook #'save-buffer)
|
||||||
(add-hook 'org-capture-after-finalize-hook #'save-buffer)
|
(add-hook 'org-capture-after-finalize-hook #'save-buffer)
|
||||||
@@ -236,3 +214,9 @@ Funguje v libovolném textu, včetně Markdown linků (např. [x](./...))."
|
|||||||
(lambda ()
|
(lambda ()
|
||||||
(save-some-buffers t (lambda ()
|
(save-some-buffers t (lambda ()
|
||||||
(derived-mode-p 'org-mode)))))
|
(derived-mode-p 'org-mode)))))
|
||||||
|
|
||||||
|
;; performance tweak
|
||||||
|
(after! projectile
|
||||||
|
(setq projectile-indexing-method 'alien
|
||||||
|
projectile-enable-caching t))
|
||||||
|
|
||||||
|
|||||||
2
init.el
2
init.el
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
:checkers
|
:checkers
|
||||||
syntax
|
syntax
|
||||||
(spell +flyspell)
|
;;(spell +flyspell)
|
||||||
grammar
|
grammar
|
||||||
|
|
||||||
:tools
|
:tools
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
;; (unpin! t)
|
;; (unpin! t)
|
||||||
|
|
||||||
|
|
||||||
;; Copilot
|
;; ;; Copilot
|
||||||
(package! copilot
|
;; (package! copilot
|
||||||
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist")))
|
;; :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist")))
|
||||||
|
|
||||||
|
;; GPTEl
|
||||||
|
(package! gptel :recipe (:nonrecursive t))
|
||||||
|
|||||||
Reference in New Issue
Block a user