cmp,harpoon,illuminate,lspkind: added

This commit is contained in:
xinyangli 2024-08-21 23:03:46 +08:00
parent c58b1d1826
commit de8e9493c0
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
7 changed files with 106 additions and 2 deletions

View file

@ -3,7 +3,36 @@
# Color scheme. # Color scheme.
colorschemes.catppuccin = { colorschemes.catppuccin = {
enable = true; enable = true;
settings.flavour = "mocha"; settings = {
flavour = "mocha";
no_bold = false;
no_italic = false;
no_underline = false;
integrations = {
cmp = true;
neotree = true;
harpoon = true;
gitsigns = true;
which_key = true;
illuminate.enabled = true;
treesitter = true;
treesitter_context = true;
telescope.enabled = true;
indent_blankline.enabled = true;
native_lsp = {
enabled = true;
inlay_hints = {
background = true;
};
underlines = {
errors = ["underline"];
hints = ["underline"];
information = ["underline"];
warnings = ["underline"];
};
};
};
};
}; };
# Options. # Options.

View file

@ -6,17 +6,20 @@
./core.nix ./core.nix
./direnv.nix ./direnv.nix
./gitsigns.nix ./gitsigns.nix
./harpoon.nix
./illuminate.nix
./indent-blankline.nix ./indent-blankline.nix
./keybindings.nix ./keybindings.nix
./lazygit.nix ./lazygit.nix
./lsp ./lsp
./lualine.nix ./lualine.nix
./neo-tree.nix
./nvim-cmp.nix
./project.nix ./project.nix
./rainbow-delimiters.nix ./rainbow-delimiters.nix
./telescope.nix ./telescope.nix
./toggleterm.nix ./toggleterm.nix
./treesitter.nix ./treesitter.nix
./neo-tree.nix
./which-key.nix ./which-key.nix
]; ];
} }

5
config/harpoon.nix Normal file
View file

@ -0,0 +1,5 @@
{
plugins.harpoon = {
enable = true;
};
}

15
config/illuminate.nix Normal file
View file

@ -0,0 +1,15 @@
{ ... }:
{
plugins.illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
}

View file

@ -2,5 +2,6 @@
imports = [ imports = [
./lsp.nix ./lsp.nix
./lsp-format.nix ./lsp-format.nix
./lspkind.nix
]; ];
} }

12
config/lsp/lspkind.nix Normal file
View file

@ -0,0 +1,12 @@
{
plugins.lspkind = {
enable = true;
symbolMap = {
Copilot = "";
};
extraOptions = {
maxwidth = 50;
ellipsis_char = "...";
};
};
}

39
config/nvim-cmp.nix Normal file
View file

@ -0,0 +1,39 @@
{
plugins = {
cmp = {
enable = true;
autoEnableSources = false;
settings = {
sources = [
{ name = "nvim_lsp"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};};
};
cmp-nvim-lsp.enable = true;
cmp-path.enable = true;
cmp-buffer.enable = true;
};
}