This commit is contained in:
xfy
2025-05-09 23:34:50 +08:00
parent 5521ba3ead
commit 4a9af30626
53 changed files with 517 additions and 3687 deletions

8
lua/config/autocmds.lua Normal file
View File

@ -0,0 +1,8 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--
-- Add any additional autocmds here
-- with `vim.api.nvim_create_autocmd`
--
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")

3
lua/config/keymaps.lua Normal file
View File

@ -0,0 +1,3 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

53
lua/config/lazy.lua Normal file
View File

@ -0,0 +1,53 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

3
lua/config/options.lua Normal file
View File

@ -0,0 +1,3 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here

197
lua/plugins/example.lua Normal file
View File

@ -0,0 +1,197 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}

View File

@ -1,95 +0,0 @@
local M = {
a = {
"⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷",
"⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇",
"⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽",
"⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕",
"⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕",
"⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕",
"⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄",
"⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕",
"⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿",
"⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟",
"⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠",
"⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙",
"⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣",
},
b = {
"░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░ ",
"░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░",
"░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░",
"░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓████████▓▒░",
"░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░",
"░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░",
"░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░",
},
c = {
[[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣡⣾⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣟⠻⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⡿⢫⣷⣿⣿⣿⣿⣿⣿⣿⣾⣯⣿⡿⢧⡚⢷⣌⣽⣿⣿⣿⣿⣿⣶⡌⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣇⣘⠿⢹⣿⣿⣿⣿⣿⣻⢿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⠀⢸⣿⣿⡇⣿⣿⣿⣿⣿⣿⣿⣿⡟⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣻⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⡇⠀⣬⠏⣿⡇⢻⣿⣿⣿⣿⣿⣿⣿⣷⣼⣿⣿⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⢻⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⠀⠈⠁⠀⣿⡇⠘⡟⣿⣿⣿⣿⣿⣿⣿⣿⡏⠿⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣇⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⡏⠀⠀⠐⠀⢻⣇⠀⠀⠹⣿⣿⣿⣿⣿⣿⣩⡶⠼⠟⠻⠞⣿⡈⠻⣟⢻⣿⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⢿⠀⡆⠀⠘⢿⢻⡿⣿⣧⣷⢣⣶⡃⢀⣾⡆⡋⣧⠙⢿⣿⣿⣟⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⡥⠂⡐⠀⠁⠑⣾⣿⣿⣾⣿⣿⣿⡿⣷⣷⣿⣧⣾⣿⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⡿⣿⣍⡴⠆⠀⠀⠀⠀⠀⠀⠀⠀⣼⣄⣀⣷⡄⣙⢿⣿⣿⣿⣿⣯⣶⣿⣿⢟⣾⣿⣿⢡⣿⣿⣿⣿⣿]],
[[⣿⡏⣾⣿⣿⣿⣷⣦⠀⠀⠀⢀⡀⠀⠀⠠⣭⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⣡⣾⣿⣿⢏⣾⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⣿⣿⣿⣿⣿⡴⠀⠀⠀⠀⠀⠠⠀⠰⣿⣿⣿⣷⣿⠿⠿⣿⣿⣭⡶⣫⠔⢻⢿⢇⣾⣿⣿⣿⣿⣿⣿]],
[[⣿⣿⣿⡿⢫⣽⠟⣋⠀⠀⠀⠀⣶⣦⠀⠀⠀⠈⠻⣿⣿⣿⣾⣿⣿⣿⣿⡿⣣⣿⣿⢸⣾⣿⣿⣿⣿⣿⣿⣿]],
[[⡿⠛⣹⣶⣶⣶⣾⣿⣷⣦⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠉⠛⠻⢿⣿⡿⠫⠾⠿⠋⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣀⡆⣠⢀⣴⣏⡀⠀⠀⠀⠉⠀⠀⢀⣠⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⠿⠛⠛⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣯⣟⠷⢷⣿⡿⠋⠀⠀⠀⠀⣵⡀⢠⡿⠋⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢿⣿⣿⠂⠀⠀⠀⠀⠀⢀⣽⣿⣿⣿⣿⣿⣿⣿⣍⠛⠿⣿⣿⣿⣿⣿⣿]],
},
d = {
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠋⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠈⠉⠉⠙⠛⠛⠻⢿⣿⡿⠟⠁⠀⣀⣴⣿⣿⣿⣿⣿⠟",
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠛⣉⣡⠀⣠⣴⣶⣶⣦⠄⣀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⡿⢃⣾",
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⣾⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⣠⣾⡟⢡⣾⣿⣿⣿⡿⢋⣴⣿⡿⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⢡⣾⣿",
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠃⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⣼⣿⡟⣰⣿⣿⣿⣿⠏⣰⣿⣿⠟⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢚⣛⢿",
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠸⣿⠟⢰⣿⣿⣿⣿⠃⣾⣿⣿⠏⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⣾",
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠻⠻⠃⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⢉⣴⣿⣿⣿⣿⡇⠘⣿⣿⠋⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡘⣿",
"⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⣿⣿⣿⣿⠁⢀⣀⠀⢀⣾⣿⣿⣿⣿⣿⣿⠟⠉⠉⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣌",
"⣿⣿⣿⣿⣿⣿⡿⠁⣀⣤⡀⠀⠈⠻⢿⠀⣼⣿⣷⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⣿⣿⣿⠟⠛⠙⠃⠀⣿⣿⣿⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⡿⠿⠿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠁⠀⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿",
"⣿⠟⠁⢀⣴⣶⣶⣾⣿⣿⣿⣿⣶⡐⢦⣄⠀⠀⠈⠛⢿⣿⣿⣿⣿⡀⠀⠀⠀⠀⢀⣼⡿⢛⣩⣴⣶⣶⣶⣶⣶⣶⣭⣙⠻⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿",
"⠁⠀⣴⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣦⡙⠻⣶⣄⡀⠀⠈⠙⢿⣿⣷⣦⣤⣤⣴⣿⡏⣠⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣌⠻⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⣿⠋⣠⠔⠀⠀⠻⣿⣿⣿⣿⢉⡳⢦⣉⠛⢷⣤⣀⠀⠈⠙⠿⣿⣿⣿⣿⢸⣿⡄⠻⣿⣿⠟⡈⣿⣿⣿⣿⣿⢉⣿⣧⢹⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⡇⠠⡇⠀⠀⠀⠀⣿⣿⣿⣿⢸⣿⣷⣤⣙⠢⢌⡛⠷⣤⣄⠀⠈⠙⠿⣿⣿⣿⣿⣷⣦⣴⣾⣿⣤⣙⣛⣛⣥⣾⣿⣿⡌⣿⣿⣿⣷⣤⣀⣀⣀⣠⣴⣿⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⣷⡀⠡⠀⠀⠀⣰⣿⣿⣿⣿⢸⣿⣿⣿⣿⣿⣦⣌⡓⠤⣙⣿⣦⡄⠀⠈⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢡⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⣿⣿⣶⣤⣴⣾⣿⣿⣿⣿⣿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣷⠀⣶⡄⠀⠈⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢃⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⣿⣿⣿⠟⠻⣿⣿⡏⣉⣭⣭⡘⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⣿⡇⢸⡇⢠⡀⠈⠙⠋⠉⠉⠉⠉⠛⠫⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⠛⣿⣿⣀⣀⣾⡿⢀⣿⣿⣿⢻⣷⣦⢈⡙⠻⢿⣿⣿⣿⣿⣿⣿⣿⠀⣿⡇⢸⡇⢸⣿⠀⣦⠀⠀⠶⣶⣦⣀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⠀⢸⣿⣿⣦⣈⡛⠿⠟⣋⣤⣾⣿⣿⣿⣸⣿⣿⢸⡇⢰⡆⢈⡙⠻⢿⣿⣿⣿⠀⢿⡇⢸⡇⢸⣿⢠⣿⡇⣿⡆⢈⡙⠻⠧⠀⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
"⠀⠀⣝⠛⢿⣿⣿⣿⣿⣿⣿⠟⣁⠀⠀⢈⠛⠿⢸⣇⢸⡇⢸⡇⣶⣦⣌⡙⠻⢄⡀⠁⠘⠇⠘⣿⢸⣿⡇⣿⡇⢸⡛⠷⣦⣄⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿",
},
e = {
[[ ____ __ _____ ]],
[[ / __ \/ / / / |]],
[[ / /_/ / / / / /| |]],
[[ / _, _/ /_/ / ___ |]],
[[/_/ |_|\____/_/ |_|]],
},
f = {
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⡤⠤⠤⠤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠞⠋⠁⠀⠀⠀⠀⠀⠀⠀⠉⠛⢦⣤⠶⠦⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⢀⣴⠞⢋⡽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠃⠀⠀⠙⢶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⣰⠟⠁⠀⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡀⠀⠀⠉⠓⠦⣤⣤⣤⣤⣤⣤⣄⣀⠀⠀⠀]],
[[⠀⠀⠀⠀⣠⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣷⡄⠀⠀⢻⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣆⠀]],
[[⠀⠀⣠⠞⠁⠀⠀⣀⣠⣏⡀⠀⢠⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⠿⡃⠀⠀⠀⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡆]],
[[⢀⡞⠁⠀⣠⠶⠛⠉⠉⠉⠙⢦⡸⣿⡿⠀⠀⠀⡄⢀⣀⣀⡶⠀⠀⠀⢀⡄⣀⠀⣢⠟⢦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠃]],
[[⡞⠀⠀⠸⠁⠀⠀⠀⠀⠀⠀⠀⢳⢀⣠⠀⠀⠀⠉⠉⠀⠀⣀⠀⠀⠀⢀⣠⡴⠞⠁⠀⠀⠈⠓⠦⣄⣀⠀⠀⠀⠀⣀⣤⠞⠁⠀]],
[[⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⠀⠁⠀⢀⣀⣀⡴⠋⢻⡉⠙⠾⡟⢿⣅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠙⠛⠉⠉⠀⠀⠀⠀]],
[[⠘⣦⡀⠀⠀⠀⠀⠀⠀⣀⣤⠞⢉⣹⣯⣍⣿⠉⠟⠀⠀⣸⠳⣄⡀⠀⠀⠙⢧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠈⠙⠒⠒⠒⠒⠚⠋⠁⠀⡴⠋⢀⡀⢠⡇⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⢀⡾⠋⢻⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⢸⡀⠸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⢠⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣇⠀⠀⠉⠋⠻⣄⠀⠀⠀⠀⠀⣀⣠⣴⠞⠋⠳⠶⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⠦⢤⠤⠶⠋⠙⠳⣆⣀⣈⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
},
}
return M

