mirror of
https://github.com/DefectingCat/nvim
synced 2025-07-15 16:51:33 +00:00
add php configuration
This commit is contained in:
9
.editorconfig
Normal file
9
.editorconfig
Normal 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
|
36
init.lua
36
init.lua
@ -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 = " "
|
||||
|
||||
-- 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
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_config = require "configs.lazy"
|
||||
local lazy_config = require("configs.lazy")
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup({
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
config = function()
|
||||
require "options"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
config = function()
|
||||
require("options")
|
||||
end,
|
||||
},
|
||||
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins" },
|
||||
}, lazy_config)
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
dofile(vim.g.base46_cache .. "statusline")
|
||||
|
||||
require "nvchad.autocmds"
|
||||
require("nvchad.autocmds")
|
||||
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
require("mappings")
|
||||
end)
|
||||
require 'myinit'
|
||||
require("myinit")
|
||||
|
@ -8,7 +8,7 @@
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"codesnap.nvim": { "branch": "main", "commit": "3b7dd6a3ad6a1914cfa711316be89b4c7b12fd25" },
|
||||
"codesnap.nvim": { "branch": "main", "commit": "5c365e03286a9f8a00b7d06cd52c5f5afd203181" },
|
||||
"conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" },
|
||||
"crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
|
||||
@ -23,24 +23,24 @@
|
||||
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" },
|
||||
"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" },
|
||||
"multicursors.nvim": { "branch": "main", "commit": "b959ad0f38881e81e757208c6adfc9e6dc24dfc7" },
|
||||
"nvcommunity": { "branch": "main", "commit": "62b304f0d3ab1826f604b29013ed6e0cffec2fae" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
|
||||
"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-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" },
|
||||
"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-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" },
|
||||
"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" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
|
@ -1,100 +1,101 @@
|
||||
local options = {
|
||||
lsp_fallback = true,
|
||||
lsp_fallback = true,
|
||||
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
go = {
|
||||
"goimports",
|
||||
"goimports-reviser",
|
||||
"golines",
|
||||
"gopls",
|
||||
},
|
||||
sh = { "shfmt" },
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
python = { "isort", "black" },
|
||||
-- Use the "*" filetype to run formatters on all filetypes.
|
||||
["*"] = { "codespell" },
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
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().
|
||||
-- This can also be a function that returns the table.
|
||||
format_after_save = {
|
||||
lsp_fallback = true,
|
||||
},
|
||||
notify_on_error = true,
|
||||
formatters = {
|
||||
injected = { options = { ignore_errors = true } },
|
||||
lang_to_ext = {
|
||||
bash = "sh",
|
||||
c_sharp = "cs",
|
||||
elixir = "exs",
|
||||
latex = "tex",
|
||||
markdown = "md",
|
||||
python = "py",
|
||||
ruby = "rb",
|
||||
teal = "tl",
|
||||
},
|
||||
rustfmt = {
|
||||
options = {
|
||||
-- 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
|
||||
-- Otherwise, prettier will try to infer the parser from the file name
|
||||
ft_parsers = {
|
||||
-- javascript = "babel",
|
||||
-- javascriptreact = "babel",
|
||||
-- typescript = "typescript",
|
||||
-- typescriptreact = "typescript",
|
||||
-- vue = "vue",
|
||||
-- css = "css",
|
||||
-- scss = "scss",
|
||||
-- less = "less",
|
||||
-- html = "html",
|
||||
-- json = "json",
|
||||
-- jsonc = "json",
|
||||
-- yaml = "yaml",
|
||||
-- markdown = "markdown",
|
||||
-- ["markdown.mdx"] = "mdx",
|
||||
-- graphql = "graphql",
|
||||
-- handlebars = "glimmer",
|
||||
},
|
||||
-- Use a specific prettier parser for a file extension
|
||||
ext_parsers = {
|
||||
-- qmd = "markdown",
|
||||
},
|
||||
},
|
||||
-- # Example of using dprint only when a dprint.json file is present
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
-- # Example of using shfmt with extra args
|
||||
-- shfmt = {
|
||||
-- prepend_args = { "-i", "2", "-ci" },
|
||||
-- },
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
go = {
|
||||
"goimports",
|
||||
"goimports-reviser",
|
||||
"golines",
|
||||
"gopls",
|
||||
},
|
||||
sh = { "shfmt" },
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
python = { "isort", "black" },
|
||||
php = { "phpcbf" },
|
||||
-- Use the "*" filetype to run formatters on all filetypes.
|
||||
["*"] = { "codespell" },
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
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().
|
||||
-- This can also be a function that returns the table.
|
||||
format_after_save = {
|
||||
lsp_fallback = true,
|
||||
},
|
||||
notify_on_error = true,
|
||||
formatters = {
|
||||
injected = { options = { ignore_errors = true } },
|
||||
lang_to_ext = {
|
||||
bash = "sh",
|
||||
c_sharp = "cs",
|
||||
elixir = "exs",
|
||||
latex = "tex",
|
||||
markdown = "md",
|
||||
python = "py",
|
||||
ruby = "rb",
|
||||
teal = "tl",
|
||||
},
|
||||
rustfmt = {
|
||||
options = {
|
||||
-- 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
|
||||
-- Otherwise, prettier will try to infer the parser from the file name
|
||||
ft_parsers = {
|
||||
-- javascript = "babel",
|
||||
-- javascriptreact = "babel",
|
||||
-- typescript = "typescript",
|
||||
-- typescriptreact = "typescript",
|
||||
-- vue = "vue",
|
||||
-- css = "css",
|
||||
-- scss = "scss",
|
||||
-- less = "less",
|
||||
-- html = "html",
|
||||
-- json = "json",
|
||||
-- jsonc = "json",
|
||||
-- yaml = "yaml",
|
||||
-- markdown = "markdown",
|
||||
-- ["markdown.mdx"] = "mdx",
|
||||
-- graphql = "graphql",
|
||||
-- handlebars = "glimmer",
|
||||
},
|
||||
-- Use a specific prettier parser for a file extension
|
||||
ext_parsers = {
|
||||
-- qmd = "markdown",
|
||||
},
|
||||
},
|
||||
-- # Example of using dprint only when a dprint.json file is present
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
-- # Example of using shfmt with extra args
|
||||
-- shfmt = {
|
||||
-- prepend_args = { "-i", "2", "-ci" },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
|
||||
return options
|
||||
|
@ -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("DapStopped", { text = "", numhl = "DapStopped", texthl = "DapStopped" })
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointRejected",
|
||||
{ text = "", numhl = "DapBreakpointRejected", texthl = "DapBreakpointRejected" }
|
||||
"DapBreakpointRejected",
|
||||
{ text = "", numhl = "DapBreakpointRejected", texthl = "DapBreakpointRejected" }
|
||||
)
|
||||
|
||||
require("utils.autocmd")
|
||||
|
@ -15,4 +15,4 @@ opt.wildignore:append({ "*/node_modules/*" })
|
||||
opt.clipboard:append({ "unnamedplus" })
|
||||
opt.iskeyword:append("-")
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.autoindent = true --- Good auto indent
|
||||
opt.autoindent = true --- Good auto indent
|
||||
|
@ -3,22 +3,22 @@ local cmp = require("cmp")
|
||||
local overrides = require("configs.overrides")
|
||||
|
||||
local plugins = {
|
||||
{
|
||||
"NvChad/nvcommunity",
|
||||
{ import = "nvcommunity.git.diffview" },
|
||||
{ import = "nvcommunity.git.lazygit" },
|
||||
--[[ { import = "nvcommunity.lsp.prettyhover" }, ]]
|
||||
},
|
||||
{
|
||||
"NvChad/nvcommunity",
|
||||
{ import = "nvcommunity.git.diffview" },
|
||||
{ import = "nvcommunity.git.lazygit" },
|
||||
--[[ { import = "nvcommunity.lsp.prettyhover" }, ]]
|
||||
},
|
||||
|
||||
-- LSP, formatter, linter
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("configs.lspconfig")
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
end,
|
||||
},
|
||||
--[[ {
|
||||
-- LSP, formatter, linter
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("configs.lspconfig")
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
end,
|
||||
},
|
||||
--[[ {
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
@ -30,7 +30,7 @@ local plugins = {
|
||||
})
|
||||
end,
|
||||
}, ]]
|
||||
--[[ {
|
||||
--[[ {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
@ -50,117 +50,119 @@ local plugins = {
|
||||
})
|
||||
end,
|
||||
}, ]]
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"html",
|
||||
"volar",
|
||||
"tsserver",
|
||||
"tailwindcss",
|
||||
"eslint",
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"lemminx",
|
||||
},
|
||||
automatic_installation = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason-lspconfig").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"lua",
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"json",
|
||||
"vue",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"jsdoc",
|
||||
"scss",
|
||||
-- low level
|
||||
"rust",
|
||||
"toml",
|
||||
"go",
|
||||
"gomod",
|
||||
"kotlin",
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
disable = function(_, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
--[[ {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"html",
|
||||
"volar",
|
||||
"tsserver",
|
||||
"tailwindcss",
|
||||
"eslint",
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"lemminx",
|
||||
--[[ "phpactor", ]]
|
||||
--[[ "phpcbf", ]]
|
||||
},
|
||||
automatic_installation = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason-lspconfig").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"lua",
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"json",
|
||||
"vue",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"jsdoc",
|
||||
"scss",
|
||||
-- low level
|
||||
"rust",
|
||||
"toml",
|
||||
"go",
|
||||
"gomod",
|
||||
"kotlin",
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
disable = function(_, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
--[[ {
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return require("configs.null-ls")
|
||||
end,
|
||||
}, ]]
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = function()
|
||||
return require("configs.conform")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
|
||||
},
|
||||
opts = function()
|
||||
---@diagnostic disable-next-line: different-requires
|
||||
local M = require("nvchad.configs.cmp")
|
||||
M.completion.completeopt = "menu,menuone,noselect"
|
||||
M.mapping["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
})
|
||||
table.insert(M.sources, { name = "crates" })
|
||||
-- original LazyVim kind icon formatter
|
||||
local format_kinds = M.formatting.format
|
||||
M.formatting.format = function(entry, item)
|
||||
format_kinds(entry, item) -- add icons
|
||||
return require("tailwindcss-colorizer-cmp").formatter(entry, item)
|
||||
end
|
||||
return M
|
||||
end,
|
||||
},
|
||||
-- rust
|
||||
--[[ {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = function()
|
||||
return require("configs.conform")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
|
||||
},
|
||||
opts = function()
|
||||
---@diagnostic disable-next-line: different-requires
|
||||
local M = require("nvchad.configs.cmp")
|
||||
M.completion.completeopt = "menu,menuone,noselect"
|
||||
M.mapping["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
})
|
||||
table.insert(M.sources, { name = "crates" })
|
||||
-- original LazyVim kind icon formatter
|
||||
local format_kinds = M.formatting.format
|
||||
M.formatting.format = function(entry, item)
|
||||
format_kinds(entry, item) -- add icons
|
||||
return require("tailwindcss-colorizer-cmp").formatter(entry, item)
|
||||
end
|
||||
return M
|
||||
end,
|
||||
},
|
||||
-- rust
|
||||
--[[ {
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^4", -- Recommended
|
||||
ft = "rust",
|
||||
@ -168,38 +170,38 @@ local plugins = {
|
||||
require("configs.rust")
|
||||
end,
|
||||
}, ]]
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
ft = { "toml" },
|
||||
config = function(_, opts)
|
||||
local crates = require("crates")
|
||||
crates.setup(opts)
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "crates" } },
|
||||
})
|
||||
crates.show()
|
||||
--[[ require("core.utils").load_mappings("crates") ]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rust-lang/rust.vim",
|
||||
ft = "rust",
|
||||
init = function()
|
||||
vim.g.rustfmt_autosave = 1
|
||||
end,
|
||||
},
|
||||
-- golang
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function(_, opts)
|
||||
require("gopher").setup(opts)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd([[silent! GoInstallDeps]])
|
||||
end,
|
||||
},
|
||||
--[[ {
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
ft = { "toml" },
|
||||
config = function(_, opts)
|
||||
local crates = require("crates")
|
||||
crates.setup(opts)
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "crates" } },
|
||||
})
|
||||
crates.show()
|
||||
--[[ require("core.utils").load_mappings("crates") ]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rust-lang/rust.vim",
|
||||
ft = "rust",
|
||||
init = function()
|
||||
vim.g.rustfmt_autosave = 1
|
||||
end,
|
||||
},
|
||||
-- golang
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function(_, opts)
|
||||
require("gopher").setup(opts)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd([[silent! GoInstallDeps]])
|
||||
end,
|
||||
},
|
||||
--[[ {
|
||||
"dreamsofcode-io/nvim-dap-go",
|
||||
ft = "go",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
@ -207,12 +209,12 @@ local plugins = {
|
||||
require("dap-go").setup(opts)
|
||||
end,
|
||||
}, ]]
|
||||
{
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
{
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
|
||||
-- debug
|
||||
--[[ {
|
||||
-- debug
|
||||
--[[ {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
@ -231,13 +233,13 @@ local plugins = {
|
||||
end
|
||||
end,
|
||||
}, ]]
|
||||
--[[ {
|
||||
--[[ {
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
require("configs.dap")
|
||||
end,
|
||||
}, ]]
|
||||
--[[ {
|
||||
--[[ {
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
lazy = false,
|
||||
config = function(_, opts)
|
||||
@ -245,118 +247,117 @@ local plugins = {
|
||||
end,
|
||||
}, ]]
|
||||
|
||||
-- telescope, code action ui
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = function()
|
||||
require("configs.telescope")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build =
|
||||
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
},
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
event = "BufRead",
|
||||
},
|
||||
-- motion, UI and others
|
||||
{
|
||||
"phaazon/hop.nvim",
|
||||
branch = "v2", -- optional but strongly recommended
|
||||
config = function()
|
||||
-- you can configure Hop the way you like here; see :h hop-config
|
||||
local hop = require("hop")
|
||||
hop.setup({ keys = "etovxqpdygfblzhckisuran" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"smoka7/multicursors.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"smoka7/hydra.nvim",
|
||||
},
|
||||
opts = {
|
||||
hint_config = false,
|
||||
},
|
||||
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||
keys = {
|
||||
{
|
||||
mode = { "v", "n" },
|
||||
"<Leader>m",
|
||||
--[[ "<C-n>", ]]
|
||||
"<cmd>MCstart<cr>",
|
||||
desc = "Create a selection for selected text or word under the cursor",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"jxnblk/vim-mdx-js",
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup({})
|
||||
end,
|
||||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
},
|
||||
-- comment string
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {
|
||||
pre_hook = function(ctx)
|
||||
local U = require("Comment.utils")
|
||||
-- telescope, code action ui
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = function()
|
||||
require("configs.telescope")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
},
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
event = "BufRead",
|
||||
},
|
||||
-- motion, UI and others
|
||||
{
|
||||
"phaazon/hop.nvim",
|
||||
branch = "v2", -- optional but strongly recommended
|
||||
config = function()
|
||||
-- you can configure Hop the way you like here; see :h hop-config
|
||||
local hop = require("hop")
|
||||
hop.setup({ keys = "etovxqpdygfblzhckisuran" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"smoka7/multicursors.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"smoka7/hydra.nvim",
|
||||
},
|
||||
opts = {
|
||||
hint_config = false,
|
||||
},
|
||||
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||
keys = {
|
||||
{
|
||||
mode = { "v", "n" },
|
||||
"<Leader>m",
|
||||
--[[ "<C-n>", ]]
|
||||
"<cmd>MCstart<cr>",
|
||||
desc = "Create a selection for selected text or word under the cursor",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"jxnblk/vim-mdx-js",
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup({})
|
||||
end,
|
||||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
},
|
||||
-- comment string
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {
|
||||
pre_hook = function(ctx)
|
||||
local U = require("Comment.utils")
|
||||
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.block then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.block then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
location = location,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- ui
|
||||
{
|
||||
"mistricky/codesnap.nvim",
|
||||
build = "make",
|
||||
event = "BufRead",
|
||||
opts = {
|
||||
mac_window_bar = true,
|
||||
title = "RUA",
|
||||
code_font_family = "JetBrains Mono NL",
|
||||
watermark = "RUA",
|
||||
bg_color = "#535c68",
|
||||
},
|
||||
},
|
||||
--[[ {
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
location = location,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- ui
|
||||
{
|
||||
"mistricky/codesnap.nvim",
|
||||
build = "make",
|
||||
event = "BufRead",
|
||||
opts = {
|
||||
mac_window_bar = true,
|
||||
title = "RUA",
|
||||
code_font_family = "JetBrains Mono NL",
|
||||
watermark = "RUA",
|
||||
bg_color = "#535c68",
|
||||
},
|
||||
},
|
||||
--[[ {
|
||||
"rcarriga/nvim-notify",
|
||||
opts = {
|
||||
fps = 120,
|
||||
@ -364,12 +365,12 @@ local plugins = {
|
||||
stages = "slide",
|
||||
},
|
||||
} ]]
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
--[[ {
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
--[[ {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
@ -407,78 +408,78 @@ local plugins = {
|
||||
},
|
||||
},
|
||||
} ]]
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble", "TroubleRefresh" },
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
opts = {
|
||||
user_default_options = {
|
||||
tailwind = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "BufReadPost",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"chikko80/error-lens.nvim",
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufRead",
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
-- git
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
opts = {
|
||||
enhanced_diff_hl = true,
|
||||
view = {
|
||||
merge_tool = {
|
||||
layout = "diff3_mixed",
|
||||
disable_diagnostics = true,
|
||||
},
|
||||
},
|
||||
keymaps = {
|
||||
view = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
file_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
file_history_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
option_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble", "TroubleRefresh" },
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
opts = {
|
||||
user_default_options = {
|
||||
tailwind = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "BufReadPost",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"chikko80/error-lens.nvim",
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufRead",
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
-- git
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
opts = {
|
||||
enhanced_diff_hl = true,
|
||||
view = {
|
||||
merge_tool = {
|
||||
layout = "diff3_mixed",
|
||||
disable_diagnostics = true,
|
||||
},
|
||||
},
|
||||
keymaps = {
|
||||
view = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
file_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
file_history_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
option_panel = {
|
||||
["<tab>"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
--[[ overrides ]]
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = overrides.nvimtree,
|
||||
},
|
||||
--[[ overrides ]]
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = overrides.nvimtree,
|
||||
},
|
||||
}
|
||||
|
||||
return plugins
|
||||
|
Reference in New Issue
Block a user