148 lines
6.2 KiB
EmacsLisp
148 lines
6.2 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)))
|
|
|
|
;; company (in buffer auto-complete)
|
|
;; (use-package company
|
|
;; :defer nil
|
|
;; :bind (("M-TAB" . company-complete)
|
|
;; ("M-<tab>" . company-complete)
|
|
;; ("C-c f" . company-files)
|
|
;; ([remap dabbrev-expand] . company-dabbrev)
|
|
;; :map prog-mode-map
|
|
;; ([remap company-dabbrev] . company-dabbrev-code))
|
|
;; :hook ((company-search-mode . my/-company-search-mode-add-lighter)
|
|
;; (sh-mode . my/-company-setup-shell-mode))
|
|
;; :config
|
|
;; (defun my/-company-setup-shell-mode ()
|
|
;; (setq-local company-backends '(company-files company-keywords
|
|
;; company-dabbrev-code)))
|
|
;; (defun my/-company-search-mode-add-lighter ()
|
|
;; (if company-search-mode
|
|
;; (cl-pushnew company-search-lighter global-mode-string :test 'equal)
|
|
;; (setq global-mode-string
|
|
;; (cl-delete company-search-lighter global-mode-string :test 'equal))))
|
|
;; (defun my/-company-set-completion-styles (oldfun &rest args)
|
|
;; (let ((completion-styles '(basic emacs21 flex)))
|
|
;; (apply oldfun args)))
|
|
;; (advice-add 'company-capf :around 'my/-company-set-completion-styles)
|
|
;; (setopt company-format-margin-function #'company-text-icons-margin
|
|
;; company-require-match nil
|
|
;; company-tooltip-align-annotations t)
|
|
;; (setq company-transformers '(company-sort-by-occurrence))
|
|
;; (global-company-mode 1))
|
|
;; (use-package company-quickhelp
|
|
;; :bind (:map company-active-map
|
|
;; ("M-h" . company-quickhelp-manual-begin))
|
|
;; :after company
|
|
;; :config
|
|
;; (company-quickhelp-mode 1)
|
|
;; (setopt company-quickhelp-delay nil))
|