View File

@ -1,80 +0,0 @@
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_nvim_lsp.default_capabilities()
-- vim.lsp.set_log_level("DEBUG")
capabilities.workspace = { didChangeWatchedFiles = { dynamicRegistration = false } }
local M = {
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
standalone = true,
checkOnSave = true,
-- rustfmt = {
-- overrideCommand = { "leptosfmt", "--stdin", "--rustfmt" },
-- },
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
buildScripts = {
enable = true,
},
},
files = {
excludeDirs = {
".flatpak-builder",
"_build",
".dart_tool",
".flatpak-builder",
".git",
".gitlab",
".gitlab-ci",
".gradle",
".idea",
".next",
".project",
".scannerwork",
".settings",
".venv",
".direnv",
"archetype-resources",
"bin",
"docs",
"hooks",
"node_modules",
"po",
"screenshots",
"target",
"out",
"examples/node_modules",
},
watcherExclude = {
"**/_build",
"**/.classpath",
"**/.dart_tool",
"**/.factorypath",
"**/.flatpak-builder",
"**/.git/objects/**",
"**/.git/subtree-cache/**",
"**/.idea",
"**/.project",
"**/.scannerwork",
"**/.settings",
"**/.venv",
"**/node_modules",
},
},
},
procMacro = {
enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
},
},
}
return M

View File

@ -1,73 +0,0 @@
return {
tailwindcss = {
-- exclude a filetype from the default_config
filetypes_exclude = { "markdown" },
-- add additional filetypes to the default_config
filetypes_include = { "rust" },
-- to fully override the default_config, change the below
-- filetypes = {}
},
filetypes = {
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir",
"elixir",
"ejs",
"erb",
"eruby",
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"htmlangular",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
"vue",
"svelte",
"templ",
"rust",
},
settings = {
tailwindCSS = {
includeLanguages = {
elixir = "html-eex",
eelixir = "html-eex",
heex = "html-eex",
rust = "html",
},
},
},
}

View File

@ -1,82 +0,0 @@
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_nvim_lsp.default_capabilities()
local lspconfig = require("lspconfig")
local function organize_imports()
local params = {
command = "typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
}
vim.lsp.buf.execute_command(params)
end
local mason_registry = require("mason-registry")
local has_volar, _ = pcall(mason_registry.get_package, "vue-language-server")
-- npm i -g @vue/typescript-plugin
local vue_language_server_path
if has_volar then
-- vue_language_server_path = volar:get_install_path() .. "/node_modules/@vue/language-server"
vue_language_server_path = vim.fn.expand("$MASON/packages/vue-language-server/node_modules/@vue/language-server")
end
local M = {
root_dir = lspconfig.util.root_pattern("package.json"), -- for deno
filetypes = {
"typescript",
"javascript",
"typescript.tsx",
"javascript.jsx",
"javascriptreact",
"typescriptreact",
"vue",
},
settings = {
typescript = {
updateImportsOnFileMove = { enabled = "always" },
suggest = {
completeFunctionCalls = true,
},
inlayHints = {
enumMemberValues = { enabled = true },
functionLikeReturnTypes = { enabled = true },
parameterNames = { enabled = "literals" },
parameterTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
variableTypes = { enabled = false },
},
},
vtsls = {
-- autoUseWorkspaceTsdk = true,
enableMoveToFileCodeAction = true,
autoUseWorkspaceTsdk = true,
experimental = {
completion = {
enableServerSideFuzzyMatch = true,
},
},
tsserver = {
globalPlugins = {
{
name = "@vue/typescript-plugin",
location = vue_language_server_path,
languages = { "vue" },
configNamespace = "typescript",
enableForWorkspaceTypeScriptVersions = true,
},
},
},
},
},
single_file_support = false,
commands = {
OrganizeImports = {
organize_imports,
description = "Organize Imports",
},
},
-- on_attach = on_attach,
capabilities = capabilities,
}
return M

View File

@ -1,232 +0,0 @@
-- 封装设置文件类型的函数
local function set_filetype(patterns, filetype)
local autocmd = vim.api.nvim_create_autocmd
autocmd({ "BufNewFile", "BufRead" }, {
pattern = patterns,
callback = function()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_option(buf, "filetype", filetype)
end,
})
end
-- 设置 markdown 高亮用于 mdx 文件
set_filetype({ "*.mdx" }, "markdown")
-- 设置 env 文件为 sh 类型
set_filetype({ ".env.example", ".env.local", ".env.development", ".env.production" }, "sh")
-- 设置终端相关选项
local autocmd = vim.api.nvim_create_autocmd
autocmd({ "TermOpen" }, {
callback = function()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_option(buf, "relativenumber", false)
vim.api.nvim_buf_set_option(buf, "number", false)
end,
})
-- 解析 .gitignore 文件
local function parse_gitignore()
local gitignore_path = vim.fn.findfile(".gitignore", ".;")
if gitignore_path == "" then
return {}
end
local rules = {}
local file = io.open(gitignore_path, "r")
if file then
for line in file:lines() do
line = line:gsub("^%s*(.-)%s*$", "%1")
if line ~= "" and not line:match("^#") then
table.insert(rules, line)
end
end
file:close()
end
return rules
end
-- 检查文件是否匹配 .gitignore 规则
local function matches_gitignore(file_path, rules)
local path_sep = package.config:sub(1, 1)
for _, rule in ipairs(rules) do
local pattern = "^" .. rule:gsub("%.", "%%."):gsub("%*", ".*"):gsub("%?", ".") .. "$"
if file_path:match(pattern) then
return true
end
-- 处理目录匹配
if rule:sub(-1) == path_sep then
pattern = "^" .. rule:gsub("%.", "%%."):gsub("%*", ".*"):gsub("%?", ".")
if file_path:match(pattern) then
return true
end
end
end
return false
end
-- 自动更新磁盘上更改的文件,可跳过某些目录
local skip_dirs = { "" } -- 手动指定要跳过检测的目录列表
local gitignore_rules = parse_gitignore()
autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
callback = function()
if vim.fn.mode() == "c" or vim.fn.bufexists("[Command Line]") then
return
end
local bufname = vim.api.nvim_buf_get_name(0)
for _, dir in ipairs(skip_dirs) do
if string.find(bufname, dir, 1, true) then
return -- 如果文件在手动跳过的目录中,不进行检测
end
end
if matches_gitignore(bufname, gitignore_rules) then
return -- 如果文件匹配 .gitignore 规则,不进行检测
end
vim.cmd("checktime")
end,
})
-- 文件更改后的通知
autocmd("FileChangedShellPost", {
command = [[echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl None]],
})
-- 用 o 换行不要延续注释
local myAutoGroup = vim.api.nvim_create_augroup("myAutoGroup", {
clear = true,
})
autocmd("BufEnter", {
group = myAutoGroup,
pattern = "*",
callback = function()
vim.opt.formatoptions = vim.opt.formatoptions
- "o" -- O 和 o不延续注释
+ "r" -- 按回车键时延续注释
end,
})
-- 复制文本后高亮显示
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = "*",
})
-- 恢复光标位置
autocmd("BufReadPost", {
pattern = "*",
callback = function()
local line = vim.fn.line("'\"")
local filetype = vim.bo.filetype
if
line > 1
and line <= vim.fn.line("$")
and filetype ~= "commit"
and vim.fn.index({ "xxd", "gitrebase" }, filetype) == -1
then
vim.cmd('normal! g`"')
end
end,
})
-- 函数:获取窗口栏路径
local function get_winbar_path()
return vim.fn.expand("%:.")
end
-- 函数:获取打开缓冲区的数量
local function get_buffer_count()
local buffers = vim.fn.getbufinfo({ buflisted = 1 })
return #buffers
end
-- 函数:获取主机名,添加错误日志
local function get_hostname()
local hostname = vim.fn.systemlist("hostname")
if #hostname > 0 then
return hostname[1]
else
vim.notify("Failed to get hostname", vim.log.levels.ERROR)
return "unknown"
end
end
-- 函数:更新指定缓冲区的窗口栏
local function update_winbar(bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
local old_buf = vim.api.nvim_get_current_buf()
vim.api.nvim_set_current_buf(bufnr)
local home_replaced = get_winbar_path()
if home_replaced == "" then
return
end
-- local buffer_count = get_buffer_count()
local ft = vim.bo.filetype
local hostname = get_hostname()
local winbar
if ft == "NvimTree" then
winbar = "RUA"
else
local winbar_prefix = "%#WinBar1#%m "
local winbar_suffix = "%*%=%#WinBar2#" .. hostname
winbar = winbar_prefix .. "%#WinBar1#" .. home_replaced .. winbar_suffix
end
-- vim.opt.winbar = winbar
-- 检查缓冲区是否支持设置 winbar
if vim.api.nvim_buf_is_valid(bufnr) then
vim.api.nvim_buf_set_option(bufnr, "winbar", winbar)
end
-- 检查 old_buf 是否有效
if vim.api.nvim_buf_is_valid(old_buf) then
vim.api.nvim_set_current_buf(old_buf)
end
end
-- 自动命令:在 BufEnter 和 WinEnter 事件时更新窗口栏
autocmd({ "BufEnter", "WinEnter" }, {
callback = function(args)
update_winbar(args.buf)
end,
})
-- 启动时更新所有现有缓冲区的窗口栏
local all_buffers = vim.api.nvim_list_bufs()
for _, buf in ipairs(all_buffers) do
if vim.api.nvim_buf_is_valid(buf) then
update_winbar(buf)
end
end
-- 大文件检测
local aug = vim.api.nvim_create_augroup("buf_large", { clear = true })
autocmd({ "BufReadPre" }, {
callback = function()
local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())
local ok, stats = pcall(vim.loop.fs_stat, bufname)
local large_file_size = 100 * 1024 -- 100 KB
if ok and stats and stats.size > large_file_size then
vim.b.large_buf = true
vim.opt_local.foldmethod = "manual"
vim.opt_local.spell = false
-- 可以根据文件类型进一步优化
local filetype = vim.bo.filetype
if filetype == "lua" then
-- 例如,对于 Lua 文件禁用某些插件
-- vim.cmd("SomeLuaPluginDisable")
end
else
vim.b.large_buf = false
end
end,
group = aug,
pattern = "*",
})
-- 在 Vim 退出前保存会话
autocmd("VimLeavePre", {
command = ":SessionSave",
})

