ts -> normal modes

This commit is contained in:
Aleksandr Lebedev 2026-04-26 15:58:15 +02:00
parent 6ff414839c
commit ca80ee6a82
2 changed files with 19 additions and 35 deletions

View file

@ -513,48 +513,33 @@ DIR must include a .project file to be considered a project."
:config
(direnv-mode))
(defun kylekrein/project-enable-direnv-flake ()
"Add `use flake` to .envrc and run `direnv allow` in the project root."
(defun kylekrein/project-enable-direnv-guix ()
"Add `use guix` to .envrc and run `direnv allow` in the project root."
(interactive)
(let* ((project (project-current t))
(root (project-root project))
(envrc-path (expand-file-name ".envrc" root)))
(unless (file-exists-p envrc-path)
(with-temp-buffer
(insert "use flake\n")
(insert "use guix\n")
(write-file envrc-path)))
(unless (string-match-p "use flake" (with-temp-buffer
(unless (string-match-p "use guix" (with-temp-buffer
(insert-file-contents envrc-path)
(buffer-string)))
(with-temp-buffer
(insert-file-contents envrc-path)
(goto-char (point-max))
(insert "\nuse flake\n")
(insert "\nuse guix\n")
(write-file envrc-path)))
(let ((default-directory root))
(direnv-allow))
(message "Added 'use flake' to .envrc and ran direnv allow in %s" root)))
(message "Added 'use guix' to .envrc and ran direnv allow in %s" root)))
(use-package glsl-mode
:ensure t)
(add-to-list 'auto-mode-alist '("\\.rml\\'" . html-ts-mode))
(add-to-list 'auto-mode-alist '("\\.rcss\\'" . css-ts-mode))
(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-ts-mode))
(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-ts-mode))
(use-package zig-mode
:ensure t)
(autoload 'zig-mode "zig-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.\\(zig\\|zon\\)\\'" . zig-mode))
(use-package treesit-auto
:ensure t
:demand t
:config
(global-treesit-auto-mode))
(add-to-list 'auto-mode-alist '("\\.rml\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.rcss\\'" . css-mode))
(use-package eldoc
:init
@ -580,7 +565,7 @@ DIR must include a .project file to be considered a project."
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'((c-ts-mode c++-ts-mode)
'((c-mode c++-mode)
. ("clangd"
"-j=8"
"--log=error"
@ -592,8 +577,8 @@ DIR must include a .project file to be considered a project."
"--pch-storage=memory"
"--header-insertion=never"
"--header-insertion-decorators=0")))
(add-hook 'c-ts-mode-hook #'eglot-ensure)
(add-hook 'c++-ts-mode-hook #'eglot-ensure))
(add-hook 'c-mode-hook #'eglot-ensure)
(add-hook 'c++-mode-hook #'eglot-ensure))
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
@ -620,15 +605,15 @@ DIR must include a .project file to be considered a project."
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(csharp-ts-mode
'(csharp-mode
. ("csharp-ls")))
(add-hook 'csharp-ts-mode-hook #'eglot-ensure))
(add-hook 'csharp-mode-hook #'eglot-ensure))
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(python-ts-mode
'(python-mode
. ("ty")))
(add-hook 'python-ts-mode-hook #'eglot-ensure))
(add-hook 'python-mode-hook #'eglot-ensure))
(use-package nerd-icons
:ensure t
@ -1030,8 +1015,6 @@ one, an error is signaled."
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (nerd-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config)
@ -1041,9 +1024,6 @@ one, an error is signaled."
(unless (kylekrein/detect-wsl)
(add-to-list 'default-frame-alist '(alpha-background . 90))) ; For all new frames henceforth
(use-package sudo-edit
:ensure t)
(use-package which-key
:ensure t
:init

View file

@ -12,6 +12,7 @@
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages wm)
#:use-module (gnu packages audio)
#:use-module (gnu packages video)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg)
#:use-module (gnu packages monitoring)
@ -21,6 +22,7 @@
#:use-module (gnu packages golang)
#:use-module (gnu packages rust-apps)
#:use-module (gnu packages qt)
#:use-module (gnu packages messaging)
#:use-module (gnu packages glib)
#:use-module (gnu packages linux)
#:use-module (gnu packages gnome)
@ -60,6 +62,7 @@ librewolf
emacs-pgtk
alacritty
git
pidgin
ark
cliphist
quickshell
@ -68,6 +71,7 @@ stow
pavucontrol
nautilus
neochat
yt-dlp
ripgrep
;additional apps and dependencies
xdg-desktop-portal-gtk