Changes
This commit is contained in:
+23
-23
@@ -143,24 +143,24 @@ command.")
|
|||||||
;; reserved words
|
;; reserved words
|
||||||
(command_name
|
(command_name
|
||||||
((word) @font-lock-keyword-face
|
((word) @font-lock-keyword-face
|
||||||
(:match ,(rx-to-string
|
(:match? ,(rx-to-string
|
||||||
`(seq bos
|
`(seq bos
|
||||||
(or ,@(zsh-ts-mode--other-keywords))
|
(or ,@(zsh-ts-mode--other-keywords))
|
||||||
eos))
|
eos))
|
||||||
@font-lock-keyword-face))))
|
@font-lock-keyword-face))))
|
||||||
|
|
||||||
:feature 'command
|
:feature 'command
|
||||||
:language 'zsh
|
:language 'zsh
|
||||||
`(;; builtin commands
|
`(;; builtin commands
|
||||||
(command_name
|
(command_name
|
||||||
((word) @font-lock-builtin-face
|
((word) @font-lock-builtin-face
|
||||||
(:match ,(let ((builtins
|
(:match? ,(let ((builtins
|
||||||
(sh-feature sh-builtins)))
|
(sh-feature sh-builtins)))
|
||||||
(rx-to-string
|
(rx-to-string
|
||||||
`(seq bos
|
`(seq bos
|
||||||
(or ,@builtins)
|
(or ,@builtins)
|
||||||
eos)))
|
eos)))
|
||||||
@font-lock-builtin-face)))
|
@font-lock-builtin-face)))
|
||||||
;; function/non-builtin command calls
|
;; function/non-builtin command calls
|
||||||
(command_name (word) @font-lock-function-name-face))
|
(command_name (word) @font-lock-function-name-face))
|
||||||
|
|
||||||
@@ -182,8 +182,8 @@ command.")
|
|||||||
:override 'prepend
|
:override 'prepend
|
||||||
`((declaration_command
|
`((declaration_command
|
||||||
argument: ((_) @font-lock-variable-name-face
|
argument: ((_) @font-lock-variable-name-face
|
||||||
(:match ,(rx-to-string '(seq bos (not "-")))
|
(:match? ,(rx-to-string '(seq bos (not "-")))
|
||||||
@font-lock-variable-name-face))))
|
@font-lock-variable-name-face))))
|
||||||
|
|
||||||
|
|
||||||
;; let variable declarations (handled differently by the parser)
|
;; let variable declarations (handled differently by the parser)
|
||||||
@@ -192,10 +192,10 @@ command.")
|
|||||||
:override 'prepend
|
:override 'prepend
|
||||||
`((command
|
`((command
|
||||||
(command_name ((word) @ignore
|
(command_name ((word) @ignore
|
||||||
(:equal "let" @ignore)))
|
(:eq? "let" @ignore)))
|
||||||
argument: ((_) @zsh-ts-mode--fontify-let-arg
|
argument: ((_) @zsh-ts-mode--fontify-let-arg
|
||||||
(:match ,(rx-to-string '(seq bos (not "-")))
|
(:match? ,(rx-to-string '(seq bos (not "-")))
|
||||||
@zsh-ts-mode--fontify-let-arg))))
|
@zsh-ts-mode--fontify-let-arg))))
|
||||||
|
|
||||||
:feature 'for-variable
|
:feature 'for-variable
|
||||||
:language 'zsh
|
:language 'zsh
|
||||||
@@ -213,7 +213,7 @@ command.")
|
|||||||
:feature 'number
|
:feature 'number
|
||||||
:language 'zsh
|
:language 'zsh
|
||||||
`(((word) @font-lock-number-face
|
`(((word) @font-lock-number-face
|
||||||
(:match "\\`[0-9]+\\'" @font-lock-number-face))
|
(:match? "\\`[0-9]+\\'" @font-lock-number-face))
|
||||||
((number) @font-lock-number-face))
|
((number) @font-lock-number-face))
|
||||||
|
|
||||||
:feature 'bracket
|
:feature 'bracket
|
||||||
@@ -287,7 +287,7 @@ Return non-nil if NODE is not an anonymous function."
|
|||||||
@var))
|
@var))
|
||||||
((variable_name) @var)
|
((variable_name) @var)
|
||||||
((word) @func
|
((word) @func
|
||||||
(:pred zsh-ts-mode--not-let-predicate @func))))
|
(:pred? zsh-ts-mode--not-let-predicate @func))))
|
||||||
"Query for `zsh-ts-mode' `xref-backend-identifier-at-point'.")
|
"Query for `zsh-ts-mode' `xref-backend-identifier-at-point'.")
|
||||||
|
|
||||||
(cl-defun zsh-ts-mode--extract-variable-from-face-at (&optional (pos (point)))
|
(cl-defun zsh-ts-mode--extract-variable-from-face-at (&optional (pos (point)))
|
||||||
@@ -381,10 +381,10 @@ Return non-nil if NODE is not an anonymous function."
|
|||||||
(binary_expression left: (variable_name) @non-let
|
(binary_expression left: (variable_name) @non-let
|
||||||
operator: "=")
|
operator: "=")
|
||||||
(command name: ((command_name) @let.name
|
(command name: ((command_name) @let.name
|
||||||
(:equal @let.name "let"))
|
(:eq? @let.name "let"))
|
||||||
argument: ((word) @let-arg
|
argument: ((word) @let-arg
|
||||||
(:match ,(rx-to-string '(seq bos (not "-")))
|
(:match? ,(rx-to-string '(seq bos (not "-")))
|
||||||
@let-arg)))))
|
@let-arg)))))
|
||||||
"Variable query for `zsh-ts-mode--xref-variable-definitions'.")
|
"Variable query for `zsh-ts-mode--xref-variable-definitions'.")
|
||||||
|
|
||||||
(defun zsh-ts-mode--xref-variable-definitions (identifier)
|
(defun zsh-ts-mode--xref-variable-definitions (identifier)
|
||||||
@@ -490,7 +490,7 @@ Return non-nil if NODE is not an anonymous function."
|
|||||||
'zsh '(((simple_variable_name) @ident)
|
'zsh '(((simple_variable_name) @ident)
|
||||||
((special_variable_name) @ident)
|
((special_variable_name) @ident)
|
||||||
((variable_name) @ident)
|
((variable_name) @ident)
|
||||||
(command name: (command_name ((word) @cname (:equal @cname "let")))
|
(command name: (command_name ((word) @cname (:eq? @cname "let")))
|
||||||
argument: (word) @ident)
|
argument: (word) @ident)
|
||||||
(declaration_command argument: (word) @ident)
|
(declaration_command argument: (word) @ident)
|
||||||
(command name: (command_name (word) @ident))
|
(command name: (command_name (word) @ident))
|
||||||
|
|||||||
@@ -58,12 +58,6 @@
|
|||||||
;; Load the local system's configuration
|
;; Load the local system's configuration
|
||||||
(load (expand-file-name "local-init" user-emacs-directory) t t)
|
(load (expand-file-name "local-init" user-emacs-directory) t t)
|
||||||
|
|
||||||
;; diminish
|
|
||||||
(use-package diminish
|
|
||||||
:config
|
|
||||||
(diminish 'visual-line-mode)
|
|
||||||
(diminish 'abbrev-mode))
|
|
||||||
|
|
||||||
;; Private config loading
|
;; Private config loading
|
||||||
(require 'private nil t)
|
(require 'private nil t)
|
||||||
(defun my/get-private (key)
|
(defun my/get-private (key)
|
||||||
@@ -175,7 +169,18 @@ Apply OLDFUN with to ARGS."
|
|||||||
kill-do-not-save-duplicates t)
|
kill-do-not-save-duplicates t)
|
||||||
|
|
||||||
;; Terminal mouse support
|
;; Terminal mouse support
|
||||||
(xterm-mouse-mode 1)
|
(xterm-mouse-mode 1) ;; Emacs 31.1 enables this by default
|
||||||
|
(defvar xterm-update-cursor)
|
||||||
|
(setq xterm-update-cursor t)
|
||||||
|
|
||||||
|
;; Extend the region with the mouse
|
||||||
|
(mouse-shift-adjust-mode 1)
|
||||||
|
|
||||||
|
;; TTY child frames
|
||||||
|
(tty-tip-mode 1)
|
||||||
|
|
||||||
|
;; Don't break multiple tty frames
|
||||||
|
(setq multiple-terminals-merge-keyboards t)
|
||||||
|
|
||||||
;; Make cursor more visible
|
;; Make cursor more visible
|
||||||
(global-hl-line-mode 1)
|
(global-hl-line-mode 1)
|
||||||
@@ -187,9 +192,13 @@ Apply OLDFUN with to ARGS."
|
|||||||
;; Make window balancing better
|
;; Make window balancing better
|
||||||
(setq window-combination-resize t)
|
(setq window-combination-resize t)
|
||||||
|
|
||||||
|
;; Because I use tiling window managers
|
||||||
|
(setq frame-inhibit-implied-resize 'force)
|
||||||
|
|
||||||
;; Stop some annoying stuff
|
;; Stop some annoying stuff
|
||||||
(setq extended-command-suggest-shorter nil
|
(setq extended-command-suggest-shorter nil
|
||||||
suggest-key-bindings nil)
|
suggest-key-bindings nil
|
||||||
|
quit-window-kill-buffer t)
|
||||||
|
|
||||||
;; Better scrolling
|
;; Better scrolling
|
||||||
(setq mouse-scroll-delay 0
|
(setq mouse-scroll-delay 0
|
||||||
@@ -197,10 +206,27 @@ Apply OLDFUN with to ARGS."
|
|||||||
scroll-margin 2
|
scroll-margin 2
|
||||||
scroll-preserve-screen-position t)
|
scroll-preserve-screen-position t)
|
||||||
|
|
||||||
;; Make show paren instant
|
;; Register stuff
|
||||||
(setq show-paren-delay 0)
|
(setopt register-use-preview t)
|
||||||
|
|
||||||
|
;; Show paren options
|
||||||
|
(setq show-paren-delay 0
|
||||||
|
show-paren-not-in-comments-or-strings 'on-mismatch)
|
||||||
(show-paren-mode 1)
|
(show-paren-mode 1)
|
||||||
|
|
||||||
|
;; Form feed characters
|
||||||
|
(face-spec-set 'whitespace-page-delimiter
|
||||||
|
'((((supports :strike-through t))
|
||||||
|
:strike-through t :extend t :inherit shadow)
|
||||||
|
(t :extend t :inherit shadow :inverse-video t)))
|
||||||
|
(define-globalized-minor-mode my/global-whitespace-page-delimiters-mode
|
||||||
|
whitespace-page-delimiters-mode
|
||||||
|
whitespace-page-delimiters-mode
|
||||||
|
:group 'whitespace)
|
||||||
|
(my/global-whitespace-page-delimiters-mode 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Display line numbers
|
;; Display line numbers
|
||||||
(global-display-line-numbers-mode 1)
|
(global-display-line-numbers-mode 1)
|
||||||
|
|
||||||
@@ -277,17 +303,8 @@ Apply OLDFUN with to ARGS."
|
|||||||
|
|
||||||
;; Minibuffer stuff
|
;; Minibuffer stuff
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
(defun my/-crm-indicator (args)
|
(setopt crm-prompt "[CRM%s] %p"
|
||||||
"Filter args for `completing-read-multiple' to add an indicator.
|
enable-recursive-minibuffers t
|
||||||
ARGS are the args to filter."
|
|
||||||
(cons (format "[CRM%s] %s"
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
|
||||||
crm-separator)
|
|
||||||
(car args))
|
|
||||||
(cdr args)))
|
|
||||||
(advice-add #'completing-read-multiple :filter-args #'my/-crm-indicator)
|
|
||||||
(setopt enable-recursive-minibuffers t
|
|
||||||
read-extended-command-predicate nil)
|
read-extended-command-predicate nil)
|
||||||
(unless (plist-get minibuffer-prompt-properties 'cursor-intangible)
|
(unless (plist-get minibuffer-prompt-properties 'cursor-intangible)
|
||||||
(setopt minibuffer-prompt-properties
|
(setopt minibuffer-prompt-properties
|
||||||
@@ -296,46 +313,32 @@ ARGS are the args to filter."
|
|||||||
;; Tree sitter download locations
|
;; Tree sitter download locations
|
||||||
(with-eval-after-load 'treesit
|
(with-eval-after-load 'treesit
|
||||||
(defvar treesit-language-source-alist)
|
(defvar treesit-language-source-alist)
|
||||||
(setq treesit-language-source-alist
|
(dolist (ent '((c "https://github.com/tree-sitter/tree-sitter-c")
|
||||||
'((c "https://github.com/tree-sitter/tree-sitter-c")
|
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
|
||||||
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
|
(java "https://github.com/tree-sitter/tree-sitter-java")
|
||||||
(java "https://github.com/tree-sitter/tree-sitter-java")
|
;; (glsl "https://github.com/tree-sitter-grammars/tree-sitter-glsl")
|
||||||
;; (glsl "https://github.com/tree-sitter-grammars/tree-sitter-glsl")
|
(python "https://github.com/tree-sitter/tree-sitter-python")
|
||||||
(python "https://github.com/tree-sitter/tree-sitter-python")
|
(rust "https://github.com/tree-sitter/tree-sitter-rust")
|
||||||
(rust "https://github.com/tree-sitter/tree-sitter-rust")
|
(json "https://github.com/tree-sitter/tree-sitter-json")
|
||||||
(json "https://github.com/tree-sitter/tree-sitter-json")
|
(yaml "https://github.com/ikatyang/tree-sitter-yaml")
|
||||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml")
|
(css "https://github.com/tree-sitter/tree-sitter-css")
|
||||||
(css "https://github.com/tree-sitter/tree-sitter-css")
|
(go "https://github.com/tree-sitter/tree-sitter-go")
|
||||||
(go "https://github.com/tree-sitter/tree-sitter-go")
|
(gomod "https://github.com/camdencheek/tree-sitter-go-mod")
|
||||||
(gomod "https://github.com/camdencheek/tree-sitter-go-mod")
|
(javascript "https://github.com/tree-sitter/tree-sitter-javascript")
|
||||||
(javascript "https://github.com/tree-sitter/tree-sitter-javascript")
|
(typescript "https://github.com/tree-sitter/tree-sitter-typescript"
|
||||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript"
|
nil "typescript/src")
|
||||||
nil "typescript/src")
|
(tsx "https://github.com/tree-sitter/tree-sitter-typescript"
|
||||||
(tsx "https://github.com/tree-sitter/tree-sitter-typescript"
|
nil "tsx/src")
|
||||||
nil "tsx/src")
|
(bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||||
(bash "https://github.com/tree-sitter/tree-sitter-bash")
|
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
||||||
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
(blueprint "https://github.com/huanie/tree-sitter-blueprint")
|
||||||
(blueprint "https://github.com/huanie/tree-sitter-blueprint")
|
(kdl "https://github.com/tree-sitter-grammars/tree-sitter-kdl")
|
||||||
(kdl "https://github.com/tree-sitter-grammars/tree-sitter-kdl")
|
(haskell "https://github.com/tree-sitter/tree-sitter-haskell")
|
||||||
(php "https://github.com/tree-sitter/tree-sitter-php")
|
(zsh "https://github.com/georgeharker/tree-sitter-zsh.git")))
|
||||||
(haskell "https://github.com/tree-sitter/tree-sitter-haskell")
|
(add-to-list 'treesit-language-source-alist ent))
|
||||||
(zsh "https://github.com/georgeharker/tree-sitter-zsh.git")))
|
|
||||||
;; Tree sitter major mode conversions
|
;; Tree sitter major mode conversions
|
||||||
(dolist (ent '((c-mode . c-ts-mode)
|
(setopt treesit-enabled-modes t
|
||||||
(c++-mode . c++-ts-mode)
|
treesit-auto-install-grammar 'ask))
|
||||||
(c-or-c++-mode . c-or-c++-ts-mode)
|
|
||||||
(python-mode . python-ts-mode)
|
|
||||||
(java-mode . java-ts-mode)
|
|
||||||
(rust-mode . rust-ts-mode)
|
|
||||||
(json-mode . json-ts-mode)
|
|
||||||
(jsonc-mode . json-ts-mode)
|
|
||||||
(yaml-mode . yaml-ts-mode)
|
|
||||||
(css-mode . css-ts-mode)
|
|
||||||
(javascript-mode . js-ts-mode)
|
|
||||||
(cmake-mode . cmake-ts-mode)
|
|
||||||
;; (go-mode . go-ts-mode) <- doesn't work very well
|
|
||||||
))
|
|
||||||
(add-to-list 'major-mode-remap-alist ent)))
|
|
||||||
(defun my/treesit-compile-all (force)
|
(defun my/treesit-compile-all (force)
|
||||||
"Compile all the modules defined in `treesit-language-source-alist'.
|
"Compile all the modules defined in `treesit-language-source-alist'.
|
||||||
If FORCE, recompile all modules, even ones that are already compiled.
|
If FORCE, recompile all modules, even ones that are already compiled.
|
||||||
@@ -352,11 +355,6 @@ Interactively, force the recompile if called with a prefix."
|
|||||||
(unless did-build
|
(unless did-build
|
||||||
(message "All defined parsers installed!"))))
|
(message "All defined parsers installed!"))))
|
||||||
|
|
||||||
(use-package auth-source
|
|
||||||
:ensure nil
|
|
||||||
:custom
|
|
||||||
(auth-sources '("~/.authinfo.gpg")))
|
|
||||||
|
|
||||||
(setopt remote-file-name-access-timeout 10)
|
(setopt remote-file-name-access-timeout 10)
|
||||||
(use-package tramp
|
(use-package tramp
|
||||||
:ensure nil
|
:ensure nil
|
||||||
@@ -514,8 +512,11 @@ PRED is nil, the value of `my/kill-some-buffers-default-pred' is used."
|
|||||||
(keymap-global-set "C-x K" 'my/kill-some-buffers)
|
(keymap-global-set "C-x K" 'my/kill-some-buffers)
|
||||||
|
|
||||||
(use-package tab-bar
|
(use-package tab-bar
|
||||||
|
:defer nil
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:init
|
:bind (("C-x t s" . split-tab)
|
||||||
|
("C-x t e" . merge-tabs))
|
||||||
|
:custom
|
||||||
(setq tab-bar-show 1
|
(setq tab-bar-show 1
|
||||||
tab-bar-tab-hints t
|
tab-bar-tab-hints t
|
||||||
icon-preference '(symbol text image emoji))
|
icon-preference '(symbol text image emoji))
|
||||||
@@ -757,7 +758,6 @@ With NO-UPDATE-BAR, don't update any status bar's state."
|
|||||||
(use-package evil-collection
|
(use-package evil-collection
|
||||||
:after evil
|
:after evil
|
||||||
:defer nil
|
:defer nil
|
||||||
:diminish evil-collection-unimpaired-mode
|
|
||||||
:config
|
:config
|
||||||
(setf (plist-get (alist-get 'repl-submit evil-collection-binding-defaults)
|
(setf (plist-get (alist-get 'repl-submit evil-collection-binding-defaults)
|
||||||
:state)
|
:state)
|
||||||
@@ -777,11 +777,6 @@ With NO-UPDATE-BAR, don't update any status bar's state."
|
|||||||
"gz" #'evil-surround-region
|
"gz" #'evil-surround-region
|
||||||
"gZ" #'evil-Surround-region)
|
"gZ" #'evil-Surround-region)
|
||||||
(global-evil-surround-mode 1))
|
(global-evil-surround-mode 1))
|
||||||
(use-package evil-terminal-cursor-changer
|
|
||||||
:after evil
|
|
||||||
:defer nil
|
|
||||||
:config
|
|
||||||
(evil-terminal-cursor-changer-activate))
|
|
||||||
(use-package evil-numbers
|
(use-package evil-numbers
|
||||||
:after evil
|
:after evil
|
||||||
:bind (("C-c =" . evil-numbers/inc-at-pt)
|
:bind (("C-c =" . evil-numbers/inc-at-pt)
|
||||||
@@ -789,11 +784,7 @@ With NO-UPDATE-BAR, don't update any status bar's state."
|
|||||||
("C-c -" . evil-numbers/dec-at-pt)
|
("C-c -" . evil-numbers/dec-at-pt)
|
||||||
("C-c C-=" . evil-numbers/inc-at-pt-incremental)
|
("C-c C-=" . evil-numbers/inc-at-pt-incremental)
|
||||||
("C-c C-+" . evil-numbers/inc-at-pt-incremental)
|
("C-c C-+" . evil-numbers/inc-at-pt-incremental)
|
||||||
("C-c C--" . evil-numbers/dec-at-pt-incremental))
|
("C-c C--" . evil-numbers/dec-at-pt-incremental)))
|
||||||
:config
|
|
||||||
;; TODO remove this when emacs 31 releases
|
|
||||||
(when (< emacs-major-version 31)
|
|
||||||
(defalias 'incf 'cl-incf)))
|
|
||||||
(use-package evil-cleverparens
|
(use-package evil-cleverparens
|
||||||
:hook ((prog-mode . my/-enable-evil-cleverparens)
|
:hook ((prog-mode . my/-enable-evil-cleverparens)
|
||||||
(evil-cleverparens-mode . paredit-mode))
|
(evil-cleverparens-mode . paredit-mode))
|
||||||
@@ -1007,7 +998,6 @@ environment variable accordingly."
|
|||||||
|
|
||||||
;; which-key
|
;; which-key
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:diminish which-key-mode
|
|
||||||
:config
|
:config
|
||||||
(which-key-mode 1))
|
(which-key-mode 1))
|
||||||
|
|
||||||
@@ -1066,7 +1056,6 @@ environment variable accordingly."
|
|||||||
|
|
||||||
;; ace-window
|
;; ace-window
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:diminish ace-window-mode
|
|
||||||
:bind ("M-o" . ace-window)
|
:bind ("M-o" . ace-window)
|
||||||
:init
|
:init
|
||||||
(setq aw-scope 'frame
|
(setq aw-scope 'frame
|
||||||
@@ -1245,12 +1234,7 @@ environment variable accordingly."
|
|||||||
(corfu-on-exact-match nil)
|
(corfu-on-exact-match nil)
|
||||||
(corfu-popupinfo-delay '(1.0 . 0.5))
|
(corfu-popupinfo-delay '(1.0 . 0.5))
|
||||||
(completion-cycle-threshold nil)
|
(completion-cycle-threshold nil)
|
||||||
(global-corfu-minibuffer
|
(global-corfu-minibuffer t)
|
||||||
;; only enable corfu in the minibuffer in graphical frames
|
|
||||||
(lambda ()
|
|
||||||
(and (display-graphic-p)
|
|
||||||
(not (eq (current-local-map)
|
|
||||||
read-passwd-map)))))
|
|
||||||
:config
|
:config
|
||||||
(defvar corfu--extra)
|
(defvar corfu--extra)
|
||||||
(defun my/corfu-move-to-minibuffer ()
|
(defun my/corfu-move-to-minibuffer ()
|
||||||
@@ -1549,7 +1533,6 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
|
|
||||||
;; eldoc
|
;; eldoc
|
||||||
(use-package eldoc
|
(use-package eldoc
|
||||||
:diminish eldoc-mode
|
|
||||||
:custom
|
:custom
|
||||||
(eldoc-echo-area-use-multiline-p nil))
|
(eldoc-echo-area-use-multiline-p nil))
|
||||||
|
|
||||||
@@ -1657,8 +1640,6 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
(apheleia-formatters-respect-fill-column t)
|
(apheleia-formatters-respect-fill-column t)
|
||||||
:init
|
:init
|
||||||
(add-to-list 'auto-mode-alist `(,(rx "/.clang-format" eos) . yaml-ts-mode))
|
(add-to-list 'auto-mode-alist `(,(rx "/.clang-format" eos) . yaml-ts-mode))
|
||||||
(defun my/apheleia-disable-in-current-buffer ()
|
|
||||||
(setq-local apheleia-inhibit t))
|
|
||||||
:config
|
:config
|
||||||
(apheleia-global-mode 1)
|
(apheleia-global-mode 1)
|
||||||
(add-to-list 'apheleia-formatters
|
(add-to-list 'apheleia-formatters
|
||||||
@@ -1666,6 +1647,8 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
(apheleia-formatters-fill-column "--width")))
|
(apheleia-formatters-fill-column "--width")))
|
||||||
(add-to-list 'apheleia-mode-alist
|
(add-to-list 'apheleia-mode-alist
|
||||||
'(racket-mode . lisp-indent))
|
'(racket-mode . lisp-indent))
|
||||||
|
(add-to-list 'apheleia-mode-alist
|
||||||
|
'(mhtml-ts-mode . prettier-html))
|
||||||
(setf (alist-get 'java-mode apheleia-mode-alist) 'clang-format
|
(setf (alist-get 'java-mode apheleia-mode-alist) 'clang-format
|
||||||
(alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format))
|
(alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format))
|
||||||
|
|
||||||
@@ -1771,7 +1754,9 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
|
|
||||||
;; code folding
|
;; code folding
|
||||||
(use-package hideshow
|
(use-package hideshow
|
||||||
:hook (prog-mode . hs-minor-mode))
|
:hook (prog-mode . hs-minor-mode)
|
||||||
|
:custom
|
||||||
|
(hs-display-lines-hidden t))
|
||||||
;; preserve folds
|
;; preserve folds
|
||||||
(use-package hs-preserve-mode
|
(use-package hs-preserve-mode
|
||||||
:ensure nil
|
:ensure nil
|
||||||
@@ -2100,6 +2085,8 @@ MAPS are expected to be keymaps for modes for languages with C-style comments."
|
|||||||
(use-package java-ts-mode
|
(use-package java-ts-mode
|
||||||
:hook ((java-ts-mode . my/eglot-if-trusted)
|
:hook ((java-ts-mode . my/eglot-if-trusted)
|
||||||
(java-ts-mode . my/-setup-java-ts-mode))
|
(java-ts-mode . my/-setup-java-ts-mode))
|
||||||
|
:custom
|
||||||
|
(java-ts-mode-enable-doxygen t)
|
||||||
:config
|
:config
|
||||||
(my/setup-c-style-newline-keys java-ts-mode-map)
|
(my/setup-c-style-newline-keys java-ts-mode-map)
|
||||||
(defun my/-setup-java-ts-mode ()
|
(defun my/-setup-java-ts-mode ()
|
||||||
@@ -2139,6 +2126,8 @@ EVENT is the same as the original command."
|
|||||||
(use-package c-ts-mode
|
(use-package c-ts-mode
|
||||||
:after evil
|
:after evil
|
||||||
:hook ((c-ts-mode c++-ts-mode) . my/eglot-if-trusted)
|
:hook ((c-ts-mode c++-ts-mode) . my/eglot-if-trusted)
|
||||||
|
:custom
|
||||||
|
(c-ts-mode-enable-doxygen t)
|
||||||
:init
|
:init
|
||||||
(setq-default c-ts-mode-indent-offset 4)
|
(setq-default c-ts-mode-indent-offset 4)
|
||||||
:config
|
:config
|
||||||
@@ -2174,20 +2163,29 @@ This is :around advice, so OLDFUN is the real function
|
|||||||
(use-package php-ts-mode
|
(use-package php-ts-mode
|
||||||
:defer t
|
:defer t
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (php-mode . my/eglot-if-trusted))
|
:hook (php-mode . my/eglot-if-trusted)
|
||||||
|
:custom
|
||||||
|
(php-ts-mode-phpdoc-highlight-errors t))
|
||||||
|
|
||||||
;; web-mode
|
(use-package sgml-mode
|
||||||
(use-package web-mode
|
|
||||||
:defer t
|
:defer t
|
||||||
:hook (web-mode . my/eglot-if-trusted)
|
:config
|
||||||
|
(define-key html-mode-map (kbd "M-o") nil t)
|
||||||
|
(define-key html-mode-map (kbd "C-c C-m") 'facemenu-keymap))
|
||||||
|
|
||||||
|
(use-package mhtml-ts-mode
|
||||||
|
:defer t
|
||||||
|
:hook (mhtml-ts-mode . my/eglot-if-trusted)
|
||||||
:config
|
:config
|
||||||
(add-to-list 'eglot-server-programs
|
(add-to-list 'eglot-server-programs
|
||||||
'(web-mode . ("vscode-html-language-server" "--stdio"))))
|
'(mhtml-ts-mode . ("vscode-html-language-server" "--stdio"))))
|
||||||
|
|
||||||
;; JavaScript
|
;; JavaScript
|
||||||
(use-package js
|
(use-package js
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (js-ts-mode . my/eglot-if-trusted))
|
:hook (js-ts-mode . my/eglot-if-trusted)
|
||||||
|
:config
|
||||||
|
(my/setup-c-style-newline-keys js-ts-mode-map))
|
||||||
|
|
||||||
;; TypeScript
|
;; TypeScript
|
||||||
(use-package typescript-ts-mode
|
(use-package typescript-ts-mode
|
||||||
@@ -2239,8 +2237,11 @@ This is :around advice, so OLDFUN is the real function
|
|||||||
:hook (zig-mode . my/eglot-if-trusted))
|
:hook (zig-mode . my/eglot-if-trusted))
|
||||||
|
|
||||||
;; lua
|
;; lua
|
||||||
(use-package lua-mode
|
(use-package lua-ts-mode
|
||||||
:hook (lua-mode . my/eglot-if-trusted))
|
:ensure nil
|
||||||
|
:hook (lua-ts-mode . my/eglot-if-trusted)
|
||||||
|
:custom
|
||||||
|
(lua-ts-auto-close-block-comments t))
|
||||||
|
|
||||||
;; markdown
|
;; markdown
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
@@ -2296,7 +2297,8 @@ This is :around advice, so OLDFUN is the real function
|
|||||||
;; yaml
|
;; yaml
|
||||||
(use-package yaml-ts-mode
|
(use-package yaml-ts-mode
|
||||||
:hook (;; (yaml-ts-mode . my/eglot-if-trusted)
|
:hook (;; (yaml-ts-mode . my/eglot-if-trusted)
|
||||||
(yaml-ts-mode . my/-setup-yaml-ts-mode))
|
(yaml-ts-mode . my/-setup-yaml-ts-mode)
|
||||||
|
(yaml-ts-mode . my/flycheck-if-trusted))
|
||||||
:init
|
:init
|
||||||
(add-to-list 'auto-mode-alist `("\\.clangd\\'" . yaml-ts-mode))
|
(add-to-list 'auto-mode-alist `("\\.clangd\\'" . yaml-ts-mode))
|
||||||
(defun my/-setup-yaml-ts-mode ()
|
(defun my/-setup-yaml-ts-mode ()
|
||||||
@@ -3211,6 +3213,13 @@ ARG is the same as for either of the above functions."
|
|||||||
"u" #'dired-unmark
|
"u" #'dired-unmark
|
||||||
"U" #'dired-unmark-all-marks))
|
"U" #'dired-unmark-all-marks))
|
||||||
|
|
||||||
|
(use-package image-dired
|
||||||
|
:ensure nil
|
||||||
|
:hook (image-dired-thumbnail-mode . my/-setup-image-dired-thumbnail-mode)
|
||||||
|
:init
|
||||||
|
(defun my/-setup-image-dired-thumbnail-mode ()
|
||||||
|
(display-line-numbers-mode -1)))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
(use-package dirvish
|
(use-package dirvish
|
||||||
:demand t
|
:demand t
|
||||||
@@ -3330,13 +3339,26 @@ ARG is the same as for either of the above functions."
|
|||||||
"--group-directories-first" ,file))))
|
"--group-directories-first" ,file))))
|
||||||
(add-to-list 'dirvish-preview-dispatchers 'eza))
|
(add-to-list 'dirvish-preview-dispatchers 'eza))
|
||||||
|
|
||||||
|
;; web stuff
|
||||||
|
(when-let* ((exec (cl-find-if #'executable-find
|
||||||
|
'("mullvad-browser" "firefox"))))
|
||||||
|
(setopt browse-url-firefox-program exec))
|
||||||
|
|
||||||
;; trashed
|
;; trashed
|
||||||
(use-package trashed
|
(use-package trashed
|
||||||
:bind ("C-c h" . trashed))
|
:bind ("C-c h" . trashed))
|
||||||
|
|
||||||
;; ibuffer
|
;; ibuffer
|
||||||
(use-package ibuffer
|
(use-package ibuffer
|
||||||
:bind ("C-x C-b" . ibuffer))
|
:bind ("C-x C-b" . ibuffer)
|
||||||
|
:custom
|
||||||
|
(ibuffer-human-readable-size t)
|
||||||
|
:config
|
||||||
|
(define-key ibuffer-mode-map (kbd "M-o") nil t)
|
||||||
|
(keymap-set ibuffer-mode-map "M-O" #'ibuffer-visit-buffer-1-window))
|
||||||
|
|
||||||
|
;; Buffer menu
|
||||||
|
(setopt Buffer-menu-human-readable-sizes t)
|
||||||
|
|
||||||
;; magit
|
;; magit
|
||||||
(use-package magit
|
(use-package magit
|
||||||
@@ -3659,7 +3681,8 @@ BUFFER is the buffer-or-string to match against."
|
|||||||
(setq-local evil-lookup-func #'helpful-at-point))
|
(setq-local evil-lookup-func #'helpful-at-point))
|
||||||
(defun my/-setup-helpful-mode ()
|
(defun my/-setup-helpful-mode ()
|
||||||
(setq-local evil-lookup-func #'helpful-at-point
|
(setq-local evil-lookup-func #'helpful-at-point
|
||||||
tab-width 8))
|
tab-width 8
|
||||||
|
quit-window-kill-buffer nil))
|
||||||
:custom
|
:custom
|
||||||
(helpful-switch-buffer-function 'my/-helpful-switch-buffer-function)
|
(helpful-switch-buffer-function 'my/-helpful-switch-buffer-function)
|
||||||
(helpful-max-buffers 2)
|
(helpful-max-buffers 2)
|
||||||
@@ -4148,14 +4171,6 @@ vising, and their major mode"
|
|||||||
(dictionary-read-word-function . #'dictionary-completing-read-word)
|
(dictionary-read-word-function . #'dictionary-completing-read-word)
|
||||||
(dictionary-read-dictionary-function . #'dictionary-completing-read-dictionary))
|
(dictionary-read-dictionary-function . #'dictionary-completing-read-dictionary))
|
||||||
|
|
||||||
;; prettify ^L characters
|
|
||||||
(use-package form-feed
|
|
||||||
:custom-face
|
|
||||||
(form-feed-line ((((type graphic)) :strike-through "#555556")
|
|
||||||
(((type tty)) :inherit font-lock-comment-face :underline t)))
|
|
||||||
:config
|
|
||||||
(global-form-feed-mode 1))
|
|
||||||
|
|
||||||
;; fun!
|
;; fun!
|
||||||
(use-package mines
|
(use-package mines
|
||||||
:config
|
:config
|
||||||
|
|||||||
Reference in New Issue
Block a user