Move all the way up to company-yasnippet
Some checks are pending
/ Test config on ${{matrix.node}} (20) (push) Waiting to run
Some checks are pending
/ Test config on ${{matrix.node}} (20) (push) Waiting to run
This commit is contained in:
parent
611b43098b
commit
1f1d488cda
13 changed files with 16 additions and 19 deletions
114
lisp/icejam-company-yasnippet.el
Normal file
114
lisp/icejam-company-yasnippet.el
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
;;; icejam-company-yasnippet.el -- summary -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Company completion framework configuration
|
||||
;;; Code:
|
||||
|
||||
(use-package yasnippet
|
||||
:straight t
|
||||
:defer t)
|
||||
|
||||
(use-package yasnippet-snippets
|
||||
:straight t
|
||||
:defer t
|
||||
:requires (yasnippet)
|
||||
:config
|
||||
(unbind-key "C-c & C-n" yas-minor-mode-map)
|
||||
(unbind-key "C-c & C-s" yas-minor-mode-map)
|
||||
(unbind-key "C-c & C-v" yas-minor-mode-map))
|
||||
|
||||
(yas-global-mode t)
|
||||
|
||||
(use-package company
|
||||
:commands (company-indent-or-complete-common company-yasnippet)
|
||||
:requires (yasnippet
|
||||
yasnippet-snippets)
|
||||
:straight t
|
||||
:defer t)
|
||||
|
||||
(use-package company-box
|
||||
:straight t
|
||||
:defer t
|
||||
:requires (company)
|
||||
:hook (((company-mode) . company-box-mode)))
|
||||
|
||||
(global-company-mode t)
|
||||
|
||||
(setq-default
|
||||
company-minimum-prefix-length 3 ;; minimum prefix character number for auto complete.
|
||||
company-idle-delay 0.1
|
||||
company-require-match nil
|
||||
company-echo-delay 0 ;;;; company-show-numbers t
|
||||
company-tooltip-align-annotations t ;; align annotations to the right tooltip border.
|
||||
company-tooltip-flip-when-above t
|
||||
company-tooltip-limit 10 ;; tooltip candidates max limit.
|
||||
company-tooltip-minimum 2 ;; minimum candidates limit.
|
||||
company-tooltip-minimum-width 10 ;; The minimum width of the tooltip's inner area.
|
||||
;; This doesn't include the margins and the scroll bar.
|
||||
company-tooltip-margin 2 ;; width of margin columns to show around the tooltip
|
||||
company-tooltip-offset-display 'lines ;; 'lines - how to show tooltip unshown candidates number.
|
||||
company-show-numbers nil ;; t: show quick-access numbers for the first ten candidates.
|
||||
company-selection-wrap-around t ;; loop over candidates
|
||||
company-dabbrev-other-buffers t ;; Only offer dabbrev from the same major mode
|
||||
company-dabbrev-downcase nil ;; Preserve case of candidates
|
||||
company-format-margin-function nil
|
||||
;; company-async-wait 0.03
|
||||
;; company-async-timeout 2
|
||||
)
|
||||
|
||||
;; Absolute defaults for company mode
|
||||
(setq company-backends
|
||||
'((company-files ; files & directory
|
||||
company-keywords ; keywords
|
||||
company-capf
|
||||
)
|
||||
(company-dabbrev company-abbrev)
|
||||
))
|
||||
|
||||
;; Use standard emacs next and previous bindings for navigating company
|
||||
;; suggestions
|
||||
(define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort)
|
||||
(define-key company-active-map (kbd "C-n") 'company-select-next-or-abort)
|
||||
|
||||
(defun insert-space-and-complete ()
|
||||
"Insert space before trying to complete a section."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(insert " "))
|
||||
(company-indent-or-complete-common))
|
||||
|
||||
;; Only use RETURN for completion in company
|
||||
(unbind-key "TAB" company-active-map)
|
||||
|
||||
;;; Yasnippet configuration
|
||||
(define-key prog-mode-map (kbd "C-c y") 'company-yasnippet)
|
||||
(define-key prog-mode-map (kbd "<f13>") 'insert-space-and-complete)
|
||||
(define-key prog-mode-map (kbd "TAB") 'company-indent-or-complete-common)
|
||||
|
||||
(define-key text-mode-map (kbd "C-c y") 'company-yasnippet)
|
||||
(define-key text-mode-map (kbd "<f13>") 'insert-space-and-complete)
|
||||
(define-key text-mode-map (kbd "TAB") 'company-indent-or-complete-common)
|
||||
|
||||
|
||||
;;; Copilot and other GPT stuff
|
||||
(use-package copilot
|
||||
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
|
||||
:ensure t)
|
||||
|
||||
;; Do not enable copilot by default because it sorta sucks?
|
||||
;; (add-hook 'prog-mode-hook 'copilot-mode)
|
||||
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
|
||||
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
|
||||
|
||||
;; Enable Anthropic Claude LLM support for chat (it also sucks)
|
||||
(use-package gptel :straight t :ensure t)
|
||||
|
||||
(defcustom anthropic-api-key "api-key" "The value of your Anthropic API key."
|
||||
:type 'string
|
||||
:initialize 'custom-initialize-set)
|
||||
|
||||
(setq
|
||||
gptel-model "claude-3-5-sonnet-20240620"
|
||||
gptel-backend (gptel-make-anthropic "Claude" :stream t :key (lambda () anthropic-api-key)))
|
||||
|
||||
(provide 'icejam-company-yasnippet)
|
||||
;;; icejam-company-yasnippet.el ends here
|
||||
30
lisp/icejam-flycheck.el
Normal file
30
lisp/icejam-flycheck.el
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
;;; icejam-flycheck -- summary -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
;; Use flycheck globally to check syntax and compile languages
|
||||
(use-package flycheck
|
||||
:commands flycheck-define-checker
|
||||
:straight t
|
||||
:defer t
|
||||
:config (global-flycheck-mode t)
|
||||
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||
(unbind-key "C-c ! C-c" flycheck-mode-map)
|
||||
(unbind-key "C-c ! C-w" flycheck-mode-map)
|
||||
(unbind-key "C-c ! ?" flycheck-mode-map)
|
||||
(unbind-key "C-c ! C" flycheck-mode-map)
|
||||
(unbind-key "C-c ! H" flycheck-mode-map)
|
||||
(unbind-key "C-c ! V" flycheck-mode-map)
|
||||
(unbind-key "C-c ! c" flycheck-mode-map)
|
||||
(unbind-key "C-c ! e" flycheck-mode-map)
|
||||
(unbind-key "C-c ! h" flycheck-mode-map)
|
||||
(unbind-key "C-c ! i" flycheck-mode-map)
|
||||
(unbind-key "C-c ! l" flycheck-mode-map)
|
||||
(unbind-key "C-c ! n" flycheck-mode-map)
|
||||
(unbind-key "C-c ! p" flycheck-mode-map)
|
||||
(unbind-key "C-c ! s" flycheck-mode-map)
|
||||
(unbind-key "C-c ! v" flycheck-mode-map)
|
||||
(unbind-key "C-c ! x" flycheck-mode-map))
|
||||
|
||||
(provide 'icejam-flycheck)
|
||||
;;; icejam-flycheck.el ends here
|
||||
|
|
@ -37,18 +37,18 @@
|
|||
(require '+custom-pkg-base "$HOME/.emacs.d/pkg/base.el")
|
||||
(require '+custom-pkg-sys-specific "$HOME/.emacs.d/pkg/sys-specific.el")
|
||||
(require '+custom-pkg-ivy "$HOME/.emacs.d/pkg/ivy.el")
|
||||
(require 'icejam-avy)
|
||||
(require '+custom-pkg-transient "$HOME/.emacs.d/pkg/transient.el")
|
||||
(require '+custom-pkg-magit "$HOME/.emacs.d/pkg/magit.el")
|
||||
(require '+custom-pkg-prog-mode "$HOME/.emacs.d/pkg/prog-mode.el")
|
||||
(require '+custom-pkg-company-yasnippet "$HOME/.emacs.d/pkg/company-yasnippet.el")
|
||||
(require '+custom-pkg-flycheck "$HOME/.emacs.d/pkg/flycheck.el")
|
||||
(require 'icejam-company-yasnippet)
|
||||
(require 'icejam-flycheck)
|
||||
(require 'icejam-projectile)
|
||||
(require 'icejam-ispell)
|
||||
(require 'icejam-deft)
|
||||
(require 'icejam-lsp)
|
||||
(require 'icejam-dashboard)
|
||||
(require 'icejam-vundo)
|
||||
(require 'icejam-avy)
|
||||
(require 'icejam-speed-type)
|
||||
|
||||
;; Themes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue