emacs: install copilot
parent
a82ba1156e
commit
523e51fbbd
|
@ -362,7 +362,10 @@ from https://vickychijwani.me/nuggets-from-my-emacs-part-i/
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package company
|
(use-package company
|
||||||
:diminish
|
:diminish
|
||||||
:hook (after-init . global-company-mode))
|
:hook (after-init . global-company-mode)
|
||||||
|
:config
|
||||||
|
;; use copilot
|
||||||
|
(delq 'company-preview-if-just-one-frontend company-frontends))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Indentation
|
** Indentation
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -370,7 +373,11 @@ from https://vickychijwani.me/nuggets-from-my-emacs-part-i/
|
||||||
(setq-default tab-width 2) ; or any other preferred value
|
(setq-default tab-width 2) ; or any other preferred value
|
||||||
(defvaralias 'c-basic-offset 'tab-width)
|
(defvaralias 'c-basic-offset 'tab-width)
|
||||||
(defvaralias 'cperl-indent-level 'tab-width)
|
(defvaralias 'cperl-indent-level 'tab-width)
|
||||||
(define-key prog-mode-map (kbd "<tab>") #'company-indent-or-complete-common)
|
(defun yorick/copilot-tab (arg)
|
||||||
|
(interactive "P")
|
||||||
|
(or (copilot-accept-completion)
|
||||||
|
(company-indent-or-complete-common arg)))
|
||||||
|
(define-key prog-mode-map (kbd "<tab>") #'yorick/copilot-tab)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** smart home key
|
** smart home key
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -475,6 +482,13 @@ from [[https://www.emacswiki.org/emacs/BackupDirectory][emacs wiki]]
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
|
|
||||||
|
** copilot
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package copilot
|
||||||
|
:commands (copilot-login copilot-mode)
|
||||||
|
:bind (:map copilot-mode-map ("TAB" . copilot-accept-completion)))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** DONE fix clipboard on wayland
|
** DONE fix clipboard on wayland
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq wl-copy-process nil)
|
(setq wl-copy-process nil)
|
||||||
|
|
|
@ -5,13 +5,42 @@ in {
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.emacsPgtkNativeComp;
|
package = pkgs.emacsPgtkNativeComp;
|
||||||
extraPackages = _:
|
extraConfig = ''
|
||||||
(with epkgs.melpaPackages; [
|
(setq copilot-node-executable "${pkgs.nodejs-slim-16_x}/bin/node")
|
||||||
|
'';
|
||||||
|
overrides = final: prev: {
|
||||||
|
copilot = final.melpaBuild rec {
|
||||||
|
pname = "copilot";
|
||||||
|
version = "20220916.1";
|
||||||
|
commit = "f316299bab75a380ee04e7ca49c79baf0fb296d6";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zerolfx";
|
||||||
|
repo = "copilot.el";
|
||||||
|
rev = commit;
|
||||||
|
sha256 = "sha256-n4bXnlNfCC00jVeODUlqZNThf7i8rj69zzMMfXBy8tk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
packageRequires = with final; [ dash editorconfig s ];
|
||||||
|
|
||||||
|
recipe = pkgs.writeText "recipe" ''
|
||||||
|
(copilot
|
||||||
|
:repo "zerolfx/copilot.el"
|
||||||
|
:fetcher github
|
||||||
|
:files ("dist" "*.el"))
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta.description = "Emacs plugin for GitHub Copilot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extraPackages = p:
|
||||||
|
(with p; [
|
||||||
all-the-icons
|
all-the-icons
|
||||||
avy
|
avy
|
||||||
company
|
company
|
||||||
counsel
|
counsel
|
||||||
counsel-projectile
|
counsel-projectile
|
||||||
|
copilot
|
||||||
diminish
|
diminish
|
||||||
direnv
|
direnv
|
||||||
dune
|
dune
|
||||||
|
|
Loading…
Reference in New Issue