95 lines
4.0 KiB
EmacsLisp
95 lines
4.0 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))
|
|
|
|
;; 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)))))
|