Add copilot to emacs config

This commit is contained in:
Gabriel Simmer 2023-04-26 10:20:22 +01:00
parent 453d1f3d40
commit e8e2f867af
Signed by: arch
GPG key ID: C81B106D46C5B875
2 changed files with 96 additions and 1 deletions

View file

@ -3,9 +3,85 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(connection-local-criteria-alist
'(((:application tramp)
tramp-connection-local-default-system-profile tramp-connection-local-default-shell-profile)))
'(connection-local-profile-alist
'((tramp-connection-local-darwin-ps-profile
(tramp-process-attributes-ps-args "-acxww" "-o" "pid,uid,user,gid,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "-o" "state=abcde" "-o" "ppid,pgid,sess,tty,tpgid,minflt,majflt,time,pri,nice,vsz,rss,etime,pcpu,pmem,args")
(tramp-process-attributes-ps-format
(pid . number)
(euid . number)
(user . string)
(egid . number)
(comm . 52)
(state . 5)
(ppid . number)
(pgrp . number)
(sess . number)
(ttname . string)
(tpgid . number)
(minflt . number)
(majflt . number)
(time . tramp-ps-time)
(pri . number)
(nice . number)
(vsize . number)
(rss . number)
(etime . tramp-ps-time)
(pcpu . number)
(pmem . number)
(args)))
(tramp-connection-local-busybox-ps-profile
(tramp-process-attributes-ps-args "-o" "pid,user,group,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "-o" "stat=abcde" "-o" "ppid,pgid,tty,time,nice,etime,args")
(tramp-process-attributes-ps-format
(pid . number)
(user . string)
(group . string)
(comm . 52)
(state . 5)
(ppid . number)
(pgrp . number)
(ttname . string)
(time . tramp-ps-time)
(nice . number)
(etime . tramp-ps-time)
(args)))
(tramp-connection-local-bsd-ps-profile
(tramp-process-attributes-ps-args "-acxww" "-o" "pid,euid,user,egid,egroup,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "-o" "state,ppid,pgid,sid,tty,tpgid,minflt,majflt,time,pri,nice,vsz,rss,etimes,pcpu,pmem,args")
(tramp-process-attributes-ps-format
(pid . number)
(euid . number)
(user . string)
(egid . number)
(group . string)
(comm . 52)
(state . string)
(ppid . number)
(pgrp . number)
(sess . number)
(ttname . string)
(tpgid . number)
(minflt . number)
(majflt . number)
(time . tramp-ps-time)
(pri . number)
(nice . number)
(vsize . number)
(rss . number)
(etime . number)
(pcpu . number)
(pmem . number)
(args)))
(tramp-connection-local-default-shell-profile
(shell-file-name . "/bin/sh")
(shell-command-switch . "-c"))
(tramp-connection-local-default-system-profile
(path-separator . ":")
(null-device . "/dev/null"))))
'(custom-enabled-themes '(modus-operandi-tinted))
'(custom-safe-themes
'("fb83a50c80de36f23aea5919e50e1bccd565ca5bb646af95729dc8c5f926cbf3" "e7820b899036ae7e966dcaaec29fd6b87aef253748b7de09e74fdc54407a7a02" "1781e8bccbd8869472c09b744899ff4174d23e4f7517b8a6c721100288311fa5" default))
'("f82e68d489e6c21c9552c4e8e35a03d126d9eba632a8e7b4f9329d1374b4a19c" "d395c1793e0d64797d711c870571a0033174ca321ed48444efbe640bf692bf4f" "11873c4fbf465b956889adfa9182495db3bf214d9a70c0f858f07f6cc91cbd47" "eb7cd622a0916358a6ef6305e661c6abfad4decb4a7c12e73d6df871b8a195f8" "fb83a50c80de36f23aea5919e50e1bccd565ca5bb646af95729dc8c5f926cbf3" "e7820b899036ae7e966dcaaec29fd6b87aef253748b7de09e74fdc54407a7a02" "1781e8bccbd8869472c09b744899ff4174d23e4f7517b8a6c721100288311fa5" default))
'(safe-local-variable-values
'((eval modify-syntax-entry 43 "'")
(eval modify-syntax-entry 36 "'")

View file

@ -42,6 +42,7 @@
;; package list we want installed
;; first use-package
(straight-use-package 'use-package)
(use-package modus-themes :straight t)
(use-package vterm :straight t)
(use-package el-patch :straight t)
(use-package doom-modeline
@ -164,6 +165,24 @@
(use-package rust-mode :straight t)
(use-package markdown-mode :straight t)
(use-package olivetti :straight t)
(use-package copilot
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
:ensure t)
; complete by copilot first, then company-mode
(defun my-tab ()
(interactive)
(or (copilot-accept-completion)
(company-indent-or-complete-common nil)))
; modify company-mode behaviors
(with-eval-after-load 'company
; disable inline previews
(delq 'company-preview-if-just-one-frontend company-frontends)
; enable tab completion
(define-key company-mode-map (kbd "C-<tab>") 'my-tab)
(define-key company-mode-map (kbd "C-TAB") 'my-tab)
(define-key company-active-map (kbd "C-<tab>") 'my-tab)
(define-key company-active-map (kbd "C-TAB") 'my-tab))
;; Adapted from https://github.com/Slackwise/dotfiles/blob/master/emacs/slackwise.el
(setq-default