View File

@ -1,14 +0,0 @@
require("rua.core.options")
require("rua.core.keymaps")
require("rua.core.usercmd")
require("rua.core.autocmd")
if vim.g.neovide then
require("rua.core.neovide")
end
-- To appropriately highlight codefences returned from denols, you will
-- need to augment vim.g.markdown_fenced languages in your init.lua. Example:
vim.g.markdown_fenced_languages = {
"ts=typescript",
}

View File

@ -1,50 +0,0 @@
local map = vim.keymap.set
map("n", "<ESC>", ":nohl<CR>", { desc = "Clear search highlights", silent = true })
-- increment/decrement numbers
-- map("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
-- map("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
-- window management
-- map("n", "<leader>|", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
-- map("n", "<leader>_", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
-- map("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" }) -- make split windows equal width & height
map("n", "<C-j>", "<C-w>j")
map("n", "<C-k>", "<C-w>k")
map("n", "<C-l>", "<C-w>l")
map("n", "<C-h>", "<C-w>h")
-- move lines
map("n", "<A-j>", ":m .+1<CR>==")
map("n", "<A-k>", ":m .-2<CR>==")
map("i", "<A-j>", "<Esc>:m .+1<CR>==gi")
map("i", "<A-k>", "<Esc>:m .-2<CR>==gi")
map("v", "<A-j>", ":m '>+1<CR>gv=gv")
map("v", "<A-k>", ":m '<-2<CR>gv=gv")
map("n", "$", "g_")
map("v", "$", "g_")
map("v", ">", ">gv")
map("v", "<", "<gv")
-- terminal
map("t", "<C-x>", "<c-\\><c-n>")
map("n", "<leader>tt", ":term<CR>", { desc = "Open new terminal" })
-- buffers
map("n", "<S-l>", "<CMD>bn<CR>")
map("n", "<S-h>", "<CMD>bp<CR>")
map("n", "<leader>x", "<CMD>bd<CR>")
map("n", "<C-s>", "<CMD>w<CR>")
map("n", "<leader>la", "<CMD>%bd|e#|bd#<CR>")
-- tabs
map("n", "<leader>tc", ":tabclose<CR>", { desc = "Close current tab" })
map("n", "<leader>tn", ":tabnew<CR>", { desc = "New tab" })
-- search
map("v", "<leader>ss", ":s/\\%V", { desc = "Search and replace in visual selection" })
-- copy
map({ "n", "v" }, "y", '"+y', { desc = "Copy to system clipboard" })

View File

@ -1,39 +0,0 @@
local opt = vim.opt
local function set_ime(args)
if args.event:match("Enter$") then
vim.g.neovide_input_ime = true
else
vim.g.neovide_input_ime = false
end
end
local ime_input = vim.api.nvim_create_augroup("ime_input", { clear = true })
vim.api.nvim_create_autocmd({ "InsertEnter", "InsertLeave" }, {
group = ime_input,
pattern = "*",
callback = set_ime,
})
vim.api.nvim_create_autocmd({ "CmdlineEnter", "CmdlineLeave" }, {
group = ime_input,
pattern = "[/\\?]",
callback = set_ime,
})
opt.guifont = "JetBrainsMono Nerd Font:h16"
-- g:neovide_transparency should be 0 if you want to unify transparency of content and title bar.
-- vim.g.neovide_transparency = 0.91
-- vim.g.neovide_background_color = "#0f1117" .. alpha()
vim.g.transparency = 0.91
vim.g.neovide_window_blurred = true
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
vim.g.neovide_hide_mouse_when_typing = true
vim.g.neovide_refresh_rate = 120
vim.g.neovide_confirm_quit = true
-- vim.g.neovide_input_macos_alt_is_meta = true
vim.g.neovide_scroll_animation_length = 0.1
vim.g.neovide_cursor_animation_length = 0.08
vim.g.neovide_cursor_trail_size = 0

View File

@ -1,103 +0,0 @@
-- 获取 vim.opt 引用,方便后续使用
local opt = vim.opt
-- 设置全局变量
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
vim.g.dap_virtual_text = true
vim.g.trouble_lualine = true
-- 修复 Markdown 缩进设置
vim.g.markdown_recommended_style = 0
-- 隐藏弃用警告
vim.g.deprecation_warnings = false
-- 定义调试相关的符号
vim.fn.sign_define("DapBreakpoint", { text = "", numhl = "DapBreakpoint", texthl = "DapBreakpoint" })
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" }
)
-- 设置光标行选项
vim.o.cursorlineopt = "number,line"
-- 设置基本选项
opt.termguicolors = true -- 启用真彩色支持
opt.foldmethod = "expr" -- 使用表达式进行折叠
opt.foldexpr = "nvim_treesitter#foldexpr()" -- 使用 Treesitter 折叠表达式
opt.foldlevel = 20 -- 初始折叠级别
opt.ignorecase = true -- 忽略大小写
opt.wildignore:append({ "*/node_modules/*" }) -- 忽略 node_modules 目录
-- 可选设置
-- opt.clipboard:append({ "unnamedplus" })
-- opt.iskeyword:append("-")
-- 自动缩进和滚动设置
opt.autoindent = true -- 自动缩进
opt.scrolloff = 3 -- 滚动时保留的行数
opt.encoding = "utf8" -- 文件编码为 UTF-8
opt.fileencoding = "utf8"
opt.cursorline = true -- 高亮当前行
opt.autowrite = true -- 自动保存
opt.autoread = true -- 自动读取文件更改
-- 根据是否在 SSH 会话中设置剪贴板选项
if not vim.env.SSH_TTY then
opt.clipboard = "unnamedplus" -- 同步系统剪贴板
end
-- 其他选项设置
opt.completeopt = "menu,menuone,noselect" -- 补全选项
opt.conceallevel = 2 -- 隐藏 * 标记用于粗体和斜体,但不隐藏带有替换的标记
opt.confirm = true -- 退出修改过的缓冲区时确认保存
opt.expandtab = true -- 使用空格代替制表符
opt.fillchars = {
foldopen = "",
foldclose = "",
fold = " ",
foldsep = " ",
diff = "",
eob = " ",
}
opt.foldlevel = 99 -- 折叠级别
opt.formatoptions = "jcroqlnt" -- 格式化选项
opt.grepformat = "%f:%l:%c:%m" -- 搜索结果格式
opt.grepprg = "rg --vimgrep" -- 搜索命令
opt.inccommand = "nosplit" -- 预览增量替换
opt.jumpoptions = "view" -- 跳转选项
opt.laststatus = 3 -- 全局状态栏
opt.linebreak = true -- 在合适的位置换行
-- opt.list = true -- 显示一些不可见字符(如制表符等)
opt.mouse = "a" -- 启用鼠标模式
opt.number = true -- 显示行号
opt.pumblend = 10 -- 弹出菜单透明度
opt.pumheight = 10 -- 弹出菜单最大条目数
opt.relativenumber = true -- 显示相对行号
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
opt.shiftround = true -- 缩进取整
opt.shiftwidth = 2 -- 缩进大小
opt.shortmess:append({ W = true, I = true, c = true, C = true })
opt.showmode = false -- 不显示模式,因为有状态栏
opt.sidescrolloff = 8 -- 水平滚动时保留的列数
opt.signcolumn = "yes" -- 始终显示符号列
opt.smartcase = true -- 包含大写字母时不忽略大小写
opt.smartindent = true -- 自动插入缩进
opt.spelllang = { "en" } -- 拼写检查语言
opt.spelloptions:append("noplainbuffer")
opt.splitbelow = true -- 新窗口在当前窗口下方打开
opt.splitkeep = "screen"
opt.splitright = true -- 新窗口在当前窗口右侧打开
opt.tabstop = 2 -- 制表符宽度
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- 快速触发 which-key
opt.undofile = true -- 启用撤销文件
opt.undolevels = 10000 -- 撤销级别
opt.updatetime = 200 -- 保存交换文件并触发 CursorHold
opt.virtualedit = "block" -- 允许光标在视觉块模式下移动到无文本处
opt.wildmode = "longest:full,full" -- 命令行补全模式
opt.winminwidth = 5 -- 最小窗口宽度
opt.wrap = false -- 禁用换行

View File

@ -1,135 +0,0 @@
local user_command = vim.api.nvim_create_user_command
-- 定义 Difft 命令
user_command("Difft", function()
vim.cmd("windo diffthis")
end, {
desc = "windo Diffthis",
})
-- 定义 Diffo 命令
user_command("Diffo", function()
vim.cmd("windo diffoff")
end, {
desc = "windo Diffoff",
})
-- 处理格式化相关命令的辅助函数
local function toggle_formatting(disable_buffer_only, notify)
if disable_buffer_only then
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
if notify then
vim.notify("autoformat disabled")
end
end
local function enable_formatting()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end
-- 定义 FormatDisable 命令
user_command("FormatDisable", function(args)
toggle_formatting(args.bang, args.bang)
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
-- 定义 FormatEnable 命令
user_command("FormatEnable", enable_formatting, {
desc = "Re-enable autoformat-on-save",
})
-- 定义 FormatToggle 命令
user_command("FormatToggle", function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
vim.g.disable_autoformat = not vim.g.disable_autoformat
if vim.g.disable_autoformat then
vim.notify("autoformat disabled")
else
vim.notify("autoformat enabled")
end
end, {
desc = "Toggle autoformat-on-save",
})
-- mason install command
-- create install all command
local ensure_installed = {
-- LSP servers
lsp_servers = {
"gopls",
"lua-language-server",
"rust-analyzer",
"html-lsp",
"vue-language-server", -- vue
"vtsls", -- typescript
"tailwindcss-language-server",
"eslint-lsp",
"css-lsp",
"cssmodules-language-server",
"json-lsp",
"yaml-language-server",
"docker-compose-language-service",
"dockerfile-language-server",
"bash-language-server",
"clangd",
"lemminx", -- xml svg
"deno",
"biome", -- formatter
},
-- Formatters
formatters = {
"prettierd", -- prettier formatter
"stylua", -- lua formatter
"isort", -- python formatter
-- "black", -- python formatter
-- "shfmt",
"goimports",
"gofumpt",
"golines",
"clang-format",
"taplo", -- toml
},
-- Linters
linters = {
"pylint",
},
-- Tools
tools = {
"gomodifytags",
"impl", -- go
"delve", -- golang debug adapter
},
}
-- 扁平化 ensure_installed 列表
local flattened_ensure_installed = {}
for _, group in pairs(ensure_installed) do
for _, tool in ipairs(group) do
table.insert(flattened_ensure_installed, tool)
end
end
-- Create user command to synchronously install all Mason tools in `opts.ensure_installed`.
vim.api.nvim_create_user_command("MasonInstallAll", function()
-- 使用 pcall 引入 mason-registry
local success, registry = pcall(require, "mason-registry")
if not success then
vim.notify("Failed to load mason-registry: " .. registry, vim.log.levels.ERROR)
return
end
for _, tool in ipairs(flattened_ensure_installed) do
local pkg = registry.get_package(tool)
if not pkg:is_installed() then
vim.cmd("MasonInstall " .. tool)
else
vim.notify(tool .. " is already installed", vim.log.levels.INFO)
end
end
end, {})

View File

@ -1,29 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ import = "rua.plugins" },
{ import = "rua.plugins.lsp" },
{ import = "rua.plugins.lang" },
}, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
defaults = {
lazy = true,
},
})

