181 lines
7.1 KiB
EmacsLisp
181 lines
7.1 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)))))
|
|
|
|
;; ai stuff (also mostly fun)
|
|
;; (use-package ellama
|
|
;; :defer nil
|
|
;; :custom
|
|
;; (ellama-sessions-directory (no-littering-expand-var-file-name
|
|
;; "ellama-sessions"))
|
|
;; (ellama-major-mode 'markdown-mode) ;; fix text inserting at top of buffer
|
|
;; (ellama-session-file-extension "md")
|
|
;; (ellama-nick-prefix "##")
|
|
;; (ellama-keymap-prefix "C-c m")
|
|
;; :hook (ellama-session-mode . my/-ellama-startup-hook)
|
|
;; :init
|
|
;; (defun my/-ellama-startup-hook ()
|
|
;; "Hook to do stuff in llama buffers."
|
|
;; (auto-fill-mode -1)))
|
|
|
|
;; sly
|
|
;; (use-package sly
|
|
;; :hook (lisp-mode . my/-lisp-mode-autoconnect-sly)
|
|
;; :bind (:map sly-mode-map
|
|
;; ("C-c e" . my/sly-show-notes-at-point))
|
|
;; :autoload sly-connected-p
|
|
;; :init
|
|
;; (defun my/-lisp-mode-autoconnect-sly ()
|
|
;; (unless (sly-connected-p)
|
|
;; (sly)))
|
|
;; (defun my/sly-notes-at-point (pos &optional buffer)
|
|
;; "Returns the sly notes at POS in BUFFER.
|
|
;; If BUFFER is nil, the current buffer is used."
|
|
;; (with-current-buffer (or buffer (current-buffer))
|
|
;; (cl-loop for overlay in (overlays-at pos)
|
|
;; for note = (overlay-get overlay 'sly-note)
|
|
;; when note
|
|
;; collect note)))
|
|
;; (defun my/sly-show-notes-at-point ()
|
|
;; "Show all sly notes at point in a floating window."
|
|
;; (interactive)
|
|
;; (my/floating-tooltip " *sly-note-posframe*"
|
|
;; (with-output-to-string
|
|
;; (dolist (note (my/sly-notes-at-point (point)))
|
|
;; (when-let (msg (plist-get note :message))
|
|
;; (princ "·")
|
|
;; (princ msg)
|
|
;; (terpri))))))
|
|
;; (setq inferior-lisp-program "/usr/bin/sbcl")
|
|
;; :config
|
|
;; (sly-symbol-completion-mode -1))
|
|
|
|
;; corfu (autocomplete)
|
|
;; (use-package corfu
|
|
;; :bind (("M-<tab>" . completion-at-point)
|
|
;; :map corfu-map
|
|
;; ("M-SPC" . corfu-insert-separator)
|
|
;; ("M-m" . my/corfu-move-to-minibuffer))
|
|
;; :init
|
|
;; (defun my/corfu-move-to-minibuffer ()
|
|
;; (interactive)
|
|
;; (when completion-in-region--data
|
|
;; (let ((completion-extra-properties corfu--extra)
|
|
;; completion-cycle-threshold completion-cycling)
|
|
;; (apply #'consult-completion-in-region completion-in-region--data))))
|
|
;; (setq corfu-cycle t
|
|
;; corfu-auto t
|
|
;; corfu-on-exact-match nil
|
|
;; completion-cycle-threshold nil)
|
|
;; (global-corfu-mode 1)
|
|
;; (corfu-popupinfo-mode 1)
|
|
;; :config
|
|
;; (add-to-list 'corfu-continue-commands #'my/corfu-move-to-minibuffer))
|
|
;; (use-package corfu-terminal
|
|
;; :init
|
|
;; (corfu-terminal-mode 1))
|
|
|
|
;; ;; cape (a bunch of capfs!)
|
|
;; (use-package cape
|
|
;; :bind (("C-c p" . cape-dabbrev)
|
|
;; ([remap dabbrev-expand] . cape-dabbrev)
|
|
;; ("C-c P" . cape-line)
|
|
;; ("C-c f" . cape-file))
|
|
;; :hook (text-mode . my/-cape-setup-text-mode)
|
|
;; :init
|
|
;; (defun my/-cape-setup-text-mode ()
|
|
;; (setq-local completion-at-point-functions
|
|
;; '(cape-dict cape-dabbrev)
|
|
;; corfu-auto nil)))
|