blink-cmp - Way nicer

This commit is contained in:
Anthony Cicchetti 2025-03-28 15:45:52 -04:00
parent 0043e78eb2
commit aeb6afa880
4 changed files with 67 additions and 99 deletions

View file

@ -41,7 +41,6 @@
pkgs.hello
pkgs.delta
pkgs.difftastic
pkgs.alejandra
pkgs.nodePackages.bash-language-server
pkgs.shellcheck
pkgs.shfmt

View file

@ -140,11 +140,11 @@
"zon2nix": "zon2nix"
},
"locked": {
"lastModified": 1742702839,
"narHash": "sha256-9atn1IrQH/R2ahK+Zj6JpS0CfjSPBLObHQeTw/4Vv5Q=",
"lastModified": 1743087033,
"narHash": "sha256-SvCTbeFnojkQ9Y6SjSTru2xaeqF4BvcteCcggfb5LGk=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "c58fe676ad6212114455ac89a2703dcc3b8b67b7",
"rev": "0afb922375b2f8329f1c923cb58df75ddd4a6eb1",
"type": "github"
},
"original": {
@ -160,11 +160,11 @@
]
},
"locked": {
"lastModified": 1742771635,
"narHash": "sha256-HQHzQPrg+g22tb3/K/4tgJjPzM+/5jbaujCZd8s2Mls=",
"lastModified": 1743136572,
"narHash": "sha256-uwaVrKgi6g1TUq56247j6QvvFtYHloCkjCrEpGBvV54=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ad0614a1ec9cce3b13169e20ceb7e55dfaf2a818",
"rev": "1efd2503172016a6742c87b47b43ca2c8145607d",
"type": "github"
},
"original": {
@ -233,11 +233,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1742750727,
"narHash": "sha256-NCLL5+P8X0fLIEowCqDXU0OqLm5NRyNLyorghiPCfe4=",
"lastModified": 1743096623,
"narHash": "sha256-In+XxSBeofO1N3npGmdYFjrNFdzN2yQsJg26VdWsKcg=",
"owner": "m15a",
"repo": "flake-awesome-neovim-plugins",
"rev": "2454117d654292eee6d2a27f596d479833b9981e",
"rev": "7dafc523d8062ee7b9571d481f6651718e9a5807",
"type": "github"
},
"original": {
@ -248,11 +248,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1742776792,
"narHash": "sha256-04dzabgZAMUt3jKwlCZpU877kCI3Kl1gWlNRlXo9KNo=",
"lastModified": 1743166830,
"narHash": "sha256-Vg0bN62JwzH1rPOpJRBUkmTUj6q/HW8l4sBS1AV/MMw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a6d0c7c8a8a79ec30c69c5dcd34a5225b55ce8bf",
"rev": "71d127da24364704116ca250f40fa478effa68e1",
"type": "github"
},
"original": {
@ -286,11 +286,11 @@
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1742732006,
"narHash": "sha256-ZIBMfPNb/hfoFf79MRnhDXGKl0yGhjlYEpy3+/jbxFI=",
"lastModified": 1743157969,
"narHash": "sha256-ldlSyVKNaXL7ys7Jr7mLhlpGDE4VPVcWmV7Odupn5TY=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "7776e37b67e7875c3cd56d9d20fd050798071706",
"rev": "95573411bc9be155a93b0f15d2bad62c6b43b3cc",
"type": "github"
},
"original": {
@ -404,11 +404,11 @@
]
},
"locked": {
"lastModified": 1742370146,
"narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=",
"lastModified": 1743081648,
"narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "adc195eef5da3606891cedf80c0d9ce2d3190808",
"rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7",
"type": "github"
},
"original": {

View file

@ -10,6 +10,9 @@
colorschemes = {
onedark.enable = true;
};
diagnostics = {
virtual_lines = true;
};
plugins = {
fugitive = {
enable = true;
@ -67,9 +70,6 @@
};
};
};
lsp-lines = {
enable = true;
};
lsp = {
enable = true;
preConfig = '''';
@ -101,7 +101,7 @@
lspkind = {
enable = true;
mode = "symbol";
cmp.enable = true;
# cmp.enable = true;
symbolMap = {
# TODO
"Text" = "";
@ -146,43 +146,55 @@
};
};
};
cmp = {
blink-cmp = {
enable = true;
autoEnableSources = true;
settings = {
mapping = {
"<CR>" = "cmp.mapping.confirm({ select = true})";
"<C-Space>" = "cmp.mapping.complete()";
"<Tab>" = ''
cmp.mapping(function(fallback)
if cmp.visible() then
local entry = cmp.get_selected_entry()
if not entry then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
end
cmp.confirm()
else
fallback()
end
end, {"i", "s", "c"})
'';
"<S-Tab>" = ''
cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {"i", "s", "c"})
'';
keymap.preset = "super-tab";
appearance = {
nerd_font_variant = "mono";
};
view = {
entries.name = "custom";
completion = {
ghost_text.enabled = true;
accept = {
auto_brackets = {
enabled = true;
};
};
list = {
selection = {
auto_insert = false;
preselect = true;
};
};
menu = {
# draw == colorful-menu.nvim config
};
};
signature = {
enabled = true;
};
sources = {
default = [
"lsp"
"path"
"snippets"
"buffer"
# [TODO] Disabled until I figure this out, rust uses :: "emoji"
];
providers = {
emoji = {
module = "blink-emoji";
name = "Emoji";
score_offset = 15;
opts = {
insert = true;
};
};
};
};
};
};
blink-emoji.enable = true;
project-nvim = {
enable = true;
enableTelescope = true;
@ -193,10 +205,10 @@
};
telescope = {
enable = true;
extensions.live-grep-args.enable = true;
enabledExtensions = [
"zf-native" # TODO
"projects" # TODO
"egrepify" # TODO
];
# extraLua = {
# post = builtins.readFile ./neovim/telescope.lua;
@ -209,7 +221,7 @@
};
"<leader>fg" = {
mode = "n";
action = "egrepify";
action = "live_grep";
options.desc = "Live Grep";
};
"<leader>fb" = {

View file

@ -47,46 +47,3 @@ require("gitlinker").setup()
require("nvim-biscuits").setup()
require("overseer").setup()
require("officer").setup({ create_mappings = true })
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
cmdline,
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
do
function setup()
require("ufo").setup({
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
})
require("ufo").setup({})
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
end
success, output = pcall(setup) -- execute 'setup()' and catch any errors
if not success then
print("Error on setup for plugin: ufo")
print(output)
end
end