View File

@ -1,79 +0,0 @@
local leader = "SPC"
local if_nil = vim.F.if_nil
--- @param sc string
--- @param txt string
--- @param keybind string? optional
--- @param keybind_opts table? optional
local function button(sc, txt, keybind, keybind_opts)
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>")
local opts = {
position = "center",
shortcut = sc,
cursor = 3,
width = 40,
align_shortcut = "right",
hl_shortcut = "Keyword",
}
if keybind then
keybind_opts = if_nil(keybind_opts, { noremap = true, silent = true, nowait = true })
opts.keymap = { "n", sc_, keybind, keybind_opts }
end
local function on_press()
local key = vim.api.nvim_replace_termcodes(keybind or sc_ .. "<Ignore>", true, false, true)
vim.api.nvim_feedkeys(key, "t", false)
end
return {
type = "button",
val = txt,
on_press = on_press,
opts = opts,
}
end
return {
"goolord/alpha-nvim",
event = "VimEnter",
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
local logo = require("rua.config.logos")
dashboard.section.header.val = logo.c
dashboard.section.buttons.val = {
button("SPC l", "💤 > Lazy", "<cmd>Lazy<CR>"),
button("SPC e", " > Nvim Tree", "<cmd>NvimTreeToggle<CR>"),
button("SPC m", "󰱼 > Mason", "<cmd>Mason<CR>"),
-- button("SPC fw", " > Find Word", "<cmd>Telescope live_grep<CR>"),
button("SPC wr", "󰁯 > Restore Session", "<cmd>SessionRestore<CR>"),
button("q", " > Quit", "<cmd>qa<CR>"),
}
dashboard.opts.layout[1].val = 8
-- Send config to alpha
alpha.setup(dashboard.opts)
-- Disable folding on alpha buffer
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
vim.api.nvim_create_autocmd("User", {
once = true,
pattern = "LazyVimStarted",
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded "
.. stats.loaded
.. "/"
.. stats.count
.. " plugins in "
.. ms
.. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
}

View File

@ -1,20 +0,0 @@
return {
"rmagatti/auto-session",
lazy = true,
cmd = {
"SessionSave",
"SessionRestore",
},
-- event = "VeryLazy",
-- dependencies = {
-- "nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
-- },
---enables autocomplete for opts
---@module "auto-session"
---@type AutoSession.Config
opts = {
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
auto_restore = false,
-- log_level = 'debug',
},
}

View File

@ -1,28 +0,0 @@
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {},
},
{
"windwp/nvim-ts-autotag",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("nvim-ts-autotag").setup({})
end,
},
{
"kylechui/nvim-surround",
version = "*",
event = "BufReadPre",
config = function()
require("nvim-surround").setup({})
end,
},
{
"folke/ts-comments.nvim",
opts = {},
event = "BufReadPost",
enabled = vim.fn.has("nvim-0.10.0") == 1,
},
}

View File

