add php configuration

This commit is contained in:
xfy
2024-04-28 14:08:03 +08:00
parent d74a6b9e2d
commit 873b40d0c0
7 changed files with 480 additions and 469 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

View File

@ -1,40 +1,40 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" vim.g.base46_cache = vim.fn.stdpath("data") .. "/nvchad/base46/"
vim.g.mapleader = " " vim.g.mapleader = " "
-- bootstrap lazy and all plugins -- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git" local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy" local lazy_config = require("configs.lazy")
-- load plugins -- load plugins
require("lazy").setup({ require("lazy").setup({
{ {
"NvChad/NvChad", "NvChad/NvChad",
lazy = false, lazy = false,
branch = "v2.5", branch = "v2.5",
import = "nvchad.plugins", import = "nvchad.plugins",
config = function() config = function()
require "options" require("options")
end, end,
}, },
{ import = "plugins" }, { import = "plugins" },
}, lazy_config) }, lazy_config)
-- load theme -- load theme
dofile(vim.g.base46_cache .. "defaults") dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline") dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds" require("nvchad.autocmds")
vim.schedule(function() vim.schedule(function()
require "mappings" require("mappings")
end) end)
require 'myinit' require("myinit")

View File

@ -8,7 +8,7 @@
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"codesnap.nvim": { "branch": "main", "commit": "3b7dd6a3ad6a1914cfa711316be89b4c7b12fd25" }, "codesnap.nvim": { "branch": "main", "commit": "5c365e03286a9f8a00b7d06cd52c5f5afd203181" },
"conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" },
"crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" }, "crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
@ -23,24 +23,24 @@
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
"lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a14770dc8c7cb29643870ac79788eec6f7ce1f8" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"multicursors.nvim": { "branch": "main", "commit": "b959ad0f38881e81e757208c6adfc9e6dc24dfc7" }, "multicursors.nvim": { "branch": "main", "commit": "b959ad0f38881e81e757208c6adfc9e6dc24dfc7" },
"nvcommunity": { "branch": "main", "commit": "62b304f0d3ab1826f604b29013ed6e0cffec2fae" }, "nvcommunity": { "branch": "main", "commit": "62b304f0d3ab1826f604b29013ed6e0cffec2fae" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lspconfig": { "branch": "master", "commit": "da338c8d7e33fbb810368a808781f56224b4fea7" }, "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" },
"nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" },
"nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" },
"nvim-tree.lua": { "branch": "master", "commit": "5a18b9827491aa1aea710bc9b85c6b63ed0dad14" }, "nvim-tree.lua": { "branch": "master", "commit": "5a18b9827491aa1aea710bc9b85c6b63ed0dad14" },
"nvim-treesitter": { "branch": "master", "commit": "19c6b0c4c9b35962e45b782e2b85a3214d2ac4d5" }, "nvim-treesitter": { "branch": "master", "commit": "0883ff05655117a3fc79ab295a640c4984cfd415" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" },
"nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, "nvim-web-devicons": { "branch": "master", "commit": "27eac98fd6675d29d0e19d4d0622fd7a3968483a" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"schemastore.nvim": { "branch": "main", "commit": "26d27cf72a0164cb5a25d7b7ceedbe9a72511932" }, "schemastore.nvim": { "branch": "main", "commit": "f8b00bba94eab372e0c29605568a7ec323e30620" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },

View File

@ -1,100 +1,101 @@
local options = { local options = {
lsp_fallback = true, lsp_fallback = true,
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
go = { go = {
"goimports", "goimports",
"goimports-reviser", "goimports-reviser",
"golines", "golines",
"gopls", "gopls",
}, },
sh = { "shfmt" }, sh = { "shfmt" },
javascript = { "prettier" }, javascript = { "prettier" },
typescript = { "prettier" }, typescript = { "prettier" },
javascriptreact = { "prettier" }, javascriptreact = { "prettier" },
typescriptreact = { "prettier" }, typescriptreact = { "prettier" },
svelte = { "prettier" }, svelte = { "prettier" },
css = { "prettier" }, css = { "prettier" },
html = { "prettier" }, html = { "prettier" },
json = { "prettier" }, json = { "prettier" },
yaml = { "prettier" }, yaml = { "prettier" },
markdown = { "prettier" }, markdown = { "prettier" },
graphql = { "prettier" }, graphql = { "prettier" },
python = { "isort", "black" }, python = { "isort", "black" },
-- Use the "*" filetype to run formatters on all filetypes. php = { "phpcbf" },
["*"] = { "codespell" }, -- Use the "*" filetype to run formatters on all filetypes.
-- Use the "_" filetype to run formatters on filetypes that don't ["*"] = { "codespell" },
-- have other formatters configured. -- Use the "_" filetype to run formatters on filetypes that don't
["_"] = { "trim_whitespace" }, -- have other formatters configured.
}, ["_"] = { "trim_whitespace" },
format_on_save = { },
lsp_fallback = true, format_on_save = {
timeout_ms = 500, lsp_fallback = true,
}, timeout_ms = 500,
-- If this is set, Conform will run the formatter asynchronously after save. },
-- It will pass the table to conform.format(). -- If this is set, Conform will run the formatter asynchronously after save.
-- This can also be a function that returns the table. -- It will pass the table to conform.format().
format_after_save = { -- This can also be a function that returns the table.
lsp_fallback = true, format_after_save = {
}, lsp_fallback = true,
notify_on_error = true, },
formatters = { notify_on_error = true,
injected = { options = { ignore_errors = true } }, formatters = {
lang_to_ext = { injected = { options = { ignore_errors = true } },
bash = "sh", lang_to_ext = {
c_sharp = "cs", bash = "sh",
elixir = "exs", c_sharp = "cs",
latex = "tex", elixir = "exs",
markdown = "md", latex = "tex",
python = "py", markdown = "md",
ruby = "rb", python = "py",
teal = "tl", ruby = "rb",
}, teal = "tl",
rustfmt = { },
options = { rustfmt = {
-- The default edition of Rust to use when no Cargo.toml file is found options = {
default_edition = "2021", -- The default edition of Rust to use when no Cargo.toml file is found
}, default_edition = "2021",
}, },
options = { },
-- Use a specific prettier parser for a filetype options = {
-- Otherwise, prettier will try to infer the parser from the file name -- Use a specific prettier parser for a filetype
ft_parsers = { -- Otherwise, prettier will try to infer the parser from the file name
-- javascript = "babel", ft_parsers = {
-- javascriptreact = "babel", -- javascript = "babel",
-- typescript = "typescript", -- javascriptreact = "babel",
-- typescriptreact = "typescript", -- typescript = "typescript",
-- vue = "vue", -- typescriptreact = "typescript",
-- css = "css", -- vue = "vue",
-- scss = "scss", -- css = "css",
-- less = "less", -- scss = "scss",
-- html = "html", -- less = "less",
-- json = "json", -- html = "html",
-- jsonc = "json", -- json = "json",
-- yaml = "yaml", -- jsonc = "json",
-- markdown = "markdown", -- yaml = "yaml",
-- ["markdown.mdx"] = "mdx", -- markdown = "markdown",
-- graphql = "graphql", -- ["markdown.mdx"] = "mdx",
-- handlebars = "glimmer", -- graphql = "graphql",
}, -- handlebars = "glimmer",
-- Use a specific prettier parser for a file extension },
ext_parsers = { -- Use a specific prettier parser for a file extension
-- qmd = "markdown", ext_parsers = {
}, -- qmd = "markdown",
}, },
-- # Example of using dprint only when a dprint.json file is present },
-- dprint = { -- # Example of using dprint only when a dprint.json file is present
-- condition = function(ctx) -- dprint = {
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1] -- condition = function(ctx)
-- end, -- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
-- }, -- end,
-- -- },
-- # Example of using shfmt with extra args --
-- shfmt = { -- # Example of using shfmt with extra args
-- prepend_args = { "-i", "2", "-ci" }, -- shfmt = {
-- }, -- prepend_args = { "-i", "2", "-ci" },
}, -- },
},
} }
return options return options

View File

@ -2,8 +2,8 @@ vim.fn.sign_define("DapBreakpoint", { text = "", numhl = "DapBreakpoint", tex
vim.fn.sign_define("DagLogPoint", { text = "", numhl = "DapLogPoint", texthl = "DapLogPoint" }) vim.fn.sign_define("DagLogPoint", { text = "", numhl = "DapLogPoint", texthl = "DapLogPoint" })
vim.fn.sign_define("DapStopped", { text = "", numhl = "DapStopped", texthl = "DapStopped" }) vim.fn.sign_define("DapStopped", { text = "", numhl = "DapStopped", texthl = "DapStopped" })
vim.fn.sign_define( vim.fn.sign_define(
"DapBreakpointRejected", "DapBreakpointRejected",
{ text = "", numhl = "DapBreakpointRejected", texthl = "DapBreakpointRejected" } { text = "", numhl = "DapBreakpointRejected", texthl = "DapBreakpointRejected" }
) )
require("utils.autocmd") require("utils.autocmd")

View File

@ -15,4 +15,4 @@ opt.wildignore:append({ "*/node_modules/*" })
opt.clipboard:append({ "unnamedplus" }) opt.clipboard:append({ "unnamedplus" })
opt.iskeyword:append("-") opt.iskeyword:append("-")
opt.termguicolors = true -- True color support opt.termguicolors = true -- True color support
opt.autoindent = true --- Good auto indent opt.autoindent = true --- Good auto indent

View File

@ -3,22 +3,22 @@ local cmp = require("cmp")
local overrides = require("configs.overrides") local overrides = require("configs.overrides")
local plugins = { local plugins = {
{ {
"NvChad/nvcommunity", "NvChad/nvcommunity",
{ import = "nvcommunity.git.diffview" }, { import = "nvcommunity.git.diffview" },
{ import = "nvcommunity.git.lazygit" }, { import = "nvcommunity.git.lazygit" },
--[[ { import = "nvcommunity.lsp.prettyhover" }, ]] --[[ { import = "nvcommunity.lsp.prettyhover" }, ]]
}, },
-- LSP, formatter, linter -- LSP, formatter, linter
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
config = function() config = function()
require("configs.lspconfig") require("configs.lspconfig")
require("nvchad.configs.lspconfig").defaults() require("nvchad.configs.lspconfig").defaults()
end, end,
}, },
--[[ { --[[ {
"jay-babu/mason-nvim-dap.nvim", "jay-babu/mason-nvim-dap.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
@ -30,7 +30,7 @@ local plugins = {
}) })
end, end,
}, ]] }, ]]
--[[ { --[[ {
"jay-babu/mason-null-ls.nvim", "jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
@ -50,117 +50,119 @@ local plugins = {
}) })
end, end,
}, ]] }, ]]
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
opts = { opts = {
ensure_installed = { ensure_installed = {
"lua_ls", "lua_ls",
"rust_analyzer", "rust_analyzer",
"html", "html",
"volar", "volar",
"tsserver", "tsserver",
"tailwindcss", "tailwindcss",
"eslint", "eslint",
"cssls", "cssls",
"cssmodules_ls", "cssmodules_ls",
"jsonls", "jsonls",
"yamlls", "yamlls",
"docker_compose_language_service", "docker_compose_language_service",
"dockerls", "dockerls",
"bashls", "bashls",
"clangd", "clangd",
"lemminx", "lemminx",
}, --[[ "phpactor", ]]
automatic_installation = true, --[[ "phpcbf", ]]
}, },
config = function(_, opts) automatic_installation = true,
require("mason-lspconfig").setup(opts) },
end, config = function(_, opts)
}, require("mason-lspconfig").setup(opts)
{ end,
"williamboman/mason.nvim", },
}, {
{ "williamboman/mason.nvim",
"nvim-treesitter/nvim-treesitter", },
opts = { {
ensure_installed = { "nvim-treesitter/nvim-treesitter",
-- defaults opts = {
"vim", ensure_installed = {
"vimdoc", -- defaults
"lua", "vim",
-- web dev "vimdoc",
"html", "lua",
"css", -- web dev
"javascript", "html",
"typescript", "css",
"tsx", "javascript",
"json", "typescript",
"vue", "tsx",
"markdown", "json",
"markdown_inline", "vue",
"jsdoc", "markdown",
"scss", "markdown_inline",
-- low level "jsdoc",
"rust", "scss",
"toml", -- low level
"go", "rust",
"gomod", "toml",
"kotlin", "go",
}, "gomod",
autotag = { "kotlin",
enable = true, },
}, autotag = {
highlight = { enable = true,
disable = function(_, buf) },
local max_filesize = 100 * 1024 -- 100 KB highlight = {
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) disable = function(_, buf)
if ok and stats and stats.size > max_filesize then local max_filesize = 100 * 1024 -- 100 KB
return true local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
end if ok and stats and stats.size > max_filesize then
end, return true
}, end
}, end,
}, },
--[[ { },
},
--[[ {
"nvimtools/none-ls.nvim", "nvimtools/none-ls.nvim",
event = "VeryLazy", event = "VeryLazy",
opts = function() opts = function()
return require("configs.null-ls") return require("configs.null-ls")
end, end,
}, ]] }, ]]
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
event = { "BufWritePre" }, event = { "BufWritePre" },
cmd = { "ConformInfo" }, cmd = { "ConformInfo" },
opts = function() opts = function()
return require("configs.conform") return require("configs.conform")
end, end,
}, },
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
dependencies = { dependencies = {
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true }, { "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
}, },
opts = function() opts = function()
---@diagnostic disable-next-line: different-requires ---@diagnostic disable-next-line: different-requires
local M = require("nvchad.configs.cmp") local M = require("nvchad.configs.cmp")
M.completion.completeopt = "menu,menuone,noselect" M.completion.completeopt = "menu,menuone,noselect"
M.mapping["<CR>"] = cmp.mapping.confirm({ M.mapping["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert, behavior = cmp.ConfirmBehavior.Insert,
select = true, select = true,
}) })
table.insert(M.sources, { name = "crates" }) table.insert(M.sources, { name = "crates" })
-- original LazyVim kind icon formatter -- original LazyVim kind icon formatter
local format_kinds = M.formatting.format local format_kinds = M.formatting.format
M.formatting.format = function(entry, item) M.formatting.format = function(entry, item)
format_kinds(entry, item) -- add icons format_kinds(entry, item) -- add icons
return require("tailwindcss-colorizer-cmp").formatter(entry, item) return require("tailwindcss-colorizer-cmp").formatter(entry, item)
end end
return M return M
end, end,
}, },
-- rust -- rust
--[[ { --[[ {
"mrcjkb/rustaceanvim", "mrcjkb/rustaceanvim",
version = "^4", -- Recommended version = "^4", -- Recommended
ft = "rust", ft = "rust",
@ -168,38 +170,38 @@ local plugins = {
require("configs.rust") require("configs.rust")
end, end,
}, ]] }, ]]
{ {
"saecki/crates.nvim", "saecki/crates.nvim",
ft = { "toml" }, ft = { "toml" },
config = function(_, opts) config = function(_, opts)
local crates = require("crates") local crates = require("crates")
crates.setup(opts) crates.setup(opts)
require("cmp").setup.buffer({ require("cmp").setup.buffer({
sources = { { name = "crates" } }, sources = { { name = "crates" } },
}) })
crates.show() crates.show()
--[[ require("core.utils").load_mappings("crates") ]] --[[ require("core.utils").load_mappings("crates") ]]
end, end,
}, },
{ {
"rust-lang/rust.vim", "rust-lang/rust.vim",
ft = "rust", ft = "rust",
init = function() init = function()
vim.g.rustfmt_autosave = 1 vim.g.rustfmt_autosave = 1
end, end,
}, },
-- golang -- golang
{ {
"olexsmir/gopher.nvim", "olexsmir/gopher.nvim",
ft = "go", ft = "go",
config = function(_, opts) config = function(_, opts)
require("gopher").setup(opts) require("gopher").setup(opts)
end, end,
build = function() build = function()
vim.cmd([[silent! GoInstallDeps]]) vim.cmd([[silent! GoInstallDeps]])
end, end,
}, },
--[[ { --[[ {
"dreamsofcode-io/nvim-dap-go", "dreamsofcode-io/nvim-dap-go",
ft = "go", ft = "go",
dependencies = "mfussenegger/nvim-dap", dependencies = "mfussenegger/nvim-dap",
@ -207,12 +209,12 @@ local plugins = {
require("dap-go").setup(opts) require("dap-go").setup(opts)
end, end,
}, ]] }, ]]
{ {
"b0o/schemastore.nvim", "b0o/schemastore.nvim",
}, },
-- debug -- debug
--[[ { --[[ {
"rcarriga/nvim-dap-ui", "rcarriga/nvim-dap-ui",
event = "VeryLazy", event = "VeryLazy",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
@ -231,13 +233,13 @@ local plugins = {
end end
end, end,
}, ]] }, ]]
--[[ { --[[ {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
config = function() config = function()
require("configs.dap") require("configs.dap")
end, end,
}, ]] }, ]]
--[[ { --[[ {
"theHamsta/nvim-dap-virtual-text", "theHamsta/nvim-dap-virtual-text",
lazy = false, lazy = false,
config = function(_, opts) config = function(_, opts)
@ -245,118 +247,117 @@ local plugins = {
end, end,
}, ]] }, ]]
-- telescope, code action ui -- telescope, code action ui
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
opts = function() opts = function()
require("configs.telescope") require("configs.telescope")
end, end,
}, },
{ {
"nvim-telescope/telescope-ui-select.nvim", "nvim-telescope/telescope-ui-select.nvim",
}, },
{ {
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
build = build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", },
}, {
{ "nvim-pack/nvim-spectre",
"nvim-pack/nvim-spectre", event = "BufRead",
event = "BufRead", },
}, -- motion, UI and others
-- motion, UI and others {
{ "phaazon/hop.nvim",
"phaazon/hop.nvim", branch = "v2", -- optional but strongly recommended
branch = "v2", -- optional but strongly recommended config = function()
config = function() -- you can configure Hop the way you like here; see :h hop-config
-- you can configure Hop the way you like here; see :h hop-config local hop = require("hop")
local hop = require("hop") hop.setup({ keys = "etovxqpdygfblzhckisuran" })
hop.setup({ keys = "etovxqpdygfblzhckisuran" }) end,
end, },
}, {
{ "smoka7/multicursors.nvim",
"smoka7/multicursors.nvim", event = "VeryLazy",
event = "VeryLazy", dependencies = {
dependencies = { "smoka7/hydra.nvim",
"smoka7/hydra.nvim", },
}, opts = {
opts = { hint_config = false,
hint_config = false, },
}, cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" }, keys = {
keys = { {
{ mode = { "v", "n" },
mode = { "v", "n" }, "<Leader>m",
"<Leader>m", --[[ "<C-n>", ]]
--[[ "<C-n>", ]] "<cmd>MCstart<cr>",
"<cmd>MCstart<cr>", desc = "Create a selection for selected text or word under the cursor",
desc = "Create a selection for selected text or word under the cursor", },
}, },
}, },
}, {
{ "jxnblk/vim-mdx-js",
"jxnblk/vim-mdx-js", },
}, {
{ "windwp/nvim-autopairs",
"windwp/nvim-autopairs", event = "InsertEnter",
event = "InsertEnter", opts = {},
opts = {}, },
}, {
{ "windwp/nvim-ts-autotag",
"windwp/nvim-ts-autotag", dependencies = "nvim-treesitter/nvim-treesitter",
dependencies = "nvim-treesitter/nvim-treesitter", config = function()
config = function() require("nvim-ts-autotag").setup({})
require("nvim-ts-autotag").setup({}) end,
end, lazy = true,
lazy = true, event = "VeryLazy",
event = "VeryLazy", },
}, {
{ "kylechui/nvim-surround",
"kylechui/nvim-surround", version = "*", -- Use for stability; omit to use `main` branch for the latest features
version = "*", -- Use for stability; omit to use `main` branch for the latest features event = "VeryLazy",
event = "VeryLazy", config = function()
config = function() require("nvim-surround").setup({})
require("nvim-surround").setup({}) end,
end, },
}, -- comment string
-- comment string {
{ "JoosepAlviste/nvim-ts-context-commentstring",
"JoosepAlviste/nvim-ts-context-commentstring", },
}, {
{ "numToStr/Comment.nvim",
"numToStr/Comment.nvim", opts = {
opts = { pre_hook = function(ctx)
pre_hook = function(ctx) local U = require("Comment.utils")
local U = require("Comment.utils")
local location = nil local location = nil
if ctx.ctype == U.ctype.block then if ctx.ctype == U.ctype.block then
location = require("ts_context_commentstring.utils").get_cursor_location() location = require("ts_context_commentstring.utils").get_cursor_location()
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
location = require("ts_context_commentstring.utils").get_visual_start_location() location = require("ts_context_commentstring.utils").get_visual_start_location()
end end
return require("ts_context_commentstring.internal").calculate_commentstring({ return require("ts_context_commentstring.internal").calculate_commentstring({
key = ctx.ctype == U.ctype.line and "__default" or "__multiline", key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
location = location, location = location,
}) })
end, end,
}, },
}, },
-- ui -- ui
{ {
"mistricky/codesnap.nvim", "mistricky/codesnap.nvim",
build = "make", build = "make",
event = "BufRead", event = "BufRead",
opts = { opts = {
mac_window_bar = true, mac_window_bar = true,
title = "RUA", title = "RUA",
code_font_family = "JetBrains Mono NL", code_font_family = "JetBrains Mono NL",
watermark = "RUA", watermark = "RUA",
bg_color = "#535c68", bg_color = "#535c68",
}, },
}, },
--[[ { --[[ {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
opts = { opts = {
fps = 120, fps = 120,
@ -364,12 +365,12 @@ local plugins = {
stages = "slide", stages = "slide",
}, },
} ]] } ]]
{ {
"stevearc/dressing.nvim", "stevearc/dressing.nvim",
event = "VeryLazy", event = "VeryLazy",
opts = {}, opts = {},
}, },
--[[ { --[[ {
"folke/noice.nvim", "folke/noice.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { dependencies = {
@ -407,78 +408,78 @@ local plugins = {
}, },
}, },
} ]] } ]]
{ {
"folke/trouble.nvim", "folke/trouble.nvim",
cmd = { "TroubleToggle", "Trouble", "TroubleRefresh" }, cmd = { "TroubleToggle", "Trouble", "TroubleRefresh" },
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {}, opts = {},
}, },
{ {
"NvChad/nvim-colorizer.lua", "NvChad/nvim-colorizer.lua",
opts = { opts = {
user_default_options = { user_default_options = {
tailwind = true, tailwind = true,
}, },
}, },
}, },
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
event = "BufReadPost", event = "BufReadPost",
opts = {}, opts = {},
}, },
{ {
"chikko80/error-lens.nvim", "chikko80/error-lens.nvim",
event = "BufRead", event = "BufRead",
dependencies = { dependencies = {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
}, },
opts = {}, opts = {},
}, },
{ {
"RRethy/vim-illuminate", "RRethy/vim-illuminate",
event = "BufRead", event = "BufRead",
}, },
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" }, ft = { "markdown" },
build = function() build = function()
vim.fn["mkdp#util#install"]() vim.fn["mkdp#util#install"]()
end, end,
}, },
-- git -- git
{ {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
opts = { opts = {
enhanced_diff_hl = true, enhanced_diff_hl = true,
view = { view = {
merge_tool = { merge_tool = {
layout = "diff3_mixed", layout = "diff3_mixed",
disable_diagnostics = true, disable_diagnostics = true,
}, },
}, },
keymaps = { keymaps = {
view = { view = {
["<tab>"] = false, ["<tab>"] = false,
}, },
file_panel = { file_panel = {
["<tab>"] = false, ["<tab>"] = false,
}, },
file_history_panel = { file_history_panel = {
["<tab>"] = false, ["<tab>"] = false,
}, },
option_panel = { option_panel = {
["<tab>"] = false, ["<tab>"] = false,
}, },
}, },
}, },
}, },
--[[ overrides ]] --[[ overrides ]]
{ {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree, opts = overrides.nvimtree,
}, },
} }
return plugins return plugins