127 lines
5.3 KiB
EmacsLisp
127 lines
5.3 KiB
EmacsLisp
;; icomplete
|
|
;; (use-package icomplete
|
|
;; :disable
|
|
;; :ensure nil
|
|
;; :demand t
|
|
;; :bind (:map icomplete-minibuffer-map
|
|
;; ("C-S-s" . kill-line)
|
|
;; ("C-j" . icomplete-forward-completions)
|
|
;; ("C-k" . icomplete-backward-completions)
|
|
;; ("DEL" . icomplete-fido-backward-updir)
|
|
;; ("M-DEL". delete-backward-char)
|
|
;; ("M-RET" . icomplete-force-complete-and-exit)
|
|
;; ("TAB" . icomplete-force-complete)
|
|
;; ("<escape>" . abort-recursive-edit)
|
|
;; ("C-;" . embark-dwim)
|
|
;; ("C-." . embark-act)
|
|
;; ("<left>" . backward-char)
|
|
;; ("<right>" . forward-char))
|
|
;; :hook (icomplete-minibuffer-setup . my/icomplete-setup-hook-func)
|
|
;; :init
|
|
;; (defun my/icomplete-setup-hook-func ()
|
|
;; (setq truncate-lines t))
|
|
;; (setq completion-ignore-case t
|
|
;; read-file-name-completion-ignore-case t
|
|
;; read-buffer-completion-ignore-case t
|
|
;; enable-recursive-minibuffers t
|
|
;; minibuffer-prompt-properties '(read-only t
|
|
;; cursor-intangible t
|
|
;; face minibuffer-prompt)
|
|
;; ;;completions-detailed t
|
|
;; icomplete-compute-delay 0
|
|
;; icomplete-scroll t)
|
|
;; (defun my/crm-indicator (args)
|
|
;; (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)
|
|
;; (defun my/marginalia-trim-right (list)
|
|
;; (cl-loop for (cand prefix suffix) in list collect
|
|
;; (list cand prefix (string-trim-right suffix))))
|
|
;; (advice-add #'marginalia--align :filter-return #'my/marginalia-trim-right)
|
|
;; :config
|
|
;; (set-face-attribute 'icomplete-selected-match nil :inherit 'region)
|
|
;; (fido-mode 1)
|
|
;; (fido-vertical-mode 1))
|
|
|
|
;; flycheck
|
|
;; (use-package flycheck
|
|
;; :hook (emacs-lisp-mode . flycheck-mode)
|
|
;; :bind (:map flycheck-mode-map
|
|
;; ("C-c e" . my/flycheck-show-diagnostic-at-point))
|
|
;; :init
|
|
;; (setq flycheck-display-errors-function nil)
|
|
;; (defun my/flycheck-show-diagnostic-at-point ()
|
|
;; (interactive)
|
|
;; (if-let ((flycheck-mode)
|
|
;; (errors (flycheck-overlay-errors-at (point)))
|
|
;; (message (apply 'concat
|
|
;; (mapcar
|
|
;; (lambda (error)
|
|
;; (concat "•" (flycheck-error-message error) "\n"))
|
|
;; errors))))
|
|
;; (if (display-graphic-p)
|
|
;; (progn
|
|
;; (posframe-show " *flycheck-error-posframe*"
|
|
;; :string message
|
|
;; :position (point)
|
|
;; :max-width 80
|
|
;; :border-width 2
|
|
;; :border-color "white")
|
|
;; (clear-this-command-keys)
|
|
;; (push (read-event) unread-command-events)
|
|
;; (posframe-hide " *flycheck-error-posframe*"))
|
|
;; (popup-tip message)))))
|
|
;; (use-package consult-flycheck
|
|
;; :bind (:map flycheck-mode-map
|
|
;; ("C-c C-e" . consult-flycheck)))
|
|
|
|
;; lsp-mode
|
|
;; (use-package consult-lsp)
|
|
;; (use-package lsp-mode
|
|
;; :hook (((c-ts-mode c++-ts-mode java-ts-mode rust-ts-mode python-ts-mode
|
|
;; latex-mode markdown-mode blueprint-ts-mode) . lsp-mode)
|
|
;; (lsp-mode . my/-setup-lsp-mode-buffer))
|
|
;; :init
|
|
;; (setq lsp-completion-provider :none
|
|
;; lsp-headerline-breadcrumb-enable nil
|
|
;; lsp-inlay-hint-enable nil
|
|
;; lsp-signature-doc-lines 1)
|
|
;; (defun my/-setup-lsp-mode-buffer ()
|
|
;; "Called by `lsp-mode-hook' to setup lsp-mode buffers."
|
|
;; (evil-define-key '(normal visual motion) 'local
|
|
;; "gR" #'lsp-rename
|
|
;; "gA" #'lsp-execute-code-action
|
|
;; "gs" #'consult-lsp-symbols)
|
|
;; (setq-local evil-lookup-func #'lsp-describe-thing-at-point)))
|
|
|
|
;; vterm
|
|
;; (use-package vterm
|
|
;; :hook (vterm-mode . with-editor-export-editor)
|
|
;; :init
|
|
;; (defvar my/project-vterm-hash-table (make-hash-table :test 'equal)
|
|
;; "Hash table that maps project root dirs to vterm buffers.")
|
|
;; (defun my/project-vterm (prompt)
|
|
;; "Switch to or create a vterm buffer in the current projects root."
|
|
;; (interactive (list t))
|
|
;; (if-let ((proj (project-current prompt))
|
|
;; (default-directory (project-root proj)))
|
|
;; (if-let ((vterm-buff (gethash default-directory
|
|
;; my/project-vterm-hash-table))
|
|
;; ((buffer-live-p vterm-buff)))
|
|
;; (switch-to-buffer vterm-buff)
|
|
;; (puthash default-directory
|
|
;; (vterm (concat "*vterm for project " default-directory "*"))
|
|
;; my/project-vterm-hash-table))))
|
|
;; (defun my/project-vterm-or-default ()
|
|
;; "Open a vterm for the current project, otherwise, open a normal vterm."
|
|
;; (interactive)
|
|
;; (unless (my/project-vterm nil)
|
|
;; (if-let ((vterm-buff (gethash nil my/project-vterm-hash-table))
|
|
;; ((buffer-live-p vterm-buff)))
|
|
;; (switch-to-buffer vterm-buff)
|
|
;; (puthash nil (vterm vterm-buffer-name) my/project-vterm-hash-table)))))
|