diff --git a/modules/base/emacs/base-init.el b/modules/base/emacs/base-init.el index 9ae41745..75ece5fc 100644 --- a/modules/base/emacs/base-init.el +++ b/modules/base/emacs/base-init.el @@ -76,6 +76,7 @@ ;; Vim keybindings in other packages (use-package evil-collection :after (evil) + :diminish (evil-collection-unimpaired-mode) :config (evil-collection-init) ) @@ -90,6 +91,7 @@ :diminish (company-mode) :hook ((text-mode prog-mode) . company-mode) :custom + (company-backends '((company-capf company-yasnippet) company-files (company-dabbrev-code company-keywords) company-dabbrev)) (company-dabbrev-downcase nil "Don't downcase completions") (company-dabbrev-ignore-case t "Change full casing of completion if completion has different case") (company-minimum-prefix-length 2 "Start autocompletion after 2 characters") diff --git a/modules/development/default.nix b/modules/development/default.nix index 20c91b7f..2e509956 100644 --- a/modules/development/default.nix +++ b/modules/development/default.nix @@ -51,6 +51,18 @@ (_server (_cmd (eql java.apply.workspaceEdit)) arguments) "Eclipse JDT breaks spec and replies with edits as arguments." (mapc #'eglot--apply-workspace-edit arguments)) + ;;; eglot replaces company-backends with '(company-capf). I still + ;;; want company-yasnippet as well though + (add-to-list 'eglot-stay-out-of "company") + ) + + ;; Snippets + (use-package yasnippet + ;; This is not very nice, but let's just assume that development machines have my nixos-config checked out + :custom (yas-snippet-dirs '("/home/charlotte/repos/nixos-config/modules/development/snippets/")) + :diminish (yas-minor-mode) + :config + (yas-global-mode 1) ) ;; Forth syntax support diff --git a/modules/development/snippets/python-mode/class b/modules/development/snippets/python-mode/class new file mode 100644 index 00000000..8c8801c8 --- /dev/null +++ b/modules/development/snippets/python-mode/class @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: new class +# key: class +# -- +class $1: + """ + $2 + """ + def __init__(self${3:, *args, **kwargs}): + """ + $4 + """ + ${0:pass} +