@ -1,93 +0,0 @@
return {
"yetone/avante.nvim",
-- event = "VeryLazy",
lazy = true,
version = false, -- Never set this value to "*"! Never!
keys = {
"<leader>aa",
"<leader>at",
"<leader>ar",
"<leader>af",
},
cmd = {
"AvanteAsk",
"AvanteBuild",
"AvanteChat",
"AvanteClear",
"AvanteEdit",
"AvanteFocus",
"AvanteRefresh",
"AvanteStop",
"AvanteSwitchProvider",
"AvanteShowRepoMap",
"AvanteToggle",
"AvanteModels",
},
opts = {
provider = "deepseek",
vendors = {
deepseek = {
__inherited_from = "openai",
api_key_name = "DEEPSEEK_API_KEY",
endpoint = "https://api.deepseek.com",
model = "deepseek-coder",
max_tokens = 8192,
},
bbt_ds = {
__inherited_from = "openai",
api_key_name = "BBT_API_KEY",
endpoint = "https://babeltower.pro/v1",
model = "deepseek-v3:bbt",
max_tokens = 8192,
},
bbt_claude = {
__inherited_from = "openai",
api_key_name = "BBT_API_KEY",
endpoint = "https://babeltower.pro/v1",
model = "claude-3-7-sonnet:claude",
max_tokens = 8192,
},
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
-- "echasnovski/mini.pick", -- for file_selector provider mini.pick
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
-- "zbirenbaum/copilot.lua", -- for providers='copilot'
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
-- event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}

View File

@ -1,246 +0,0 @@
local init_lackluster_icons = function()
-- local lackluster = require("lackluster")
require("nvim-web-devicons").setup({
color_icons = false,
override = {
["default_icon"] = {
-- color = lackluster.color.gray4,
color = "#444444",
name = "Default",
},
},
})
end
local init_lackluster = function()
require("ex-colors").setup({
-- included_patterns = require("ex-colors.presets").recommended.included_patterns + {
-- "^Cmp%u", -- hrsh7th/nvim-cmp
-- '^GitSigns%u', -- lewis6991/gitsigns.nvim
-- '^RainbowDelimiter%u', -- HiPhish/rainbow-delimiters.nvim
-- },
autocmd_patterns = {
CmdlineEnter = {
["*"] = {
"^debug%u",
"^health%u",
},
},
-- FileType = {
-- ['Telescope*'] = {
-- '^Telescope%u', -- nvim-telescope/telescope.nvim
-- },
-- },
},
})
require("lackluster").setup({
tweak_syntax = {
string = "default",
string_escape = "default",
comment = "#3b3b3b",
builtin = "default", -- builtin modules and functions
type = "default",
keyword = "default",
keyword_return = "default",
keyword_exception = "default",
},
tweak_background = {
normal = "none",
},
})
-- vim.cmd.colorscheme("lackluster")
-- vim.cmd.colorscheme("lackluster-hack")
-- vim.cmd.colorscheme("lackluster-mint")
end
return {
-- {
-- "catppuccin/nvim",
-- name = "catppuccin",
-- -- priority = 1000,
-- -- lazy = true,
-- config = function()
-- require("catppuccin").setup({
-- flavour = "macchiato", -- latte, frappe, macchiato, mocha
-- background = { -- :h background
-- light = "latte",
-- dark = "mocha",
-- },
-- transparent_background = true, -- disables setting the background color.
-- show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
-- term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
-- dim_inactive = {
-- enabled = false, -- dims the background color of inactive window
-- shade = "dark",
-- percentage = 0.15, -- percentage of the shade to apply to the inactive window
-- },
-- no_italic = false, -- Force no italic
-- no_bold = false, -- Force no bold
-- no_underline = false, -- Force no underline
-- styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
-- comments = { "italic" }, -- Change the style of comments
-- conditionals = { "italic" },
-- loops = {},
-- functions = {},
-- keywords = {},
-- strings = {},
-- variables = {},
-- numbers = {},
-- booleans = {},
-- properties = {},
-- types = {},
-- operators = {},
-- -- miscs = {}, -- Uncomment to turn off hard-coded styles
-- },
-- color_overrides = {
-- rosewater = "#f4dbd6",
-- flamingo = "#f0c6c6",
-- pink = "#f5bde6",
-- mauve = "#B9AEE6",
-- red = "#A87692",
-- maroon = "#FD9491",
-- peach = "#f5a97f",
-- yellow = "#FCD0A1",
-- green = "#809FA1",
-- teal = "#8bd5ca",
-- sky = "#91d7e3",
-- sapphire = "#7dc4e4",
-- blue = "#91B8E9",
-- lavender = "#b7bdf8",
-- text = "#DAD0E9",
-- subtext1 = "#b8c0e0",
-- subtext0 = "#a5adcb",
-- overlay2 = "#939ab7",
-- overlay1 = "#8087a2",
-- overlay0 = "#6e738d",
-- surface2 = "#5b6078",
-- surface1 = "#494d64",
-- surface0 = "#363a4f",
-- base = "#24273a",
-- mantle = "#1e2030",
-- crust = "#181926",
-- },
-- custom_highlights = {},
-- default_integrations = true,
-- integrations = {
-- cmp = true,
-- gitsigns = true,
-- nvimtree = true,
-- treesitter = true,
-- alpha = true,
-- mini = {
-- enabled = true,
-- indentscope_color = "",
-- },
-- mason = true,
-- markdown = true,
-- dap = true,
-- dap_ui = true,
-- which_key = false,
-- native_lsp = {
-- enabled = true,
-- virtual_text = {
-- errors = { "italic" },
-- hints = { "italic" },
-- warnings = { "italic" },
-- information = { "italic" },
-- ok = { "italic" },
-- },
-- underlines = {
-- errors = { "underline" },
-- hints = { "underline" },
-- warnings = { "underline" },
-- information = { "underline" },
-- ok = { "underline" },
-- },
-- inlay_hints = {
-- background = true,
-- },
-- },
-- telescope = {
-- enabled = true,
-- -- style = "nvchad"
-- },
-- -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
-- },
-- })
-- -- vim.cmd.colorscheme("catppuccin")
-- end,
-- },
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
event = "VimEnter",
config = function()
local lualine = require("lualine")
-- configure lualine with modified theme
lualine.setup({
options = {
-- theme = "catppuccin",
-- theme = "lackluster",
-- theme = "rei",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
extensions = { "quickfix", "trouble", "mason", "lazy", "nvim-tree" },
sections = {
lualine_x = {
{ "encoding" },
{ "fileformat" },
{ "filetype" },
},
-- lualine_y = {
-- { "progress", color = { bg = "#de9aa3", fg = "#000000" } },
-- },
-- lualine_z = {
-- { "location", color = { bg = "#eac8c7" } },
-- },
},
})
end,
},
{
"aileot/ex-colors.nvim",
lazy = true,
cmd = "ExColors",
---@type ExColors.Config
opts = {},
},
{
"nvim-tree/nvim-web-devicons",
lazy = true,
init = init_lackluster_icons,
},
{
"slugbyte/lackluster.nvim",
lazy = true,
-- priority = 1000,
-- init = init_lackluster,
},
-- {
-- -- "wheat-thin-wiens/rei.nvim",
-- "DefectingCat/rei.nvim",
-- priority = 1000,
-- -- lazy = true,
-- config = function()
-- require("rei").setup({
-- styles = {
-- comments = { italic = true },
-- keywords = {},
-- identifiers = {},
-- functions = { italic = true, bold = true },
-- variables = {},
-- booleans = {},
-- loops = { italic = true },
-- },
-- integrations = {
-- telescope = "borderless", -- 'borderless' theme also available, leave as true for default theme
-- },
-- transparency = true, -- Enables / Disables background transparency
-- terminal_colors = true,
-- highlight_overrides = {},
-- })
-- -- vim.cmd.colorscheme("rei")
-- end,
-- },
}

View File

@ -1,91 +0,0 @@
---@param config {args?:string[]|fun():string[]?}
local function get_args(config)
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
config = vim.deepcopy(config)
---@cast args string[]
config.args = function()
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
return vim.split(vim.fn.expand(new_args) --[[@as string]], " ")
end
return config
end
return {
{
"mfussenegger/nvim-dap",
recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
dependencies = {
"rcarriga/nvim-dap-ui",
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
},
config = function()
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
-- setup dap config by VsCode launch.json file
local vscode = require("dap.ext.vscode")
local json = require("plenary.json")
vscode.json_decode = function(str)
return vim.json.decode(json.json_strip_comments(str))
end
-- Extends dap.configurations with entries read from .vscode/launch.json
if vim.fn.filereadable(".vscode/launch.json") then
vscode.load_launchjs()
end
end,
-- stylua: ignore
keys = {
-- { "<leader>d", "", desc = "+debug", mode = {"n", "v"} },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
},
-- fancy UI for the debugger
{
"rcarriga/nvim-dap-ui",
dependencies = { "nvim-neotest/nvim-nio" },
-- stylua: ignore
keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
}

View File

@ -1,149 +0,0 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
sql = { "sqlfluff" },
lua = { "stylua" },
go = { "goimports", "gofumpt" },
sh = { "shfmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
javascriptreact = { "prettierd" },
typescriptreact = { "prettierd" },
svelte = { "prettierd" },
css = { "prettierd" },
less = { "prettierd" },
scss = { "prettierd" },
html = { "prettierd" },
json = { "prettierd" },
yaml = { "prettierd" },
["markdown"] = { "prettierd" },
["markdown.mdx"] = { "prettierd" },
graphql = { "prettierd" },
python = { "isort", "black" },
php = { "intelephense" },
c = { "clang-format" },
rust = { "rustfmt", lsp_format = "fallback" },
toml = { "taplo" },
-- 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" },
},
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 1000, lsp_fallback = true }
end,
-- 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 = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return { lsp_fallback = false }
end
return { lsp_fallback = true }
end,
notify_on_error = true,
lang_to_ext = {
bash = "sh",
sql = "sql",
c_sharp = "cs",
elixir = "exs",
latex = "tex",
markdown = "md",
python = "py",
ruby = "rb",
teal = "tl",
},
options = {
-- Use a specific prettierd parser for a filetype
-- Otherwise, prettierd 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 prettierd parser for a file extension
ext_parsers = {
-- qmd = "markdown",
},
},
formatters = {
injected = {
options = {
ignore_errors = true,
lang_to_formatters = {
sql = { "sqlfluff" },
},
lang_to_ext = {
sql = "sql",
},
},
},
sqlfluff = {
command = "sqlfluff",
args = {
"fix",
"--dialect",
"sqlite",
"--disable-progress-bar",
"-f",
"-n",
"-",
},
stdin = true,
},
rustfmt = {
options = {
-- The default edition of Rust to use when no Cargo.toml file is found
default_edition = "2021",
},
},
-- # 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" },
-- },
},
})
vim.keymap.set({ "n", "v" }, "<leader>fm", function()
conform.format({
lsp_fallback = true,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
vim.keymap.set("n", "<leader>tf", "<cmd> FormatToggle <cr>", { desc = "Re-enable autoformat-on-save" })
end,
}

View File

@ -1,101 +0,0 @@
return {
{
"sindrets/diffview.nvim",
keys = {
{ "<leader>gd", "<cmd> DiffviewOpen <CR>", desc = "Open diff view" },
},
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,
},
},
},
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration
"nvim-telescope/telescope.nvim", -- optional
},
keys = {
{ "<leader>gg", "<cmd> Neogit <CR>", desc = "Open Neogit" },
{ "<leader>gh", "<cmd> DiffviewFileHistory % <CR>", desc = "Open current file history" },
{ "<leader>gc", "<cmd> DiffviewClose <CR>", desc = "Close Diffview" },
},
opts = {
console_timeout = 10000,
},
},
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
cond = function()
return vim.fn.isdirectory(".git") == 1
end,
opts = {
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
end
-- Navigation
map("n", "]h", gs.next_hunk, "Next Hunk")
map("n", "[h", gs.prev_hunk, "Prev Hunk")
-- Actions
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Stage hunk")
map("v", "<leader>hr", function()
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Reset hunk")
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
map("n", "<leader>hb", function()
gs.blame_line({ full = true })
end, "Blame line")
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
map("n", "<leader>hd", gs.diffthis, "Diff this")
map("n", "<leader>hD", function()
gs.diffthis("~")
end, "Diff this ~")
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
map("n", "<leader>gi", ":Gitsigns<CR>", "Gitsigns")
end,
preview_config = {
border = "solid",
},
},
},
}

