pojokcodeid.nvim-lazy/lua/plugins/init.lua

379 lines
8.8 KiB
Lua
Raw Normal View History

2023-01-15 00:17:41 +07:00
return {
2023-02-05 09:09:33 +07:00
-- plugin ini merupakan penyedia library neovim lua
2023-01-15 00:22:51 +07:00
{
2023-01-15 00:17:41 +07:00
"nvim-lua/plenary.nvim",
2023-02-11 09:41:39 +07:00
lazy = true,
2023-01-15 00:17:41 +07:00
},
2023-02-05 09:09:33 +07:00
-- coding start
-- coloring code
2023-01-15 00:22:51 +07:00
{
2023-02-04 13:57:50 +07:00
"nvim-treesitter/nvim-treesitter",
2023-02-09 13:22:54 +07:00
event = "BufRead",
2023-02-05 01:44:41 +07:00
cmd = {
"TSBufDisable",
"TSBufEnable",
"TSBufToggle",
"TSDisable",
"TSEnable",
"TSToggle",
"TSInstall",
"TSInstallInfo",
"TSInstallSync",
"TSModuleInfo",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
},
2023-02-20 22:53:49 +07:00
build = function()
local status_ok, ts = pcall(require, "nvim-treesitter.install")
if not status_ok then
return
end
ts.update({ with_sync = true })()
end,
config = function()
local status_ok, _ = pcall(require, "nvim-treesitter")
if not status_ok then
return
end
require("user.treesitter")
end,
2023-01-15 00:17:41 +07:00
},
2023-02-04 13:57:50 +07:00
-- snippets
2023-01-15 00:17:41 +07:00
{
2023-02-04 13:57:50 +07:00
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
2023-02-19 12:18:29 +07:00
require("user.snip")
2023-02-04 13:57:50 +07:00
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
2023-01-15 00:17:41 +07:00
},
2023-02-22 07:48:02 +07:00
-- for cmp
{
"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,
},
2023-01-15 00:22:51 +07:00
{
2023-02-11 09:41:39 +07:00
"neovim/nvim-lspconfig",
2023-02-09 13:22:54 +07:00
event = "BufWinEnter",
2023-02-04 13:57:50 +07:00
dependencies = {
2023-02-11 09:41:39 +07:00
"williamboman/mason-lspconfig.nvim",
2023-02-04 13:57:50 +07:00
},
2023-01-17 13:36:46 +07:00
config = function()
2023-01-15 00:17:41 +07:00
require("user.lsp")
end,
},
2023-02-11 09:41:39 +07:00
-- {
-- "williamboman/mason.nvim",
-- event = "VeryLazy",
-- cmd = {
-- "Mason",
-- "MasonInstall",
-- "MasonUninstall",
-- "MasonUninstallAll",
-- "MasonLog",
-- },
-- dependencies = { "williamboman/mason-lspconfig.nvim" },
-- init = function()
-- vim.tbl_map(function(plugin)
-- pcall(require, plugin)
-- end, { "lspconfig", "null-ls" })
-- end,
-- },
2023-01-15 00:17:41 +07:00
{
"williamboman/mason.nvim",
2023-02-11 09:41:39 +07:00
cmd = "Mason",
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
2023-01-15 00:17:41 +07:00
},
2023-01-21 11:01:35 +07:00
-- for formater linter
2023-02-09 13:22:54 +07:00
{ "RRethy/vim-illuminate", event = "BufRead" },
2023-01-21 11:01:35 +07:00
{
"jayp0521/mason-null-ls.nvim",
dependencies = "jose-elias-alvarez/null-ls.nvim",
event = "BufRead",
opts = function()
require("user.mason-null-ls")
end,
},
2023-02-04 13:57:50 +07:00
-- debuging
{
"rcarriga/nvim-dap-ui",
2023-02-19 19:20:01 +07:00
event = "BufWinEnter",
2023-02-04 13:57:50 +07:00
dependencies = "mfussenegger/nvim-dap",
enabled = vim.fn.has("win32") == 0,
config = function()
require("user.dapui")
end,
},
{
"jayp0521/mason-nvim-dap.nvim",
event = "VeryLazy",
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
enabled = vim.fn.has("win32") == 0,
init = function()
require("user.mason_dap")
end,
},
2023-02-05 09:09:33 +07:00
-- for install lsp tidak support mason
2023-02-04 13:57:50 +07:00
{ "williamboman/nvim-lsp-installer", event = "VeryLazy" },
2023-02-05 09:09:33 +07:00
-- auto pairs
{
"windwp/nvim-autopairs",
2023-02-05 11:47:31 +07:00
commit = "4fc96c8f3df89b6d23e5092d31c866c53a346347",
2023-02-05 09:09:33 +07:00
dependencies = "hrsh7th/nvim-cmp",
2023-02-05 12:50:48 +07:00
event = "InsertEnter",
config = function()
2023-02-05 09:09:33 +07:00
require("user.autopairs")
end,
},
-- untuk comment
2023-02-21 07:32:15 +07:00
{
"JoosepAlviste/nvim-ts-context-commentstring",
event = "BufRead",
dependencies = "nvim-treesitter/nvim-treesitter",
},
2023-02-05 09:09:33 +07:00
{
"numToStr/Comment.nvim",
2023-02-09 13:22:54 +07:00
event = "BufRead",
config = function()
2023-02-05 09:09:33 +07:00
require("user.comment")
end,
},
-- styleing indent
{
"lukas-reineke/indent-blankline.nvim",
event = "BufRead",
2023-02-09 13:22:54 +07:00
config = function()
2023-02-05 09:09:33 +07:00
require("user.indentline")
end,
},
-- for Speed up loading Lua modules in Neovim to improve startup time.
2023-02-04 13:57:50 +07:00
{
"lewis6991/impatient.nvim",
2023-02-09 13:22:54 +07:00
event = "BufRead",
config = function()
2023-02-04 13:57:50 +07:00
require("user.impatient")
end,
},
2023-01-21 11:01:35 +07:00
-- for live server html,css,js
2023-02-21 18:19:24 +07:00
{
"manzeloth/live-server",
cmd = { "LiveServer" },
event = "BufRead",
build = "npm install -g live-server",
},
2023-01-21 11:01:35 +07:00
-- for multi cursor select
2023-02-09 13:22:54 +07:00
{ "mg979/vim-visual-multi", event = "BufRead" },
2023-01-21 11:01:35 +07:00
-- for auto close tag
2023-02-20 23:04:23 +07:00
{
"windwp/nvim-ts-autotag",
event = "BufRead",
dependencies = "nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-ts-autotag").setup()
end,
},
2023-01-21 11:01:35 +07:00
-- for auto detection file and run code
2023-01-15 00:17:41 +07:00
{
"CRAG666/code_runner.nvim",
2023-02-09 13:22:54 +07:00
event = "BufRead",
2023-02-11 09:41:39 +07:00
-- dependencies = "nvim-lua/plenary.nvim",
2023-01-15 00:17:41 +07:00
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
config = function()
require("user.coderunner")
end,
},
2023-01-21 11:01:35 +07:00
-- for color view
2023-01-15 00:17:41 +07:00
{
"NvChad/nvim-colorizer.lua",
2023-02-09 13:22:54 +07:00
event = "BufRead",
2023-01-15 00:17:41 +07:00
opts = function()
require("user.colorizer")
end,
},
2023-01-21 11:01:35 +07:00
-- for winbar icon
2023-01-15 00:17:41 +07:00
{
"SmiteshP/nvim-navic",
dependencies = "neovim/nvim-lspconfig",
event = "BufRead",
config = function()
require("user.breadcrumb")
require("user.winbar")
end,
},
2023-01-21 11:01:35 +07:00
-- for popup alert
2023-01-15 00:17:41 +07:00
{
"rcarriga/nvim-notify",
2023-02-12 21:35:02 +07:00
event = "BufWinEnter",
2023-01-15 00:17:41 +07:00
config = function()
2023-01-28 12:19:19 +07:00
local notify = require("notify")
-- this for transparency
notify.setup({ background_colour = "#000000" })
-- this overwrites the vim notify function
vim.notify = notify.notify
2023-01-15 00:17:41 +07:00
end,
},
2023-01-21 11:01:35 +07:00
-- for resize screen
2023-01-15 00:17:41 +07:00
{
"mrjones2014/smart-splits.nvim",
event = "BufWinEnter",
config = function()
require("user.smartspit")
end,
},
2023-01-21 11:01:35 +07:00
-- for popup input
2023-01-15 00:17:41 +07:00
{
"stevearc/dressing.nvim",
event = "BufWinEnter",
config = function()
require("user.dressing")
end,
},
2023-01-21 11:01:35 +07:00
-- mini scrollview
2023-01-15 00:17:41 +07:00
{
"karb94/neoscroll.nvim",
2023-02-09 13:22:54 +07:00
event = "BufRead",
2023-01-15 00:17:41 +07:00
config = function()
require("user.neoscroll")
end,
},
2023-01-15 00:22:51 +07:00
{
2023-01-15 00:17:41 +07:00
"dstein64/nvim-scrollview",
event = "BufRead",
config = function()
require("user.nvimscroll")
end,
},
2023-01-21 11:01:35 +07:00
-- for check startuptime
2023-02-09 13:22:54 +07:00
{ "dstein64/vim-startuptime", cmd = "StartupTime", event = "BufRead" },
2023-01-21 11:01:35 +07:00
-- for coloring pairs
2023-02-21 07:32:15 +07:00
{
"p00f/nvim-ts-rainbow",
event = "BufRead",
dependencies = "nvim-treesitter/nvim-treesitter",
},
2023-02-05 09:09:33 +07:00
-- for git
2023-01-15 00:17:41 +07:00
{
"lewis6991/gitsigns.nvim",
2023-01-17 13:36:46 +07:00
enabled = vim.fn.executable("git") == 1,
2023-01-15 00:17:41 +07:00
ft = "gitcommit",
2023-02-15 06:38:29 +07:00
event = "BufRead",
2023-01-15 00:17:41 +07:00
config = function()
require("user.gitsigns")
end,
2023-01-15 00:22:51 +07:00
},
2023-02-05 09:09:33 +07:00
-- for loading info
2023-02-03 21:40:47 +07:00
{
"j-hui/fidget.nvim",
2023-02-09 13:22:54 +07:00
event = "BufRead",
2023-02-03 21:40:47 +07:00
config = function()
require("fidget").setup()
end,
},
2023-01-15 00:22:51 +07:00
}