mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
nixvimConfigs/fiesta/setups/completion: init
This commit is contained in:
parent
1abadc5841
commit
a58ead9b0d
@ -6,6 +6,7 @@
|
||||
|
||||
nixvimConfigs.fiesta.setups = {
|
||||
snippets.enable = true;
|
||||
completion.enable = true;
|
||||
treesitter.enable = true;
|
||||
debugging.enable = true;
|
||||
desktop-utils.enable = true;
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./setups/completion.nix
|
||||
./setups/debugging.nix
|
||||
./setups/desktop-utils.nix
|
||||
./setups/snippets
|
||||
|
72
configs/nixvim/fiesta/modules/setups/completion.nix
Normal file
72
configs/nixvim/fiesta/modules/setups/completion.nix
Normal file
@ -0,0 +1,72 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
nixvimCfg = config.nixvimConfigs.fiesta;
|
||||
cfg = nixvimCfg.setups.completion;
|
||||
in
|
||||
{
|
||||
options.nixvimConfigs.fiesta.setups.completion.enable =
|
||||
lib.mkEnableOption "debugging setup for Fiesta NixVim";
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
{
|
||||
plugins.nvim-cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<C-Space" = "cmp.mapping.complete()";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-u>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-g>" = "cmp.mapping.close()";
|
||||
"<Tab>" = {
|
||||
action = "cmp.mapping.select_next_item()";
|
||||
modes = [ "i" "s" ];
|
||||
};
|
||||
"<S-Tab>" = {
|
||||
action = "cmp.mapping.select_prev_item()";
|
||||
modes = [ "i" "s" ];
|
||||
};
|
||||
};
|
||||
|
||||
sources = [
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
groupIndex = 1;
|
||||
}
|
||||
|
||||
(lib.mkIf nixvimCfg.setups.snippets.enable {
|
||||
name = "luasnip";
|
||||
groupIndex = 2;
|
||||
})
|
||||
|
||||
{ name = "buffer"; }
|
||||
|
||||
{
|
||||
name = "path";
|
||||
groupIndex = 3;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# All of the typical completion sources I would need.
|
||||
plugins.cmp-buffer.enable = true;
|
||||
plugins.cmp-path.enable = true;
|
||||
plugins.cmp-vim-lsp.enable = true;
|
||||
plugins.cmp-nvim-lua.enable = true;
|
||||
}
|
||||
|
||||
(lib.mkIf nixvimCfg.setups.debugging.enable {
|
||||
plugins.cmp-dap.enable = true;
|
||||
})
|
||||
|
||||
(lib.mkIf nixvimCfg.setups.treesitter.enable {
|
||||
plugins.cmp-treesitter.enable = true;
|
||||
})
|
||||
|
||||
(lib.mkIf nixvimCfg.setups.snippets.enable {
|
||||
plugins.cmp_luasnip.enable = true;
|
||||
})
|
||||
]);
|
||||
}
|
Loading…
Reference in New Issue
Block a user