View File

@ -1,38 +0,0 @@
return {
"phaazon/hop.nvim",
branch = "v2",
keys = {
{
"f",
function()
local hop = require("hop")
local directions = require("hop.hint").HintDirection
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false })
end,
desc = "Hop motion search in current line after cursor",
mode = { "n", "v" },
},
{
"F",
function()
local hop = require("hop")
local directions = require("hop.hint").HintDirection
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false })
end,
desc = "Hop motion search in current line before cursor",
mode = { "n", "v" },
},
{
"<leader><leader>",
function()
local hop = require("hop")
hop.hint_words({ current_line_only = false })
end,
desc = "Hop motion search words after cursor",
mode = { "n", "v" },
},
},
opts = {
keys = "etovxqpdygfblzhckisuran",
},
}

View File

@ -1,3 +0,0 @@
return {
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
}

View File

@ -1,7 +0,0 @@
return {
{
"leoluz/nvim-dap-go",
ft = "go",
opts = {},
},
}

View File

@ -1,3 +0,0 @@
return {
{ "b0o/schemastore.nvim", version = false }, -- json schema store
}

View File

@ -1,58 +0,0 @@
return {
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = function()
require("lazy").load({ plugins = { "markdown-preview.nvim" } })
vim.fn["mkdp#util#install"]()
end,
keys = {
{
"<leader>cp",
ft = "markdown",
"<cmd>MarkdownPreviewToggle<cr>",
desc = "Markdown Preview",
},
},
config = function()
vim.cmd([[do FileType]])
end,
},
-- {
-- "OXY2DEV/markview.nvim",
-- ft = "markdown",
-- },
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "norg", "rmd", "org" },
code = {
sign = false,
width = "block",
right_pad = 1,
},
heading = {
sign = false,
icons = {},
},
},
ft = { "markdown", "norg", "rmd", "org" },
config = function(_, opts)
require("render-markdown").setup(opts)
-- LazyVim.toggle.map("<leader>um", {
-- name = "Render Markdown",
-- get = function()
-- return require("render-markdown.state").enabled
-- end,
-- set = function(enabled)
-- local m = require("render-markdown")
-- if enabled then
-- m.enable()
-- else
-- m.disable()
-- end
-- end,
-- })
end,
},
}

View File

