changes here and there

This commit is contained in:
2025-11-19 09:22:40 +01:00
parent 6a9a4068a0
commit bd42d183bc
9 changed files with 71 additions and 22 deletions

View File

@@ -1,20 +1,32 @@
;; *** C
(use-package c-mode
:ensure nil ;; installed in site-lisp
:defer nil
;; doesn't work in emacs 30 anymore
(when nil (use-package c-mode
:ensure nil ;; installed in site-lisp
:defer nil
:init
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
:init
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command)))))
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command))))))
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command))))
(provide 'init-c)
;;; init-c.el ends here

11
lisp/init-elvish.el Normal file
View File

@@ -0,0 +1,11 @@
(use-package elvish-mode
:mode "\\.elv\\'"
:config
(setq tab-width 2
elvish-indent-level 2
elvish-indent-string-contents t))
(provide 'init-elvish)
;;; init-elvish.el ends here

View File

@@ -11,7 +11,7 @@
;; custom prompt, which resembles my bash prompt
(defun shk-eshell-prompt ()
(let ((header-bg "Azure"))
(let ((header-bg "White"))
(concat
(with-face "\n")
(with-face (format-time-string
@@ -23,9 +23,9 @@
(ignore-errors (format "(%s)" (vc-responsible-backend default-directory)))
"") :background header-bg)
(with-face "\n" :background header-bg)
(with-face user-login-name :foreground "blue")
(with-face user-login-name :foreground "DarkOrange")
"@"
(with-face "localhost" :foreground "blue")
(with-face "localhost" :foreground "DarkOrange")
(if (= (user-uid) 0)
(with-face " #" :foreground "red")
" $")
@@ -209,6 +209,9 @@ a list symbol describing the command."
;; no need for less or more, this is emacs, isn't it?
(setenv "PAGER" "cat")
;; much better replacement for eshell!
(use-package vterm
:ensure t)
(provide 'init-eshell)
;;; init-eshell.el ends here

View File

@@ -21,7 +21,7 @@
(global-set-key (kbd "C-<delete>") 'kill-word) ; Shift+Entf dito
(global-set-key (kbd "C-<backspace>") 'backward-kill-word) ; Shift+Backspace dito
(global-unset-key (kbd "C-z"))
(global-set-key (kbd "C-x k") 'kill-this-buffer) ; C-x k really kill current buffer w/o asking
(global-set-key (kbd "C-x k") 'kill-current-buffer) ; C-x k really kill current buffer w/o asking
(global-set-key (kbd "C-x C-b") 'buffer-menu)

View File

@@ -82,7 +82,7 @@
(add-hook 'org-present-after-navigate-functions 'tvd/org-present-prepare-slide)
(define-key org-present-mode-keymap (kbd "q") 'org-present-quit)
(define-key org-present-mode-keymap (kbd "<home>") 'org-present-top)
(define-key org-present-mode-keymap (kbd "<home>") 'org-present-beginning)
(define-key org-present-mode-keymap (kbd "<end>") 'org-present-end))
(use-package visual-fill-column

View File

@@ -202,6 +202,13 @@ down and unfold it, otherwise jump paragraph as usual."
(when (fboundp 'org-bullets-mode)
(org-bullets-mode 1))
;; during some update org-mode went to enable
;; default variable pitch font, which I hate hate
;; hate. I want to have a font with fixed font
;; spacing (called fixed-pitch), so I disable the
;; variable-fuck font here once and for all. Dammit.
(variable-pitch-mode -1)
(org-babel-do-load-languages 'org-babel-load-languages
'((python . t)
(emacs-lisp . t)
@@ -213,8 +220,6 @@ down and unfold it, otherwise jump paragraph as usual."
;; no more ... at the end of a heading
(setq org-ellipsis "")
;; use mono spaced font in src blocks
(set-face-attribute 'org-block nil :inherit 'fixed-pitch)
(setq org-activate-links '(plain radio tag date footnote))
;; my own keywords, must be set globally, not catched correctly inside hook

16
lisp/init-typst.el Normal file
View File

@@ -0,0 +1,16 @@
;; https://codeberg.org/meow_king/typst-ts-mode
(use-package typst-ts-mode
:mode "\\.typ\\'"
;; after installation, execute manually:
;; typst-ts-mc-install-grammar
:config
(setq tab-width 4
typst-indent-level 4
typst-indent-string-contents t))
(provide 'init-typst)
;;; init-typst.el ends here