355 lines
10 KiB
Lua
355 lines
10 KiB
Lua
return {
|
|
{
|
|
"LazyVim/LazyVim",
|
|
opts = {
|
|
colorscheme = "tokyonight-night",
|
|
-- colorscheme = "catppuccin-mocha",
|
|
},
|
|
},
|
|
{
|
|
"nvim-telescope/telescope.nvim",
|
|
cmd = "Telescope",
|
|
keys = function()
|
|
return {}
|
|
end,
|
|
config = function(opts)
|
|
require("telescope").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"ThePrimeagen/harpoon",
|
|
lazy = true,
|
|
config = function()
|
|
require("telescope").load_extension("harpoon")
|
|
end,
|
|
},
|
|
{
|
|
"iamcco/markdown-preview.nvim",
|
|
lazy = true,
|
|
event = "FileType markdown",
|
|
build = "cd app && yarn install",
|
|
},
|
|
{
|
|
"nvim-telescope/telescope-project.nvim",
|
|
lazy = true,
|
|
},
|
|
{
|
|
"nvim-telescope/telescope-file-browser.nvim",
|
|
lazy = true,
|
|
config = function()
|
|
require("telescope").load_extension("file_browser")
|
|
end,
|
|
},
|
|
{
|
|
"jvgrootveld/telescope-zoxide",
|
|
lazy = true,
|
|
config = function()
|
|
local z_utils = require("telescope._extensions.zoxide.utils")
|
|
local t = require("telescope")
|
|
-- Configure the extension
|
|
t.setup({
|
|
extensions = {
|
|
zoxide = {
|
|
prompt_title = "[ Queries ]",
|
|
mappings = {
|
|
default = {
|
|
after_action = function(selection)
|
|
print("Update to (" .. selection.z_score .. ") " .. selection.path)
|
|
end,
|
|
},
|
|
["<C-s>"] = {
|
|
before_action = function(selection)
|
|
print("before C-s")
|
|
end,
|
|
action = function(selection)
|
|
vim.cmd("edit " .. selection.path)
|
|
end,
|
|
},
|
|
["<C-q>"] = { action = z_utils.create_basic_command("split") },
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
-- Load the extension
|
|
t.load_extension("zoxide")
|
|
end,
|
|
},
|
|
{
|
|
"lervag/vimtex",
|
|
config = function()
|
|
vim.cmd("let g:vimtex_quickfix_mode=0")
|
|
vim.cmd("let g:vimtex_view_general_viewer = 'evince'")
|
|
vim.cmd("let g:vimtex_compiler_method = 'latexmk'")
|
|
vim.cmd(
|
|
"let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}"
|
|
)
|
|
end,
|
|
},
|
|
{
|
|
"echasnovski/mini.ai",
|
|
diabled = true,
|
|
},
|
|
{
|
|
"rcarriga/nvim-notify",
|
|
opts = {
|
|
top_down = false,
|
|
},
|
|
},
|
|
{
|
|
"jbyuki/instant.nvim",
|
|
config = function()
|
|
vim.cmd("let g:instant_username = 'dashie'")
|
|
end,
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
opts = {
|
|
textobjects = {
|
|
select = {
|
|
enable = true,
|
|
lookahead = true,
|
|
keymaps = {
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
["af"] = "@function.outer",
|
|
["if"] = "@function.inner",
|
|
["ac"] = "@class.outer",
|
|
["ic"] = "@class.inner",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"karb94/neoscroll.nvim",
|
|
config = function()
|
|
require("neoscroll").setup()
|
|
local t = {}
|
|
t["<A-l>"] = { "scroll", { "-vim.wo.scroll", "true", "250" } }
|
|
t["<A-k>"] = { "scroll", { "vim.wo.scroll", "true", "250" } }
|
|
t["<C-b>"] = { "scroll", { "-vim.api.nvim_win_get_height(0)", "true", "450" } }
|
|
t["<C-f>"] = { "scroll", { "vim.api.nvim_win_get_height(0)", "true", "450" } }
|
|
t["<C-y>"] = { "scroll", { "-0.10", "false", "100" } }
|
|
t["<C-e>"] = { "scroll", { "0.10", "false", "100" } }
|
|
t["zt"] = { "zt", { "250" } }
|
|
t["zz"] = { "zz", { "250" } }
|
|
t["zb"] = { "zb", { "250" } }
|
|
|
|
require("neoscroll.config").set_mappings(t)
|
|
end,
|
|
},
|
|
{
|
|
"kaarmu/typst.vim",
|
|
lazy = true,
|
|
event = "FileType typst",
|
|
},
|
|
{
|
|
"folke/which-key.nvim",
|
|
event = "VeryLazy",
|
|
opts = {
|
|
plugins = { spelling = true },
|
|
defaults = {
|
|
mode = { "n", "v" },
|
|
["g"] = { name = "+goto" },
|
|
["gz"] = { name = "+surround" },
|
|
["]"] = { name = "+next" },
|
|
["["] = { name = "+prev" },
|
|
["<leader><tab>"] = { name = "+tabs" },
|
|
["<leader>b"] = { name = "+buffer" },
|
|
["<leader>c"] = { name = "+code" },
|
|
["<leader>f"] = { name = "+file/find" },
|
|
["<leader>g"] = { name = "+git" },
|
|
["<leader>gh"] = { name = "+hunks" },
|
|
["<leader>q"] = { name = "+quit/session" },
|
|
["<leader>s"] = { name = "+search" },
|
|
["<leader>u"] = { name = "+ui" },
|
|
["<leader>w"] = { name = "+windows" },
|
|
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
|
["<leader>h"] = { name = "+harpoon" },
|
|
["<leader>d"] = { name = "+DAP" },
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
local wk = require("which-key")
|
|
wk.setup(opts)
|
|
wk.register(opts.defaults)
|
|
end,
|
|
},
|
|
{
|
|
"f-person/git-blame.nvim",
|
|
lazy = true,
|
|
},
|
|
{
|
|
"mg979/vim-visual-multi",
|
|
},
|
|
{
|
|
"rouge8/neotest-rust",
|
|
},
|
|
{
|
|
"Issafalcon/neotest-dotnet",
|
|
},
|
|
{
|
|
"andy-bell101/neotest-java",
|
|
},
|
|
{
|
|
"nvim-neotest/neotest-go",
|
|
},
|
|
{
|
|
"nvim-neotest/neotest-python",
|
|
},
|
|
{
|
|
"nvim-neotest/neotest",
|
|
dependencies = {
|
|
"rouge8/neotest-rust",
|
|
"Issafalcon/neotest-dotnet",
|
|
"andy-bell101/neotest-java",
|
|
"nvim-neotest/neotest-go",
|
|
"nvim-neotest/neotest-python",
|
|
},
|
|
opts = {
|
|
adapters = {
|
|
["neotest-rust"] = {},
|
|
["neotest-dotnet"] = {},
|
|
["neotest-java"] = {},
|
|
["neotest-go"] = {},
|
|
["neotest-python"] = {},
|
|
},
|
|
status = { virtual_text = true },
|
|
output = { open_on_run = true },
|
|
quickfix = {
|
|
open = function()
|
|
if require("lazyvim.util").has("trouble.nvim") then
|
|
vim.cmd("Trouble quickfix")
|
|
else
|
|
vim.cmd("copen")
|
|
end
|
|
end,
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
|
vim.diagnostic.config({
|
|
virtual_text = {
|
|
format = function(diagnostic)
|
|
-- Replace newline and tab characters with space for more compact diagnostics
|
|
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
|
return message
|
|
end,
|
|
},
|
|
}, neotest_ns)
|
|
|
|
if opts.adapters then
|
|
local adapters = {}
|
|
for name, config in pairs(opts.adapters or {}) do
|
|
if type(name) == "number" then
|
|
if type(config) == "string" then
|
|
config = require(config)
|
|
end
|
|
adapters[#adapters + 1] = config
|
|
elseif config ~= false then
|
|
local adapter = require(name)
|
|
if type(config) == "table" and not vim.tbl_isempty(config) then
|
|
local meta = getmetatable(adapter)
|
|
if adapter.setup then
|
|
adapter.setup(config)
|
|
elseif meta and meta.__call then
|
|
adapter(config)
|
|
else
|
|
error("Adapter " .. name .. " does not support setup")
|
|
end
|
|
end
|
|
adapters[#adapters + 1] = adapter
|
|
end
|
|
end
|
|
opts.adapters = adapters
|
|
end
|
|
|
|
require("neotest").setup(opts)
|
|
end,
|
|
-- stylua: ignore
|
|
keys = {
|
|
{ "<leader>tT", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
|
{ "<leader>tt", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
|
|
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
|
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
|
|
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
|
|
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
|
{ "<leader>tS", function() require("neotest").run.stop() end, desc = "Stop" },
|
|
},
|
|
},
|
|
{
|
|
"echasnovski/mini.hipatterns",
|
|
event = "BufReadPre",
|
|
opts = function()
|
|
local hi = require("mini.hipatterns")
|
|
return {
|
|
-- custom LazyVim option to enable the tailwind integration
|
|
tailwind = {
|
|
enabled = true,
|
|
ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" },
|
|
-- full: the whole css class will be highlighted
|
|
-- compact: only the color will be highlighted
|
|
style = "full",
|
|
},
|
|
highlighters = {
|
|
hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }),
|
|
},
|
|
}
|
|
end,
|
|
config = function(_, opts)
|
|
-- backward compatibility
|
|
if opts.tailwind == true then
|
|
opts.tailwind = {
|
|
enabled = true,
|
|
ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" },
|
|
style = "full",
|
|
}
|
|
end
|
|
if type(opts.tailwind) == "table" and opts.tailwind.enabled then
|
|
-- reset hl groups when colorscheme changes
|
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
|
callback = function()
|
|
M.hl = {}
|
|
end,
|
|
})
|
|
opts.highlighters.tailwind = {
|
|
pattern = function()
|
|
if not vim.tbl_contains(opts.tailwind.ft, vim.bo.filetype) then
|
|
return
|
|
end
|
|
if opts.tailwind.style == "full" then
|
|
return "%f[%w:-]()[%w:-]+%-[a-z%-]+%-%d+()%f[^%w:-]"
|
|
elseif opts.tailwind.style == "compact" then
|
|
return "%f[%w:-][%w:-]+%-()[a-z%-]+%-%d+()%f[^%w:-]"
|
|
end
|
|
end,
|
|
group = function(_, _, m)
|
|
---@type string
|
|
local match = m.full_match
|
|
---@type string, number
|
|
local color, shade = match:match("[%w-]+%-([a-z%-]+)%-(%d+)")
|
|
shade = tonumber(shade)
|
|
local bg = vim.tbl_get(M.colors, color, shade)
|
|
if bg then
|
|
local hl = "MiniHipatternsTailwind" .. color .. shade
|
|
if not M.hl[hl] then
|
|
M.hl[hl] = true
|
|
local bg_shade = shade == 500 and 950 or shade < 500 and 900 or 100
|
|
local fg = vim.tbl_get(M.colors, color, bg_shade)
|
|
vim.api.nvim_set_hl(0, hl, { bg = "#" .. bg, fg = "#" .. fg })
|
|
end
|
|
return hl
|
|
end
|
|
end,
|
|
priority = 2000,
|
|
}
|
|
end
|
|
require("mini.hipatterns").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"barreiroleo/ltex_extra.nvim",
|
|
ft = { "markdown", "tex", "typst", "typ" },
|
|
lazy = true,
|
|
},
|
|
}
|