feat(nvim): Align to Kickstart NVIM

This commit is contained in:
Pratik Tripathy
2024-12-15 21:48:29 +05:30
parent 3f49341ba1
commit 80fdf243e3
10 changed files with 218 additions and 134 deletions

View File

@@ -5,10 +5,33 @@ return {
{
-- Autocompletion
"hrsh7th/nvim-cmp",
event = "InsertEnter",
cond = require("config.util").is_not_vscode(),
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
"L3MON4D3/LuaSnip",
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
"saadparwaiz1/cmp_luasnip",
-- Adds LSP completion capabilities
@@ -18,9 +41,6 @@ return {
"hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip",
-- Adds a number of user-friendly snippets
"rafamadriz/friendly-snippets",
},
config = function()
-- See `:help cmp`
@@ -63,6 +83,19 @@ return {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
-- <C-l> will move you to the right of each of the expansion locations
-- <C-h> is similar, except moving you backwards.
["<C-l>"] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
["<C-h>"] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
}),
sources = {
{ name = "nvim_lsp" },