nvim-cmp & friends
This commit is contained in:
parent
a1e89d9b53
commit
29f12680d7
7 changed files with 149 additions and 20 deletions
16
flake.lock
generated
16
flake.lock
generated
|
@ -33,11 +33,11 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks_2"
|
"pre-commit-hooks": "pre-commit-hooks_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711122363,
|
"lastModified": 1711371145,
|
||||||
"narHash": "sha256-Yw/t9HCY9U/EpkXlzW+5o/WEpZKUNgrSbcuHOZFpAXU=",
|
"narHash": "sha256-abuKk8NiXO+tMTOtt+4QbSaFsSmN+Vo4UGLDO4+Ncjg=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "63c7109f20b5ded0bc07f95ece9518bbb7fdea5b",
|
"rev": "e0440c5c88ae2a56813402f32377140840203c52",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -428,12 +428,12 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711001935,
|
"lastModified": 1711163522,
|
||||||
"narHash": "sha256-URtGpHue7HHZK0mrHnSf8wJ6OmMKYSsoLmJybrOLFSQ=",
|
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
|
||||||
"rev": "20f77aa09916374aa3141cbc605c955626762c9a",
|
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
|
||||||
"revCount": 600876,
|
"revCount": 601756,
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.600876%2Brev-20f77aa09916374aa3141cbc605c955626762c9a/018e65e3-9c1d-74a8-acde-67868b074670/source.tar.gz"
|
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.601756%2Brev-44d0940ea560dee511026a53f0e2e2cde489b4d4/018e6c73-b9c2-7b70-a778-9c1546525f10/source.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
|
12
nix/home-manager/flake.lock
generated
12
nix/home-manager/flake.lock
generated
|
@ -131,11 +131,11 @@
|
||||||
"nmt": "nmt"
|
"nmt": "nmt"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711294978,
|
"lastModified": 1711372234,
|
||||||
"narHash": "sha256-olXsNg5K9Jl76KLCxekxqgczEC10daMeIlyMge4QDoo=",
|
"narHash": "sha256-TCQ9+re33P1N5KyzmXM7taQ1d1A2bVsTfrQgE+z5P04=",
|
||||||
"owner": "nixneovim",
|
"owner": "nixneovim",
|
||||||
"repo": "nixneovim",
|
"repo": "nixneovim",
|
||||||
"rev": "2158e2a8b33ad56ebca580769b53c847092c636f",
|
"rev": "116ae11583c386e5128a16873e79f817e8251d17",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -187,11 +187,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711320233,
|
"lastModified": 1711543506,
|
||||||
"narHash": "sha256-CAFcHr62hp8/7VYAo7jVrpbrjG5/TKPmKE0GIEXJbTw=",
|
"narHash": "sha256-2ZZlQscIBmJUJVy6EysvrJzbrzz8ixA3v/scllRIMaQ=",
|
||||||
"owner": "nixOS",
|
"owner": "nixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f7a6bfd64cb1cb3c12203b6cc4c952ab2b802c79",
|
"rev": "800d3f070b9514ab86906ffd5db4a7c28e833991",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -62,7 +62,7 @@ in {
|
||||||
sqlite
|
sqlite
|
||||||
tmux
|
tmux
|
||||||
# vscode-fhs
|
# vscode-fhs
|
||||||
yt-dlp
|
python312Packages.yt-dlp
|
||||||
zenith
|
zenith
|
||||||
# zoom-us
|
# zoom-us
|
||||||
zstd
|
zstd
|
||||||
|
|
|
@ -68,10 +68,9 @@
|
||||||
conflictStyle = "zdiff3";
|
conflictStyle = "zdiff3";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Commented out until git 2.44.0 makes its way to nixpkgs
|
pack = {
|
||||||
# pack = {
|
allowPackReuse = "multi";
|
||||||
# allowPackReuse = "multi";
|
};
|
||||||
# };
|
|
||||||
|
|
||||||
push = {
|
push = {
|
||||||
autoSetupRemote = true;
|
autoSetupRemote = true;
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
fugitive = {
|
fugitive = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
luasnip = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
lspconfig = {
|
lspconfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
servers = {
|
servers = {
|
||||||
|
@ -32,6 +35,10 @@
|
||||||
terraform-ls.enable = true;
|
terraform-ls.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
lspkind = {
|
||||||
|
enable = true;
|
||||||
|
mode = "symbol";
|
||||||
|
};
|
||||||
mini = {
|
mini = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ai.enable = true;
|
ai.enable = true;
|
||||||
|
@ -50,6 +57,84 @@
|
||||||
splitjoin.enable = true;
|
splitjoin.enable = true;
|
||||||
surround.enable = true;
|
surround.enable = true;
|
||||||
};
|
};
|
||||||
|
nvim-cmp = {
|
||||||
|
enable = true;
|
||||||
|
formatting = {
|
||||||
|
format = ''
|
||||||
|
function(entry, vim_item)
|
||||||
|
vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind)
|
||||||
|
vim_item.menu = ({
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[LuaSnip]",
|
||||||
|
nvim_lua = "[Lua]",
|
||||||
|
latex_symbols = "[LaTeX]",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
mappingPresets = ["insert"];
|
||||||
|
mapping = {
|
||||||
|
"<CR>" = "cmp.mapping.confirm({ select = true})";
|
||||||
|
"<C-Space>" = "cmp.mapping.complete()";
|
||||||
|
"<Tab>" = {
|
||||||
|
modes = ["i" "s" "c"];
|
||||||
|
action = ''
|
||||||
|
function(fallback)
|
||||||
|
local entry = cmp.get_selected_entry()
|
||||||
|
if not entry then
|
||||||
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
|
cmp.confirm()
|
||||||
|
elseif entry then
|
||||||
|
cmp.confirm()
|
||||||
|
elseif luasnip.expandable() then
|
||||||
|
luasnip.expand()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif check_backspace() then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"<S-Tab>" = {
|
||||||
|
modes = ["i" "s" "c"];
|
||||||
|
action = ''
|
||||||
|
function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
snippet = {
|
||||||
|
luasnip.enable = true;
|
||||||
|
};
|
||||||
|
sources = {
|
||||||
|
cmdline = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
emoji.enable = true;
|
||||||
|
fuzzy_path.enable = true;
|
||||||
|
luasnip.enable = true;
|
||||||
|
nvim_lsp.enable = true;
|
||||||
|
nvim_lsp_document_symbol.enable = true;
|
||||||
|
nvim_lsp_signature_help.enable = true;
|
||||||
|
treesitter.enable = true;
|
||||||
|
};
|
||||||
|
view = {
|
||||||
|
entries = "custom";
|
||||||
|
};
|
||||||
|
};
|
||||||
project-nvim = {
|
project-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
@ -67,6 +152,9 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
trouble = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
undotree = {
|
undotree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
@ -84,6 +172,7 @@
|
||||||
extraPlugins =
|
extraPlugins =
|
||||||
(
|
(
|
||||||
with pkgs.vimPlugins; [
|
with pkgs.vimPlugins; [
|
||||||
|
fuzzy-nvim
|
||||||
nvim-ts-context-commentstring
|
nvim-ts-context-commentstring
|
||||||
telescope-zf-native-nvim
|
telescope-zf-native-nvim
|
||||||
vim-ReplaceWithRegister
|
vim-ReplaceWithRegister
|
||||||
|
@ -97,6 +186,8 @@
|
||||||
rainbow-delimiters-nvim
|
rainbow-delimiters-nvim
|
||||||
gitlinker-linrongbin16
|
gitlinker-linrongbin16
|
||||||
telescope-symbols-nvim
|
telescope-symbols-nvim
|
||||||
|
nvim-web-devicons
|
||||||
|
lsp-signature-nvim
|
||||||
]);
|
]);
|
||||||
mappings = {
|
mappings = {
|
||||||
normal = {
|
normal = {
|
||||||
|
|
|
@ -40,3 +40,15 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
})
|
})
|
||||||
|
|
||||||
require("gitlinker").setup()
|
require("gitlinker").setup()
|
||||||
|
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
cmp.setup.cmdline(":", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "cmdline" },
|
||||||
|
}),
|
||||||
|
matching = { disallow_symbol_nonprefix_matching = false },
|
||||||
|
})
|
||||||
|
|
|
@ -1,3 +1,30 @@
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = ","
|
vim.g.maplocalleader = ","
|
||||||
|
|
||||||
|
local kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "⨐",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "μ",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "፨",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue