587 lines
22 KiB
Lua
587 lines
22 KiB
Lua
return {
|
|
{
|
|
"scottmckendry/cyberdream.nvim",
|
|
lazy = false,
|
|
priority = 1000,
|
|
config = function()
|
|
require("cyberdream").setup({
|
|
highlights = {
|
|
Comment = { fg = "#89ca78", bg = "NONE" },
|
|
},
|
|
colors = {
|
|
bg = "#000000",
|
|
green = "#00cc00",
|
|
purple = "#5ef1ff",
|
|
cyan = "#bd5eff"
|
|
}
|
|
})
|
|
vim.cmd.colorscheme("cyberdream")
|
|
end
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
build = ":TSUpdate",
|
|
main = "nvim-treesitter.configs",
|
|
opts = {
|
|
ensure_installed = {
|
|
"vimdoc", "lua", "markdown", "markdown_inline", "c", "cpp", "rust", "javascript",
|
|
"typescript", "html", "python", "json", "hyprlang"
|
|
},
|
|
highlight = {
|
|
enable = true,
|
|
additional_vim_regex_highlighting = false,
|
|
},
|
|
sync_install = false,
|
|
auto_install = true
|
|
}
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
|
event = "VeryLazy"
|
|
},
|
|
{
|
|
"mason-org/mason-lspconfig.nvim",
|
|
dependencies = {
|
|
{
|
|
"mason-org/mason.nvim",
|
|
opts = {
|
|
ensure_installed = {
|
|
"shfmt",
|
|
}
|
|
}
|
|
},
|
|
"neovim/nvim-lspconfig",
|
|
"saghen/blink.cmp"
|
|
},
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
config = function()
|
|
require("mason-lspconfig").setup({
|
|
automatic_installation = true,
|
|
ensure_installed = { "lua_ls", "bashls", "clangd", "rust_analyzer", "pyright", "marksman", "tailwindcss" }
|
|
})
|
|
local blinkCapabilities = require("blink.cmp").get_lsp_capabilities()
|
|
vim.lsp.config("lua_ls", {
|
|
settings = {
|
|
Lua = {
|
|
diagnostics = {
|
|
globals = { "vim" }
|
|
},
|
|
workspace = {
|
|
library = vim.api.nvim_get_runtime_file("", true)
|
|
},
|
|
telemetry = {
|
|
enable = false
|
|
}
|
|
}
|
|
},
|
|
capabilities = blinkCapabilities
|
|
})
|
|
vim.lsp.config("bashls", {
|
|
filetypes = { "bash", "sh", "zsh" },
|
|
settings = {
|
|
bashIde = {
|
|
globPattern = "*@(.sh|.inc|.bash|.command|.zsh)"
|
|
}
|
|
},
|
|
capabilities = blinkCapabilities
|
|
})
|
|
vim.lsp.config("clangd", { capabilities = blinkCapabilities })
|
|
vim.lsp.config("rust_analyzer", { capabilities = blinkCapabilities })
|
|
vim.lsp.config("pyright", { capabilities = blinkCapabilities })
|
|
vim.lsp.config("marksman", { capabilities = blinkCapabilities })
|
|
vim.lsp.config("tailwindcss", {
|
|
filetypes = { "html", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss" },
|
|
capabilities = blinkCapabilities
|
|
})
|
|
vim.lsp.config("nil_ls", { capabilities = blinkCapabilities })
|
|
end
|
|
},
|
|
{
|
|
"stevearc/conform.nvim",
|
|
config = function()
|
|
vim.g.enable_autoformat = true
|
|
require("conform").setup({
|
|
formatters_by_ft = {
|
|
nix = { "nixfmt" },
|
|
zsh = { "shfmt" },
|
|
-- TODO: More formatters by filetype
|
|
},
|
|
format_on_save = function(bufnr)
|
|
if vim.g.enable_autoformat or vim.b[bufnr].enable_autoformat then
|
|
return { timeout_ms = 500, lsp_format = "fallback" }
|
|
end
|
|
end
|
|
})
|
|
|
|
vim.api.nvim_create_user_command("Format", function(args)
|
|
local range = nil
|
|
if args.count ~= -1 then
|
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
|
range = {
|
|
start = { args.line1, 0 },
|
|
["end"] = { args.line2, end_line:len() },
|
|
}
|
|
end
|
|
require("conform").format({ async = true, range = range })
|
|
end, { range = true })
|
|
|
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
|
if args.bang then
|
|
vim.b.enable_autoformat = false
|
|
else
|
|
vim.g.enable_autoformat = false
|
|
end
|
|
end, { desc = "Disable autoformat-on-save", bang = true })
|
|
vim.api.nvim_create_user_command("FormatEnable", function(args)
|
|
if args.bang then
|
|
vim.b.enable_autoformat = true
|
|
else
|
|
vim.g.enable_autoformat = true
|
|
end
|
|
end, { desc = "Re-enable autoformat-on-save", bang = true })
|
|
|
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
|
end
|
|
},
|
|
{
|
|
"saghen/blink.cmp",
|
|
dependencies = { "rafamadriz/friendly-snippets" },
|
|
version = "*",
|
|
opts = {
|
|
enabled = function()
|
|
return not vim.tbl_contains({ "text" }, vim.bo.filetype)
|
|
and vim.bo.buftype ~= "prompt"
|
|
and vim.b.completion ~= false
|
|
end,
|
|
keymap = { preset = "default" },
|
|
appearance = {
|
|
nerd_font_variant = "mono"
|
|
},
|
|
signature = { enabled = true },
|
|
cmdline = {
|
|
enabled = true,
|
|
keymap = { preset = "cmdline" },
|
|
sources = function()
|
|
local type = vim.fn.getcmdtype()
|
|
if type == "/" or type == "?" then return { "buffer" } end
|
|
if type == ":" or type == "@" then return { "cmdline" } end
|
|
return {}
|
|
end,
|
|
completion = {
|
|
trigger = {
|
|
show_on_blocked_trigger_characters = {},
|
|
show_on_x_blocked_trigger_characters = {},
|
|
},
|
|
list = {
|
|
selection = {
|
|
preselect = true,
|
|
auto_insert = true,
|
|
},
|
|
},
|
|
menu = { auto_show = true },
|
|
ghost_text = { enabled = true }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
event = "InsertEnter",
|
|
opts = {}
|
|
},
|
|
{
|
|
"windwp/nvim-ts-autotag",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
opts = {}
|
|
},
|
|
{
|
|
"folke/trouble.nvim",
|
|
opts = {},
|
|
cmd = "Trouble",
|
|
keys = {
|
|
{
|
|
"<leader>xx",
|
|
"<cmd>Trouble diagnostics toggle<cr>",
|
|
desc = "Diagnostics (Trouble)",
|
|
},
|
|
{
|
|
"<leader>xX",
|
|
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
|
desc = "Buffer Diagnostics (Trouble)"
|
|
},
|
|
{
|
|
"<leader>cs",
|
|
"<cmd>Trouble symbols toggle focus=false<cr>",
|
|
desc = "Symbols (Trouble)"
|
|
},
|
|
{
|
|
"<leader>cl",
|
|
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
|
desc = "LSP Definitions / references / ... (Trouble)"
|
|
},
|
|
{
|
|
"<leader>xL",
|
|
"<cmd>Trouble loclist toggle<cr>",
|
|
desc = "Location List (Trouble)"
|
|
},
|
|
{
|
|
"<leader>xQ",
|
|
"<cmd>Trouble qflist toggle<cr>",
|
|
desc = "Quickfix List (Trouble)"
|
|
},
|
|
}
|
|
},
|
|
{
|
|
"winston0410/range-highlight.nvim",
|
|
event = { "CmdlineEnter" },
|
|
opts = {},
|
|
},
|
|
{
|
|
"nvim-pack/nvim-spectre",
|
|
config = function()
|
|
local spectre = require("spectre")
|
|
vim.keymap.set("n", "<leader>ss", function() spectre.toggle() end, { desc = "Spectre toggle" })
|
|
vim.keymap.set("n", "<leader>sw", function() require("spectre").open_visual({ select_word = true }) end,
|
|
{ desc = "Spectre search current word" })
|
|
vim.keymap.set("v", "<leader>sw", function() require("spectre").open_visual() end,
|
|
{ desc = "Spectre search current word" })
|
|
vim.keymap.set("n", "<leader>sf", function() require("spectre").open_file_search({ select_word = true }) end,
|
|
{ desc = "Spectre search current word in current file" })
|
|
vim.keymap.set("v", "<leader>sf", function() require("spectre").open_file_search() end,
|
|
{ desc = "Spectre search current word in current file" })
|
|
spectre.setup({
|
|
is_block_ui_break = true
|
|
})
|
|
end
|
|
},
|
|
{
|
|
"kdheepak/lazygit.nvim",
|
|
lazy = true,
|
|
cmd = {
|
|
"LazyGit",
|
|
"LazyGitConfig",
|
|
"LazyGitCurrentFile",
|
|
"LazyGitFilter",
|
|
"LazyGitFilterCurrentFile",
|
|
},
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim",
|
|
},
|
|
keys = {
|
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
|
}
|
|
},
|
|
{
|
|
"nvim-telescope/telescope.nvim",
|
|
branch = "0.1.x",
|
|
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-fzf-native.nvim" },
|
|
config = function()
|
|
require("telescope").load_extension("fzf")
|
|
local builtin = require("telescope.builtin")
|
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope find files" })
|
|
vim.keymap.set("n", "<leader>fg", builtin.git_files, { desc = "Telescope git files" })
|
|
vim.keymap.set("n", "<leader>fs", builtin.live_grep, { desc = "Telescope live grep" })
|
|
vim.keymap.set("n", "<leader>fw", function()
|
|
local word = vim.fn.expand("<cword>")
|
|
builtin.grep_string({ search = word })
|
|
end, { desc = "Telescope grep current word" })
|
|
vim.keymap.set("n", "<leader>fW", function()
|
|
local word = vim.fn.expand("<cWORD>")
|
|
builtin.grep_string({ search = word })
|
|
end, { desc = "Telescope grep current WORD" })
|
|
end
|
|
},
|
|
{
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
build =
|
|
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && cmake --build build --config Release"
|
|
},
|
|
{
|
|
"mbbill/undotree"
|
|
},
|
|
{
|
|
"mikavilpas/yazi.nvim",
|
|
version = "*",
|
|
event = "VeryLazy",
|
|
dependencies = {
|
|
{ "nvim-lua/plenary.nvim", lazy = true },
|
|
},
|
|
keys = {
|
|
{
|
|
"<leader>-",
|
|
mode = { "n", "v" },
|
|
"<cmd>Yazi<cr>",
|
|
desc = "Open yazi at the current file",
|
|
},
|
|
{
|
|
"<leader>cw",
|
|
"<cmd>Yazi cwd<cr>",
|
|
desc = "Open the file manager in nvim's working directory",
|
|
},
|
|
{
|
|
"<c-up>",
|
|
"<cmd>Yazi toggle<cr>",
|
|
desc = "Resume the last yazi session",
|
|
},
|
|
},
|
|
---@type YaziConfig | {}
|
|
opts = {
|
|
open_for_directories = true,
|
|
keymaps = {
|
|
show_help = "<f1>",
|
|
},
|
|
},
|
|
init = function()
|
|
vim.g.loaded_netrwPlugin = 1
|
|
end,
|
|
},
|
|
{
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
event = "BufReadPost",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
config = function()
|
|
vim.api.nvim_set_hl(0, "IblScope", { link = "Function", nocombine = true })
|
|
|
|
require("ibl").setup({
|
|
scope = {
|
|
char = "│",
|
|
enabled = true,
|
|
show_start = true,
|
|
show_end = false,
|
|
show_exact_scope = true
|
|
},
|
|
indent = {
|
|
char = "┊"
|
|
},
|
|
})
|
|
end
|
|
},
|
|
{
|
|
"folke/todo-comments.nvim",
|
|
dependencies = { "nvim-lua/plenary.nvim" },
|
|
config = function(_, opts)
|
|
require("todo-comments").setup(opts)
|
|
vim.keymap.set("n", "Tn", function() require("todo-comments").jump_next() end, { desc = "Next todo comment" })
|
|
vim.keymap.set("n", "TN", function() require("todo-comments").jump_prev() end,
|
|
{ desc = "Previous todo comment" })
|
|
end,
|
|
opts = {
|
|
signs = true, -- show icons in the signs column
|
|
sign_priority = 8, -- sign priority
|
|
keywords = {
|
|
BUG = {
|
|
icon = " ", -- icon used for the sign, and in search results
|
|
color = "error", -- can be a hex color, or a named color (see below)
|
|
alt = { "FIX", "FIXME", "FIXIT", "ISSUE" }
|
|
},
|
|
TODO = { icon = " ", color = "info" },
|
|
HACK = { icon = " ", color = "warning" },
|
|
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
|
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
|
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
|
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }
|
|
},
|
|
gui_style = {
|
|
fg = "NONE", -- The gui style to use for the fg highlight group.
|
|
bg = "BOLD" -- The gui style to use for the bg highlight group.
|
|
},
|
|
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
|
highlight = {
|
|
multiline = true, -- enable multine todo comments
|
|
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
|
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
|
before = "", -- "fg" or "bg" or empty
|
|
keyword = "bg", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
|
after = "fg", -- "fg" or "bg" or empty
|
|
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
|
comments_only = true, -- uses treesitter to match keywords in comments only
|
|
max_line_len = 400, -- ignore lines longer than this
|
|
exclude = {}, -- list of file types to exclude highlighting
|
|
},
|
|
colors = {
|
|
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
|
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
|
info = { "DiagnosticInfo", "#2563EB" },
|
|
hint = { "DiagnosticHint", "#10B981" },
|
|
default = { "Identifier", "#7C3AED" },
|
|
test = { "Identifier", "#FF00FF" }
|
|
},
|
|
search = {
|
|
command = "rg",
|
|
args = {
|
|
"--color=never",
|
|
"--no-heading",
|
|
"--with-filename",
|
|
"--line-number",
|
|
"--column"
|
|
},
|
|
pattern = [[\b(KEYWORDS):]]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"folke/flash.nvim",
|
|
event = "VeryLazy",
|
|
---@type Flash.Config
|
|
opts = {},
|
|
keys = {
|
|
-- { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
|
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
|
},
|
|
},
|
|
{
|
|
"j-hui/fidget.nvim",
|
|
opts = {
|
|
progress = {
|
|
display = {
|
|
done_ttl = 0.5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"norcalli/nvim-colorizer.lua",
|
|
main = "colorizer",
|
|
config = function()
|
|
require("colorizer").setup({
|
|
css = {
|
|
css = true,
|
|
},
|
|
"html",
|
|
"javascript",
|
|
"markdown",
|
|
},
|
|
{
|
|
RGB = true,
|
|
RRGGBB = true,
|
|
RRGGBBAA = true,
|
|
names = false,
|
|
mode = "background",
|
|
}
|
|
)
|
|
end
|
|
},
|
|
{
|
|
"nvim-tree/nvim-web-devicons",
|
|
lazy = true
|
|
},
|
|
{
|
|
"obsidian-nvim/obsidian.nvim",
|
|
version = "*",
|
|
lazy = true,
|
|
event = {
|
|
"BufEnter " .. vim.fn.expand "~" .. "/Obsidian*"
|
|
},
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim",
|
|
"nvim-telescope/telescope.nvim",
|
|
"nvim-treesitter/nvim-treesitter",
|
|
"saghen/blink.cmp"
|
|
},
|
|
opts = {
|
|
legacy_commands = false,
|
|
workspaces = {
|
|
{
|
|
name = "personal",
|
|
path = "~/Obsidian/personal",
|
|
}
|
|
},
|
|
notes_subdir = "Notes",
|
|
daily_notes = {
|
|
folder = "Notes/Daily",
|
|
date_format = "%Y-%m-%d",
|
|
alias_format = "%B %-d, %Y",
|
|
default_tags = { "daily-notes" }
|
|
},
|
|
completion = {
|
|
nvim_cmp = false,
|
|
blink = true,
|
|
min_chars = 1,
|
|
},
|
|
new_notes_location = "notes_subdir",
|
|
note_path_func = function(spec)
|
|
local path = spec.dir / spec.id
|
|
return path:with_suffix(".md")
|
|
end,
|
|
link = {
|
|
format = "shortest",
|
|
style = "wiki",
|
|
},
|
|
frontmatter = {
|
|
enabled = false,
|
|
},
|
|
templates = {
|
|
folder = "Templates",
|
|
date_format = "%Y-%m-%d",
|
|
time_format = "%H:%M",
|
|
substitutions = {},
|
|
},
|
|
picker = {
|
|
name = "telescope.nvim",
|
|
note_mappings = {
|
|
new = "<C-x>",
|
|
insert_link = "<C-l>",
|
|
},
|
|
tag_mappings = {
|
|
tag_note = "<C-x>",
|
|
insert_tag = "<C-l>",
|
|
},
|
|
},
|
|
checkboxes = {
|
|
[" "] = { char = "", hl_group = "ObsidianTodo" },
|
|
["x"] = { char = "", hl_group = "ObsidianDone" },
|
|
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
|
|
["~"] = { char = "", hl_group = "ObsidianTilde" },
|
|
["!"] = { char = "", hl_group = "ObsidianImportant" }
|
|
},
|
|
ui = {
|
|
enable = true,
|
|
update_debounce = 200,
|
|
max_file_length = 5000,
|
|
bullets = { char = "•", hl_group = "ObsidianBullet" },
|
|
external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" },
|
|
reference_text = { hl_group = "ObsidianRefText" },
|
|
highlight_text = { hl_group = "ObsidianHighlightText" },
|
|
tags = { hl_group = "ObsidianTag" },
|
|
block_ids = { hl_group = "ObsidianBlockID" },
|
|
hl_groups = {
|
|
ObsidianTodo = { bold = true, fg = "#f78c6c" },
|
|
ObsidianDone = { bold = true, fg = "#89ddff" },
|
|
ObsidianRightArrow = { bold = true, fg = "#f78c6c" },
|
|
ObsidianTilde = { bold = true, fg = "#ff5370" },
|
|
ObsidianImportant = { bold = true, fg = "#d73128" },
|
|
ObsidianBullet = { bold = true, fg = "#89ddff" },
|
|
ObsidianRefText = { underline = true, fg = "#c792ea" },
|
|
ObsidianExtLinkIcon = { fg = "#c792ea" },
|
|
ObsidianTag = { italic = true, fg = "#89ddff" },
|
|
ObsidianBlockID = { italic = true, fg = "#89ddff" },
|
|
ObsidianHighlightText = { bg = "#75662e" }
|
|
},
|
|
}
|
|
},
|
|
keys = {
|
|
{
|
|
"fn",
|
|
"<cmd>Obsidian quick_switch<cr>",
|
|
desc = "Switch between Obsidian notes"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Kicamon/markdown-table-mode.nvim",
|
|
main = "markdown-table-mode",
|
|
opts = {}
|
|
},
|
|
{
|
|
"Thiago4532/mdmath.nvim",
|
|
dependencies = {
|
|
"nvim-treesitter/nvim-treesitter",
|
|
},
|
|
opts = {
|
|
filetypes = { "markdown" },
|
|
update_interval = 500
|
|
}
|
|
}
|
|
}
|