all repos — nixfiles @ d3779759662e190b9ce7ccbd4620b956984e2b07

System and user configuration, managed by nix and home-manager

TabNine: move basic editor setup to tabnine module

Alan Pearce
commit

d3779759662e190b9ce7ccbd4620b956984e2b07

parent

83ff6d74036e287497bf987f336ca800b101ed0b

M user/modules/tabnine.nixuser/modules/tabnine.nix
@@ -72,5 +72,22 @@ };
home.file."${cfg.configDir}/registration_key" = { text = cfg.registrationKey; }; + + programs.neovim.plugins = [ + pkgs.vimPlugins.coc-tabnine + ]; + programs.neovim.coc.settings = { + "tabnine.binary_path" = "${pkgs.tabnine}/bin/TabNine"; + }; + + programs.emacs.extraPackages = epkgs: [ + epkgs.company-tabnine + ]; + programs.emacs.extraConfig = '' + (with-eval-after-load 'company-tabnine + (advice-add 'company-tabnine--executable-path :around + (lambda (original-function &rest args) + "${pkgs.tabnine}/bin/TabNine"))) + ''; }; }
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -87,7 +87,6 @@ capf-autosuggest
company company-posframe company-shell - company-tabnine consult consult-eglot counsel
@@ -162,10 +161,6 @@ ]);
extraConfig = '' (with-eval-after-load 'editorconfig (setq editorconfig-exec-path "${pkgs.editorconfig-core-c}/bin/editorconfig")) - (with-eval-after-load 'company-tabnine - (advice-add 'company-tabnine--executable-path :around - (lambda (original-function &rest args) - "${pkgs.tabnine}/bin/TabNine"))) '' + lib.optionalString stdenv.isDarwin '' (with-eval-after-load 'files (setq insert-directory-program "${pkgs.coreutils-prefixed}/bin/gls"))
M user/settings/neovim.nixuser/settings/neovim.nix
@@ -12,7 +12,6 @@ plugins = with pkgs.vimPlugins; [
commentary coc-git coc-json - coc-tabnine coc-yaml direnv-vim vim-surround
@@ -25,9 +24,6 @@ "json.enable" = true;
"suggest.enablePreview" = true; "coc.preferences.formatOnSaveFiletypes" = [ "nix" ]; "nil.formatting.command" = "nixpkgs-fmt"; - tabnine = { - binary_path = "${pkgs.tabnine}/bin/TabNine"; - }; semantictokens = { filetypes = [ "nix" ]; };
M user/settings/tabnine.nixuser/settings/tabnine.nix
@@ -7,7 +7,7 @@ home.packages = with pkgs; [
tabnine ]; programs.tabnine = { - enable = true; + enable = pkgs.lib.mkDefault true; config = { version = pkgs.tabnine.version;
@@ -84,9 +84,5 @@ "-gocodecompletion"
]; }; }; - }; - - programs.neovim.coc.settings = { - "tabnine.binary_path" = "${pkgs.tabnine}/bin/TabNine"; }; }