279 lines
6.5 KiB
Lua
279 lines
6.5 KiB
Lua
lvim.plugins = {
|
|
{
|
|
"williamboman/mason.nvim",
|
|
opts = {
|
|
ensure_installed = {
|
|
"eslint-lsp",
|
|
"js-debug-adapter",
|
|
"prettier",
|
|
"tinymist",
|
|
"typescript-language-server",
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kaarmu/typst.vim",
|
|
},
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
dependencies = {
|
|
"mason.nvim",
|
|
"williamboman/mason-lspconfig.nvim",
|
|
},
|
|
},
|
|
{
|
|
'kevinhwang91/nvim-ufo',
|
|
opts = {
|
|
open_fold_hl_timeout = 400,
|
|
close_fold_kinds = { "imports", "comment" },
|
|
preview = {
|
|
win_config = {
|
|
border = { "", "─", "", "", "", "─", "", "" },
|
|
-- winhighlight = "Normal:Folded",
|
|
winblend = 0,
|
|
},
|
|
mappings = {
|
|
scrollU = "<C-u>",
|
|
scrollD = "<C-d>",
|
|
jumpTop = "[",
|
|
jumpBot = "]",
|
|
},
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
local handler = function(virtText, lnum, endLnum, width, truncate)
|
|
local newVirtText = {}
|
|
local totalLines = vim.api.nvim_buf_line_count(0)
|
|
local foldedLines = endLnum - lnum
|
|
local suffix = (" %d %d%%"):format(foldedLines, foldedLines / totalLines * 100)
|
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
|
local targetWidth = width - sufWidth
|
|
local curWidth = 0
|
|
for _, chunk in ipairs(virtText) do
|
|
local chunkText = chunk[1]
|
|
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
if targetWidth > curWidth + chunkWidth then
|
|
table.insert(newVirtText, chunk)
|
|
else
|
|
chunkText = truncate(chunkText, targetWidth - curWidth)
|
|
local hlGroup = chunk[2]
|
|
table.insert(newVirtText, { chunkText, hlGroup })
|
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
-- str width returned from truncate() may less than 2nd argument, need padding
|
|
if curWidth + chunkWidth < targetWidth then
|
|
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
|
end
|
|
break
|
|
end
|
|
curWidth = curWidth + chunkWidth
|
|
end
|
|
local rAlignAppndx =
|
|
math.max(math.min(vim.opt.textwidth["_value"], width - 1) - curWidth - sufWidth, 0)
|
|
suffix = (" "):rep(rAlignAppndx) .. suffix
|
|
table.insert(newVirtText, { suffix, "MoreMsg" })
|
|
return newVirtText
|
|
end
|
|
opts["fold_virt_text_handler"] = handler
|
|
require("ufo").setup(opts)
|
|
vim.keymap.set("n", "K", function()
|
|
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
|
if not winid then
|
|
-- vim.lsp.buf.hover()
|
|
vim.cmd [[ Lspsaga hover_doc ]]
|
|
end
|
|
end)
|
|
end,
|
|
},
|
|
{
|
|
'kevinhwang91/promise-async',
|
|
},
|
|
{
|
|
'rust-lang/rust.vim',
|
|
},
|
|
{
|
|
'MunifTanjim/prettier.nvim'
|
|
},
|
|
{
|
|
'alx741/vim-rustfmt',
|
|
},
|
|
{
|
|
"savq/melange-nvim"
|
|
},
|
|
{
|
|
'theHamsta/nvim-dap-virtual-text',
|
|
},
|
|
{
|
|
"HoNamDuong/hybrid.nvim",
|
|
lazy = false,
|
|
priority = 1000,
|
|
opts = {},
|
|
},
|
|
{
|
|
'marko-cerovac/material.nvim'
|
|
},
|
|
{
|
|
"rebelot/kanagawa.nvim",
|
|
},
|
|
{
|
|
'mountain-theme/vim'
|
|
},
|
|
{
|
|
'fgheng/winbar.nvim'
|
|
},
|
|
{
|
|
"gbprod/nord.nvim",
|
|
},
|
|
{
|
|
"vague2k/huez.nvim",
|
|
},
|
|
{
|
|
"Bekaboo/dropbar.nvim",
|
|
dependencies = {
|
|
"nvim-telescope/telescope-fzf-native.nvim"
|
|
},
|
|
},
|
|
{
|
|
"nvim-neo-tree/neo-tree.nvim",
|
|
branch = "v2.x",
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim",
|
|
"nvim-tree/nvim-web-devicons",
|
|
"MunifTanjim/nui.nvim",
|
|
},
|
|
},
|
|
-- load luasnips + cmp related in insert mode only
|
|
{
|
|
"hrsh7th/nvim-cmp",
|
|
event = "InsertEnter",
|
|
dependencies = {
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
dependencies = "rafamadriz/friendly-snippets",
|
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
|
config = function(_, opts)
|
|
require("luasnip").config.set_config(opts)
|
|
require "configs.luasnip"
|
|
end,
|
|
},
|
|
{
|
|
"saadparwaiz1/cmp_luasnip",
|
|
"hrsh7th/cmp-nvim-lua",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
"hrsh7th/cmp-buffer",
|
|
"hrsh7th/cmp-path",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
},
|
|
{
|
|
"luckasRanarison/tailwind-tools.nvim",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
},
|
|
{
|
|
"kyazdani42/nvim-web-devicons"
|
|
},
|
|
{
|
|
"mfussenegger/nvim-dap",
|
|
event = "VeryLazy",
|
|
},
|
|
{
|
|
"rcarriga/nvim-dap-ui",
|
|
dependencies = {
|
|
"nvim-neotest/nvim-nio",
|
|
"mfussenegger/nvim-dap",
|
|
},
|
|
event = "VeryLazy",
|
|
config = function()
|
|
require("dapui").setup()
|
|
end
|
|
},
|
|
{
|
|
"mxsdev/nvim-dap-vscode-js"
|
|
},
|
|
{
|
|
"microsoft/vscode-js-debug",
|
|
lazy = true,
|
|
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out"
|
|
},
|
|
{
|
|
'NvChad/nvim-colorizer.lua',
|
|
},
|
|
{
|
|
"folke/neodev.nvim", opts = {}
|
|
},
|
|
{
|
|
"mlaursen/vim-react-snippets",
|
|
},
|
|
{
|
|
"windwp/nvim-ts-autotag",
|
|
},
|
|
{
|
|
"folke/ts-comments.nvim",
|
|
event = "VeryLazy",
|
|
enabled = vim.fn.has("nvim-0.10.0") == 1,
|
|
},
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
event = "InsertEnter",
|
|
config = true
|
|
-- use opts = {} for passing setup options
|
|
-- this is equalent to setup({}) function
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
},
|
|
{
|
|
"mrcjkb/rustaceanvim",
|
|
version = '^4', -- Recommended
|
|
lazy = false, -- This plugin is already lazy
|
|
},
|
|
{
|
|
"NeogitOrg/neogit",
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim", -- required
|
|
"sindrets/diffview.nvim", -- optional - Diff integration
|
|
|
|
-- Only one of these is needed, not both.
|
|
"nvim-telescope/telescope.nvim", -- optional
|
|
"ibhagwan/fzf-lua", -- optional
|
|
},
|
|
config = true,
|
|
},
|
|
{
|
|
"catppuccin/nvim",
|
|
name = "catppuccin",
|
|
priority = 1000
|
|
},
|
|
{
|
|
"loctvl842/monokai-pro.nvim"
|
|
},
|
|
{
|
|
"tanvirtin/monokai.nvim"
|
|
},
|
|
{
|
|
"folke/noice.nvim",
|
|
event = "VeryLazy",
|
|
opts = {
|
|
routes = {
|
|
{
|
|
filter = { event = "notify", find = "No information available" },
|
|
opts = { skip = true },
|
|
},
|
|
},
|
|
presets = {
|
|
lsp_doc_border = true,
|
|
},
|
|
},
|
|
dependencies = {
|
|
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
|
"MunifTanjim/nui.nvim",
|
|
-- OPTIONAL:
|
|
-- `nvim-notify` is only needed, if you want to use the notification view.
|
|
-- If not available, we use `mini` as the fallback
|
|
}
|
|
},
|
|
}
|
|
|