mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 16:39:04 +02:00
update
This commit is contained in:
parent
25b04f10d1
commit
92f288bddf
3 changed files with 108 additions and 175 deletions
|
@ -1,94 +0,0 @@
|
||||||
return {
|
|
||||||
{ "nvim-treesitter/nvim-treesitter" },
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
version = false, -- last release is way too old
|
|
||||||
event = "InsertEnter",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"hrsh7th/cmp-nvim-lua",
|
|
||||||
-- {
|
|
||||||
-- "hrsh7th/cmp-cmdline",
|
|
||||||
-- --event = "BufWinEnter",
|
|
||||||
-- event = "VeryLazy",
|
|
||||||
-- config = function()
|
|
||||||
-- require("user.cmdline")
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
opts = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
|
|
||||||
local check_backspace = function()
|
|
||||||
local col = vim.fn.col(".") - 1
|
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
completion = {
|
|
||||||
completeopt = "menu,menuone,noinsert",
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
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, {
|
|
||||||
"i",
|
|
||||||
"s",
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "nvim_lua" },
|
|
||||||
}),
|
|
||||||
formatting = {
|
|
||||||
fields = { "kind", "abbr", "menu" },
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
|
||||||
vim_item.menu = ({
|
|
||||||
nvim_lsp = "(LSP)",
|
|
||||||
luasnip = "(Snippet)",
|
|
||||||
buffer = "(Buffer)",
|
|
||||||
path = "(Path)",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = false,
|
|
||||||
native_menu = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
return {
|
|
||||||
-- {
|
|
||||||
-- "hrsh7th/cmp-cmdline",
|
|
||||||
-- event = "BufWinEnter",
|
|
||||||
-- config = function()
|
|
||||||
-- local cmp = require("cmp")
|
|
||||||
-- -- for cmd line
|
|
||||||
-- cmp.setup.cmdline("/", {
|
|
||||||
-- mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
-- sources = {
|
|
||||||
-- { name = "buffer" },
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- -- -- `:` cmdline setup.
|
|
||||||
-- cmp.setup.cmdline(":", {
|
|
||||||
-- mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
-- sources = cmp.config.sources({
|
|
||||||
-- { name = "path" },
|
|
||||||
-- }, {
|
|
||||||
-- {
|
|
||||||
-- name = "cmdline",
|
|
||||||
-- option = {
|
|
||||||
-- ignore_cmds = { "man", "!" },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- }),
|
|
||||||
-- })
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- for auto complate commond mode
|
|
||||||
{
|
|
||||||
"gelguy/wilder.nvim",
|
|
||||||
event = "BufWinEnter",
|
|
||||||
config = function()
|
|
||||||
local wilder = require("wilder")
|
|
||||||
wilder.setup({ modes = { ":", "/", "?" } })
|
|
||||||
wilder.set_option(
|
|
||||||
"renderer",
|
|
||||||
wilder.popupmenu_renderer({
|
|
||||||
highlighter = wilder.basic_highlighter(),
|
|
||||||
left = { " ", wilder.popupmenu_devicons() },
|
|
||||||
right = { " ", wilder.popupmenu_scrollbar() },
|
|
||||||
})
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -71,38 +71,98 @@ return {
|
||||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- -- auto completion (dipindah supaya loading lebih cepat)
|
-- for cmp
|
||||||
-- {
|
{
|
||||||
-- "hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
-- version = false, -- last release is way too old
|
version = false, -- last release is way too old
|
||||||
-- event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
-- dependencies = {
|
dependencies = {
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
-- "hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
-- "hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
-- "saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
-- "hrsh7th/cmp-nvim-lua",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
-- {
|
-- {
|
||||||
-- "tzachar/cmp-tabnine",
|
-- "hrsh7th/cmp-cmdline",
|
||||||
-- build = build,
|
-- --event = "BufWinEnter",
|
||||||
-- event = "BufWinEnter",
|
-- event = "VeryLazy",
|
||||||
-- config = function()
|
-- config = function()
|
||||||
-- require("user.tabnine")
|
-- require("user.cmdline")
|
||||||
-- end,
|
-- end,
|
||||||
-- },
|
-- },
|
||||||
-- -- {
|
},
|
||||||
-- -- "hrsh7th/cmp-cmdline",
|
opts = function()
|
||||||
-- -- event = "BufWinEnter",
|
local cmp = require("cmp")
|
||||||
-- -- config = function()
|
local luasnip = require("luasnip")
|
||||||
-- -- require("user.cmdline")
|
|
||||||
-- -- end,
|
local check_backspace = function()
|
||||||
-- -- },
|
local col = vim.fn.col(".") - 1
|
||||||
-- },
|
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||||
-- opts = function()
|
end
|
||||||
-- require("user.cmp")
|
|
||||||
-- end,
|
return {
|
||||||
-- },
|
completion = {
|
||||||
--
|
completeopt = "menu,menuone,noinsert",
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
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, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
}),
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
||||||
|
vim_item.menu = ({
|
||||||
|
nvim_lsp = "(LSP)",
|
||||||
|
luasnip = "(Snippet)",
|
||||||
|
buffer = "(Buffer)",
|
||||||
|
path = "(Path)",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = false,
|
||||||
|
native_menu = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = "BufWinEnter",
|
event = "BufWinEnter",
|
||||||
|
@ -439,4 +499,20 @@ return {
|
||||||
require("fidget").setup()
|
require("fidget").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"gelguy/wilder.nvim",
|
||||||
|
event = "BufWinEnter",
|
||||||
|
config = function()
|
||||||
|
local wilder = require("wilder")
|
||||||
|
wilder.setup({ modes = { ":", "/", "?" } })
|
||||||
|
wilder.set_option(
|
||||||
|
"renderer",
|
||||||
|
wilder.popupmenu_renderer({
|
||||||
|
highlighter = wilder.basic_highlighter(),
|
||||||
|
left = { " ", wilder.popupmenu_devicons() },
|
||||||
|
right = { " ", wilder.popupmenu_scrollbar() },
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue