emacs: Add yasnippets to rust company completions.
This commit is contained in:
parent
3cd9d1c77b
commit
5242db83e2
3 changed files with 25 additions and 1 deletions
|
@ -100,7 +100,9 @@ in mkIf (elem "emacs::company" config.machine.pkgs) {
|
||||||
company = {
|
company = {
|
||||||
enable = true;
|
enable = true;
|
||||||
diminish = [ "company-mode" ];
|
diminish = [ "company-mode" ];
|
||||||
hook = [ "(after-init . global-company-mode)" ];
|
hook = [ "(after-init . global-company-mode)" ]
|
||||||
|
++ optional (elem "emacs::rust" config.machine.pkgs)
|
||||||
|
''(rust-mode . (lambda () (setq company-backends '((company-capf :with company-yasnippet)))))'';
|
||||||
bind = { "\t" = "'company-complete-common"; };
|
bind = { "\t" = "'company-complete-common"; };
|
||||||
init = ''(require 'ffap)'';
|
init = ''(require 'ffap)'';
|
||||||
config = ''
|
config = ''
|
||||||
|
@ -119,6 +121,7 @@ in mkIf (elem "emacs::company" config.machine.pkgs) {
|
||||||
([remap complete-symbol] . company-complete-common))
|
([remap complete-symbol] . company-complete-common))
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
company-box = {
|
company-box = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hook = [ "(company-mode . (lambda () (company-box-mode)))" ];
|
hook = [ "(company-mode . (lambda () (company-box-mode)))" ];
|
||||||
|
|
|
@ -15,6 +15,9 @@ mkIf (elem "emacs::lsp" config.machine.pkgs) {
|
||||||
${optionalString (elem "emacs::rust" config.machine.pkgs)
|
${optionalString (elem "emacs::rust" config.machine.pkgs)
|
||||||
''(rust-mode . "rust")''}
|
''(rust-mode . "rust")''}
|
||||||
))
|
))
|
||||||
|
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
||||||
|
(setq lsp-rust-clippy-preference "on")
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
18
pkgs/pkgsets/emacs/yasnippet.nix
Normal file
18
pkgs/pkgsets/emacs/yasnippet.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
mkIf (elem "emacs::yasnippet" config.machine.pkgs) {
|
||||||
|
programs.emacs.init.usePackage = {
|
||||||
|
yasnippet = {
|
||||||
|
enable = true;
|
||||||
|
hook = [ "(after-init . yas-global-mode)" ];
|
||||||
|
# config = ''
|
||||||
|
|
||||||
|
# '';
|
||||||
|
};
|
||||||
|
yasnippet-snippets = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue