121 lines
2.2 KiB
Lua
121 lines
2.2 KiB
Lua
local M = {}
|
|
|
|
M.treesitter = {
|
|
ensure_installed = {
|
|
"vim",
|
|
"lua",
|
|
"html",
|
|
"css",
|
|
"javascript",
|
|
"typescript",
|
|
"python",
|
|
"tsx",
|
|
"c",
|
|
"markdown",
|
|
"markdown_inline",
|
|
},
|
|
indent = {
|
|
enable = true,
|
|
-- disable = {
|
|
-- "python"
|
|
-- },
|
|
},
|
|
}
|
|
|
|
M.mason = {
|
|
ensure_installed = {
|
|
-- lua stuff
|
|
"lua-language-server",
|
|
"stylua",
|
|
|
|
-- web dev stuff
|
|
"css-lsp",
|
|
"html-lsp",
|
|
"typescript-language-server",
|
|
"deno",
|
|
"prettier",
|
|
|
|
-- c/cpp stuff
|
|
"clangd",
|
|
"clang-format",
|
|
|
|
"jedi_language_server",
|
|
|
|
|
|
"docker_compose_language_service",
|
|
"dockerls",
|
|
},
|
|
}
|
|
|
|
-- git support in nvimtree
|
|
M.nvimtree = {
|
|
git = {
|
|
enable = true,
|
|
},
|
|
|
|
renderer = {
|
|
highlight_git = true,
|
|
icons = {
|
|
show = {
|
|
git = true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
M.cmp = function (_, opts)
|
|
local cmp = require "cmp"
|
|
opts.experimental = {
|
|
ghost_text = true,
|
|
}
|
|
opts.sources = cmp.config.sources({
|
|
{ name = "nvim_lsp" },
|
|
{ name = "luasnip" },
|
|
{ name = "nvim_lua" },
|
|
{ name = "path" },
|
|
{ name = "buffer", keyword_length = 5},
|
|
})
|
|
|
|
opts.mapping = cmp.config.mapping {
|
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
["<C-Space>"] = cmp.mapping.complete(),
|
|
["<C-e>"] = cmp.mapping.close(),
|
|
["<C-y>"] = cmp.mapping.confirm {
|
|
behavior = cmp.ConfirmBehavior.Insert,
|
|
select = true,
|
|
},
|
|
["<Tab>"] = cmp.mapping(function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_next_item()
|
|
elseif require("luasnip").expand_or_jumpable() then
|
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
|
else
|
|
fallback()
|
|
end
|
|
end, {
|
|
"i",
|
|
"s",
|
|
}),
|
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_prev_item()
|
|
elseif require("luasnip").jumpable(-1) then
|
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
|
else
|
|
fallback()
|
|
end
|
|
end, {
|
|
"i",
|
|
"s",
|
|
}),
|
|
}
|
|
return opts
|
|
end
|
|
|
|
|
|
return M
|
|
|