@ -1,69 +0,0 @@
local rok, rust_settings = pcall(require, "rua.config.rust-analyzer")
if not rok then
return {}
else
return {
{
"Saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
keys = {
{
"<leader>cu",
function()
require("crates").upgrade_all_crates()
end,
desc = "Update crates",
},
},
opts = {
completion = {
cmp = { enabled = true },
},
},
},
{
"mrcjkb/rustaceanvim",
version = "^6", -- Recommended
ft = { "rust" },
opts = {
server = {
on_attach = function(_, bufnr)
local map = vim.keymap.set
local opts = { buffer = bufnr, silent = true }
map("n", "<leader>ca", function()
vim.cmd.RustLsp("codeAction")
end, { desc = "Code Action", buffer = bufnr })
map("n", "<leader>da", function()
vim.cmd.RustLsp("debuggables")
end, { desc = "Rust Debuggables", buffer = bufnr })
map("n", "gh", function()
vim.cmd.RustLsp({ "hover", "actions" })
end, { silent = true, buffer = bufnr })
opts.desc = "Show LSP references"
map("n", "gr", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = "Go to declaration"
map("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
map("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
map("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = "Show LSP type definitions"
map("n", "<leader>gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
end,
default_settings = rust_settings.settings,
},
},
config = function(_, opts)
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
if vim.fn.executable("rust-analyzer") == 0 then
print("**rust-analyzer** not found in PATH, please install it.\nhttps://rust-analyzer.github.io/")
-- LazyVim.error(
-- "**rust-analyzer** not found in PATH, please install it.\nhttps://rust-analyzer.github.io/",
-- { title = "rustaceanvim" }
-- )
end
end,
},
}
end

View File

@ -1,334 +0,0 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" },
-- { "antosha417/nvim-lsp-file-operations", config = true },
-- { "folke/neodev.nvim", opts = {} },
"mason-org/mason-lspconfig.nvim",
},
event = "VeryLazy",
opts = { document_highlight = { enabled = false } },
config = function()
local lspconfig = require("lspconfig")
local mason_lspconfig = require("mason-lspconfig")
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
local map = vim.keymap.set -- for conciseness
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local opts = { buffer = ev.buf, silent = true }
opts.desc = "Show LSP references"
map("n", "gr", function()
require("telescope.builtin").lsp_references()
end, opts) -- show definition, references
opts.desc = "Go to declaration"
map("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
-- map("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
-- map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts) -- show lsp definitions
map("n", "gd", function()
require("telescope.builtin").lsp_definitions()
end, opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
-- map("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
map("n", "gi", function()
require("telescope.builtin").lsp_implementations()
end, opts) -- show lsp implementations
opts.desc = "Show LSP type definitions"
-- map("n", "<leader>gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
map("n", "<leader>gt", function()
require("telescope.builtin").lsp_type_definitions()
end, opts) -- show lsp type definitions
opts.desc = "See available code actions"
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "Smart rename"
map("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Show buffer diagnostics"
-- map("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
map("n", "<leader>D", function()
require("telescope.builtin").diagnostics()
end, opts) -- show diagnostics for file
-- opts.desc = "Show line diagnostics"
-- map("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Go to previous diagnostic"
map("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
opts.desc = "Go to next diagnostic"
map("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor"
opts.silent = true
map("n", "gh", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = "Restart LSP"
map("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end,
})
-- local capabilities = cmp_nvim_lsp.default_capabilities()
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
mason_lspconfig.setup({
automatic_enable = {
exclude = {
"biome",
"dockerls",
"tailwindcss",
"rust_analyzer",
"taplo",
"denols",
"vtsls",
"jsonls",
"lua_ls",
},
},
})
vim.lsp.enable("biome")
vim.lsp.config("biome", {
settings = {
cmd = { "biome", "lsp-proxy" },
filetypes = {
"astro",
"css",
"graphql",
"javascript",
"javascriptreact",
"json",
"jsonc",
"svelte",
"typescript",
"typescript.tsx",
"typescriptreact",
"vue",
"markdown",
},
single_file_support = true,
},
})
vim.lsp.enable("dockerls")
vim.lsp.config("dockerls", {
settings = {
docker = {
languageserver = {
formatter = {
ignoreMultilineInstructions = true,
},
},
},
},
})
vim.lsp.enable("tailwindcss")
vim.lsp.config("tailwindcss", {
settings = require("rua.config.tailwindcss"),
})
-- vim.lsp.config("rust_analyzer", {})
vim.lsp.enable("taplo")
vim.lsp.config("taplo", {
settings = {
keys = {
{
"gh",
function()
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
require("crates").show_popup()
else
vim.lsp.buf.hover()
end
end,
desc = "Show Crate Documentation",
},
},
},
})
vim.lsp.enable("denols")
vim.lsp.config("denols", {
settings = {
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
},
})
local vtsls_settings = require("rua.config.vtsls")
vim.lsp.enable("vtsls")
vim.lsp.config("vtsls", vtsls_settings)
vim.lsp.enable("jsonls")
vim.lsp.config("jsonls", {
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
end,
})
vim.lsp.enable("lua_ls")
vim.lsp.config("lua_ls", {
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
completion = {
callSnippet = "Replace",
},
},
Luau = {
diagnostics = {
globals = { "vim" },
},
completion = {
callSnippet = "Replace",
},
},
},
})
-- Nvim 0.11+ (see vim.lsp.config)
-- vim.lsp.config('rust_analyzer', {
-- -- Server-specific settings. See `:help lsp-quickstart`
-- settings = {
-- ['rust-analyzer'] = {},
-- },
-- })
-- Nvim 0.10 (legacy, not supported)
-- local lspconfig = require('lspconfig')
-- lspconfig.rust_analyzer.setup {
-- -- Server-specific settings. See `:help lspconfig-setup`
-- settings = {
-- ['rust-analyzer'] = {},
-- },
-- }
-- mason_lspconfig.setup_handlers({
-- -- default handler for installed servers
-- function(server_name)
-- lspconfig[server_name].setup({
-- capabilities = capabilities,
-- })
-- end,
-- ["biome"] = function()
-- lspconfig["biome"].setup({
-- capabilities = capabilities,
-- settings = {
-- cmd = { "biome", "lsp-proxy" },
-- filetypes = {
-- "astro",
-- "css",
-- "graphql",
-- "javascript",
-- "javascriptreact",
-- "json",
-- "jsonc",
-- "svelte",
-- "typescript",
-- "typescript.tsx",
-- "typescriptreact",
-- "vue",
-- "markdown",
-- },
-- single_file_support = true,
-- },
-- })
-- end,
-- ["dockerls"] = function()
-- lspconfig["dockerls"].setup({
-- settings = {
-- docker = {
-- languageserver = {
-- formatter = {
-- ignoreMultilineInstructions = true,
-- },
-- },
-- },
-- },
-- })
-- end,
-- ["tailwindcss"] = function()
-- lspconfig["tailwindcss"].setup(require("rua.config.tailwindcss"))
-- end,
-- ["rust_analyzer"] = function()
-- -- lspconfig["rust_analyzer"].setup(require("rua.config.rust-analyzer"))
-- end,
-- ["taplo"] = function()
-- lspconfig["taplo"].setup({
-- keys = {
-- {
-- "gh",
-- function()
-- if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
-- require("crates").show_popup()
-- else
-- vim.lsp.buf.hover()
-- end
-- end,
-- desc = "Show Crate Documentation",
-- },
-- },
-- })
-- end,
-- ["denols"] = function()
-- lspconfig["denols"].setup({
-- -- on_attach = on_attach,
-- capabilities = capabilities,
-- root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
-- })
-- end,
-- ["vtsls"] = function()
-- lspconfig["vtsls"].setup(require("rua.config.vtsls"))
-- map("n", "<leader>co", "<cmd> OrganizeImports <CR>", { desc = "Organize imports" })
-- end,
-- ["jsonls"] = function()
-- lspconfig["jsonls"].setup({
-- -- lazy-load schemastore when needed
-- on_new_config = function(new_config)
-- new_config.settings.json.schemas = new_config.settings.json.schemas or {}
-- vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
-- end,
-- settings = {
-- json = {
-- format = {
-- enable = true,
-- },
-- validate = { enable = true },
-- },
-- },
-- })
-- end,
-- ["lua_ls"] = function()
-- lspconfig["lua_ls"].setup({
-- capabilities = capabilities,
-- settings = {
-- Lua = {
-- diagnostics = {
-- globals = { "vim" },
-- },
-- completion = {
-- callSnippet = "Replace",
-- },
-- },
-- },
-- })
-- end,
-- })
end,
},
}

View File

@ -1,31 +0,0 @@
return {
{
"mason-org/mason.nvim",
-- event = "VeryLazy",
cmd = {
"Mason",
"MasonUpdate",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
},
config = function()
local mason = require("mason")
-- enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
end,
},
{
"mason-org/mason-registry",
},
}

View File

@ -1,84 +0,0 @@
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{ "petertriho/cmp-git", opts = {} }, -- source for git
{
"L3MON4D3/LuaSnip", -- snippet
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} }, -- tailwind css
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
-- cmp formatting.format
local format_kinds = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
})
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
-- ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
-- ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<C-d>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = "crates" }, -- rust crates
{ name = "git" },
}),
---@diagnostic disable-next-line: missing-fields
formatting = {
format = function(entry, item)
format_kinds(entry, item) -- add icons
return require("tailwindcss-colorizer-cmp").formatter(entry, item)
end,
},
})
end,
},
{
"supermaven-inc/supermaven-nvim",
event = "BufReadPost",
config = function()
local platform = vim.loop.os_uname().sysname
if platform == "FreeBSD" then
return
end
require("supermaven-nvim").setup({})
end,
},
}

View File

@ -1,67 +0,0 @@
return {
"nvim-tree/nvim-tree.lua",
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
{ "antosha417/nvim-lsp-file-operations", config = true },
},
lazy = true,
-- event = "VeryLazy",
cmd = {
"NvimTreeFindFileToggle",
},
keys = {
{ "<leader>e", "<cmd>NvimTreeFindFileToggle<CR>", desc = "Toggle file explorer on current file" },
},
config = function()
local nvimtree = require("nvim-tree")
-- recommended settings from nvim-tree documentation
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
nvimtree.setup({
view = {
width = 35,
relativenumber = false,
number = false,
side = "right",
},
update_focused_file = {
enable = true,
update_root = {
enable = false,
},
},
-- change folder arrow icons
renderer = {
indent_markers = {
enable = true,
},
icons = {
glyphs = {
folder = {
-- arrow_closed = "", -- arrow when folder is closed
-- arrow_open = "", -- arrow when folder is open
},
},
},
},
-- disable window_picker for
-- explorer to work well with
-- window splits
actions = {
open_file = {
window_picker = {
enable = false,
},
},
},
-- filters = {
-- custom = { ".DS_Store" },
-- },
git = {
ignore = false,
},
})
end,
}

View File

@ -1,83 +0,0 @@
return {
"stevearc/oil.nvim",
keys = {
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory" },
{
"_",
function()
require("oil").open(vim.fn.getcwd())
end,
desc = "Open parent directory",
},
},
cmd = { "Oil" },
-- lazy = false,
event = "VimEnter",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup({
default_file_explorer = true,
delete_to_trash = false,
view_options = {
show_hidden = true,
},
columns = {
"icon",
"permissions",
"size",
"mtime",
},
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = false,
--[[ ["<C-h>"] = { "actions.select", opts = { horizontal = true } }, ]]
["<C-h>"] = false,
["<C-t>"] = { "actions.select", opts = { tab = true } },
["<C-p>"] = "actions.preview",
["<C-c>"] = false,
["q"] = "actions.close",
["<C-l>"] = false,
["<C-r>"] = { "actions.refresh" },
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = { "actions.cd", opts = { scope = "tab" } },
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
-- Mappings can be a string
-- ["~"] = "<cmd>edit $HOME<CR>",
-- Mappings can be a function
-- ["gd"] = function()
-- require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
-- end,
-- You can pass additional opts to vim.keymap.set by using
-- a table with the mapping as the first element.
["<leader>ff"] = {
function()
require("telescope.builtin").find_files({
cwd = require("oil").get_current_dir(),
})
end,
mode = "n",
nowait = true,
desc = "Find files in the current directory",
},
["<leader>fw"] = {
function()
require("telescope.builtin").live_grep({
cwd = require("oil").get_current_dir(),
})
end,
mode = "n",
nowait = true,
desc = "Find files in the current directory",
},
},
skip_confirm_for_simple_edits = true,
watch_for_changes = true,
})
end,
}

View File

@ -1,152 +0,0 @@
local platform = vim.loop.os_uname().sysname
local function fzf_plugin()
if platform == "FreeBSD" then
return {
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
}
else
return { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }
end
end
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files in cwd" },
{ "<leader>fo", "<cmd>Telescope oldfiles<cr>", desc = "Fuzzy find recent files" },
{ "<leader>fw", "<cmd>Telescope live_grep<cr>", desc = "Find string in cwd" },
{ "<leader>ft", "<cmd>TodoTelescope<cr>", desc = "Find todos" },
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find keymaps" },
-- { "<leader>fm", "<cmd>Telescope marks<cr>", desc = "Find marks" },
{ "<leader>fh", "<cmd>Telescope search_history<cr>", desc = "Find search history" },
{ "<leader>gm", "<cmd>Telescope git_commits<CR>", desc = "Git commits" },
{
"<leader>fb",
function()
require("telescope.builtin").live_grep({ grep_open_files = true })
end,
desc = "Find in all buffers",
},
{
"<leader>fc",
function()
require("telescope.builtin").command_history()
end,
desc = "Search command history",
},
{
"<leader>fr",
function()
require("telescope.builtin").resume()
end,
desc = "Resume last search",
},
{
"<leader>ct",
function()
require("telescope.builtin").filetypes()
end,
desc = "Set current filetype",
},
{
"<leader>fd",
function()
require("telescope.builtin").diagnostics()
end,
desc = "Find Diagnostics",
},
{
"<leader>b",
function()
-- require("telescope.builtin").buffers({ sort_lastused = true, initial_mode = "normal" })
require("telescope.builtin").buffers({ sort_lastused = true })
end,
desc = "Buffers",
},
},
dependencies = {
"nvim-lua/plenary.nvim",
fzf_plugin(),
"nvim-tree/nvim-web-devicons",
"folke/todo-comments.nvim",
"nvim-telescope/telescope-ui-select.nvim",
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local transform_mod = require("telescope.actions.mt").transform_mod
local trouble = require("trouble")
local trouble_telescope = require("trouble.sources.telescope")
local custom_actions = transform_mod({
open_trouble_qflist = function()
trouble.toggle("quickfix")
end,
})
telescope.setup({
defaults = {
path_display = {
-- shorten = 4,
},
mappings = {
n = {
["d"] = require("telescope.actions").delete_buffer,
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
["<C-t>"] = trouble_telescope.open,
},
i = {
["<C-p>"] = actions.move_selection_previous, -- move to prev result
["<C-n>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
["<C-t>"] = trouble_telescope.open,
},
},
},
pickers = {
buffers = {
theme = "ivy",
previewer = false,
},
git_files = {
theme = "ivy",
previewer = false,
},
oldfiles = {
theme = "ivy",
previewer = false,
},
find_files = {
theme = "ivy",
previewer = false,
},
live_grep = {
theme = "ivy",
},
colorscheme = {
theme = "ivy",
},
marks = {
theme = "ivy",
},
lsp_document_symblos = {
theme = "ivy",
},
lsp_dynamic_workspace_symbols = {
theme = "ivy",
},
lsp_references = {
theme = "ivy",
},
},
})
telescope.load_extension("fzf")
end,
}

View File

@ -1,63 +0,0 @@
return {
{
"akinsho/toggleterm.nvim",
version = "*",
opts = {},
config = function()
local Terminal = require("toggleterm.terminal").Terminal
local float = Terminal:new({
direction = "float",
auto_scroll = true,
persist_mode = false,
start_in_insert = true,
float_opts = {
border = "curved",
},
display_name = "RUA",
})
local horizontal = Terminal:new({
direction = "horizontal",
persist_mode = false,
auto_scroll = true,
start_in_insert = true,
display_name = "RUA",
})
local vertical = Terminal:new({
direction = "vertical",
persist_mode = false,
auto_scroll = true,
start_in_insert = true,
display_name = "RUA",
})
local lazygit = Terminal:new({
direction = "float",
auto_scroll = true,
persist_mode = false,
start_in_insert = true,
float_opts = {
border = "curved",
},
display_name = "Lazygit",
cmd = "lazygit",
})
local map = vim.keymap.set
map({ "n", "t" }, "<A-i>", function()
float:toggle()
end, { noremap = true, silent = true })
map({ "n", "t" }, "<A-u>", function()
horizontal:toggle()
end, { noremap = true, silent = true })
map({ "n", "t" }, "<A-o>", function()
vertical:toggle()
end, { noremap = true, silent = true })
map({ "n", "t" }, "<C-/>", function()
horizontal:toggle()
end)
map("n", "<leader>gl", function()
lazygit:toggle()
end, { noremap = true, silent = true })
end,
keys = { "<A-i>", "<A-u>", "<A-o>", "<C-/>", "<leader>gl" },
},
}

View File

@ -1,55 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
opts = {
indent = { enable = true },
ensure_installed = {
-- defaults
"vim",
"vimdoc",
"lua",
-- web dev
"html",
"css",
"javascript",
"typescript",
"tsx",
"json5",
"vue",
"markdown",
"markdown_inline",
"jsdoc",
"scss",
"styled", -- styled components
-- low level
"rust",
"ron",
"toml",
"go",
"gomod",
"gowork",
"gosum",
"sql",
-- git
"git_config",
"gitcommit",
"git_rebase",
"gitignore",
"gitattributes",
},
auto_install = true,
highlight = {
enable = function()
return not vim.b.large_buf
end,
disable = function()
return vim.b.large_buf
end,
},
},
---@param opts TSConfig
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}

View File

@ -1,40 +0,0 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
opts = {
focus = true,
},
cmd = "Trouble",
keys = {
{
"<leader>tX",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>tx",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>ts",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>tl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>tL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>tQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
}

View File

@ -1,215 +0,0 @@
return {
{
"nvim-pack/nvim-spectre",
opts = {},
keys = {
{ "<leader>ss", '<cmd>lua require("spectre").open()<CR>', desc = "Toggle Spectre" },
{
"<leader>sw",
'<cmd>lua require("spectre").open_visual({select_word=true})<CR>',
desc = "Spectre search current word",
},
{
"<leader>sp",
'<cmd>lua require("spectre").open_file_search({select_word=true})<CR>',
desc = "Spectre search on current file",
},
{
"<leader>sw",
'<esc><cmd>lua require("spectre").open_visual()<CR>',
desc = "Spectre search current word",
mode = "v",
},
},
},
{
"mg979/vim-visual-multi",
keys = {
{
"<C-n>",
"<Plug>(VM-Find-Subword-Under)",
desc = "Start vim visual multi",
mode = { "n", "v" },
},
},
},
{
"mistricky/codesnap.nvim",
build = "make",
cmd = {
"CodeSnap",
"CodeSnapASCII",
"CodeSnapHighlight",
"CodeSnapSave",
"CodeSnapSaveHighlight",
},
opts = {
mac_window_bar = true,
title = "RUA",
code_font_family = "JetBrains Mono NL",
watermark = "RUA",
bg_color = "#535c68",
},
},
{
"stevearc/dressing.nvim",
event = "BufReadPost",
opts = {},
},
{
"RRethy/vim-illuminate",
event = "BufReadPost",
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
{
"NvChad/nvim-colorizer.lua",
event = "BufReadPost",
opts = {
user_default_options = {
tailwind = true,
},
},
},
{
"lukas-reineke/indent-blankline.nvim",
event = "BufReadPost",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {
indent = { char = "" },
scope = { enabled = false },
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
},
{
"folke/todo-comments.nvim",
opts = {},
},
{
"j-hui/fidget.nvim", -- lsp messages
event = "VeryLazy",
opts = {
integration = {
["nvim-tree"] = {
enable = false, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
},
["xcodebuild-nvim"] = {
enable = false, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
},
},
notification = {
window = {
winblend = 0, -- Background color opacity in the notification window
},
},
},
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
},
-- {
-- "echasnovski/mini.indentscope",
-- version = false,
-- event = "BufReadPost",
-- opts = {
-- symbol = "│",
-- -- options = { try_as_border = true },
-- },
-- init = function()
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = {
-- "alpha",
-- "dashboard",
-- "fzf",
-- "help",
-- "lazy",
-- "lazyterm",
-- "mason",
-- "neo-tree",
-- "notify",
-- "toggleterm",
-- "Trouble",
-- "trouble",
-- },
-- callback = function()
-- vim.b.miniindentscope_disable = true
-- end,
-- })
-- end,
-- },
-- {
-- "echasnovski/mini.icons",
-- lazy = true,
-- opts = {
-- file = {
-- [".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" },
-- ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
-- },
-- filetype = {
-- dotenv = { glyph = "", hl = "MiniIconsYellow" },
-- },
-- },
-- init = function()
-- package.preload["nvim-web-devicons"] = function()
-- require("mini.icons").mock_nvim_web_devicons()
-- return package.loaded["nvim-web-devicons"]
-- end
-- end,
-- },
}