This commit is contained in:
lucy 2026-03-01 18:53:20 +01:00
commit fd9cc9c38b
10 changed files with 369 additions and 0 deletions

76
lua/plugins/coding.lua Normal file
View file

@ -0,0 +1,76 @@
return {
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
jsonc = { "prettierd", "prettier", stop_after_first = true },
c = { "clang-format" },
cpp = { "clang-format" },
sh = { "shfmt" },
bash = { "shfmt" },
},
formatters = {
["clang-format"] = {
prepend_args = {
"--style={BasedOnStyle: LLVM, BreakBeforeBraces: Allman, ColumnLimit: 300, IndentWidth: 8, UseTab: Never}",
},
},
},
},
},
{
"mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"neovim/nvim-lspconfig",
},
},
{
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = { "rafamadriz/friendly-snippets", "neovim/nvim-lspconfig" },
-- use a release tag to download pre-built binaries
version = "1.*",
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = "default" },
appearance = {
nerd_font_variant = "mono",
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = false } },
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
},
}

11
lua/plugins/cord.lua Normal file
View file

@ -0,0 +1,11 @@
return {
{
"vyfor/cord.nvim",
---@type CordConfig
opts = {
display = {
theme = "atom",
}
},
},
}

117
lua/plugins/snacks.lua Normal file
View file

@ -0,0 +1,117 @@
return {
{
"folke/snacks.nvim",
opts = {
dashboard = {
enabled = true,
width = 60,
row = nil, -- dashboard position. nil for center
col = nil, -- dashboard position. nil for center
pane_gap = 4, -- empty columns between vertical panes
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
-- These settings are used by some built-in sections
preset = {
-- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick`
---@type fun(cmd:string, opts:table)|nil
pick = nil,
-- Used by the `keys` section to show keymaps.
-- Set your custom keymaps here.
-- When using a function, the `items` argument are the default keymaps.
---@type snacks.dashboard.Item[]
keys = {
{
icon = "",
key = "f",
desc = "Find File",
action = ":lua Snacks.dashboard.pick('files')",
},
{ icon = "", key = "n", desc = "New File", action = ":ene | startinsert" },
{
icon = "",
key = "g",
desc = "Find Text",
action = ":lua Snacks.dashboard.pick('live_grep')",
},
{
icon = "",
key = "r",
desc = "Recent Files",
action = ":lua Snacks.dashboard.pick('oldfiles')",
},
{
icon = "",
key = "c",
desc = "Config",
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
},
{ icon = "", key = "s", desc = "Restore Session", section = "session" },
{
icon = "󰒲 ",
key = "L",
desc = "Lazy",
action = ":Lazy",
enabled = package.loaded.lazy ~= nil,
},
{ icon = "", key = "q", desc = "Quit", action = ":qa" },
},
-- Used by the `header` section
header = [[
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⣉⣙⣷⡦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢤⣴⠖⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣉⠛⠓⠶⢤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣽⡿⠟⠁⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⡶⠶⠛⠉⠉⠉⠉⠁⠀⠀⠀⠀⠉⠙⠿⠓⠒⠶⢺⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⢶⡶⠶⠶⠶⠖⠖⠛⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠘⣧⡀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠈⠻⢤⣼⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡀⢀⣿⡿⠶⠶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⡇⠀⣀⣀⠀⢀⣀⣤⡀⠀⠀⠀⠀⠸⠶⠶⠚⠛⠋⢹⣿⣿⣟⣉⠉⠒⠀⠻⣦⣠⣤⣤⣤⣄⣀⠀⠀
⠀⢀⣤⢾⣿⣷⣶⡍⠙⠙⠛⠋⠉⠀⠀⢴⡶⠀⠀⠀⠀⢀⣠⡶⠟⠛⠛⣷⠀⠉⠁⠀⠀⠈⣧⡀⠀⠩⣀⠈⢹⣆
⠀⣠⠔⢉⡴⢿⣿⡟⠛⠛⠛⠶⣤⣀⠀⠀⠀⠀⠀⠀⣴⡿⠋⠀⠀⠀⢀⡉⠀⠀⠀⠀⢀⣼⠛⠛⢛⣿⡿⠀⣾⡟
⠀⠁⣰⠋⢀⡿⠁⠀⠀⠀⠀⠀⠀⠉⠻⣦⡀⠀⠀⣼⠟⠀⠀⠀⢀⣠⣾⢁⣀⣤⣴⡶⠟⣁⣴⠞⠋⠉⢀⣼⣿⠁
⠀⠀⠉⠀⠈⠷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡗⠚⡏⠀⢀⣤⡶⠛⠋⠉⠉⠉⠉⠀⣠⣾⠟⢁⣀⣤⣶⣿⠟⠁⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠉⠑⠲⠤⣄⣦⣤⡴⠞⠁⠀⠉⠙⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠹⠿⠾⠾⠟⠛⠁⠀⠀⠀⠀
]],
},
-- item field formatters
formats = {
icon = function(item)
if item.file and item.icon == "file" or item.icon == "directory" then
return Snacks.dashboard.icon(item.file, item.icon)
end
return { item.icon, width = 2, hl = "icon" }
end,
footer = { "%s", align = "center" },
header = { "%s", align = "center" },
file = function(item, ctx)
local fname = vim.fn.fnamemodify(item.file, ":~")
fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname
if #fname > ctx.width then
local dir = vim.fn.fnamemodify(fname, ":h")
local file = vim.fn.fnamemodify(fname, ":t")
if dir and file then
file = file:sub(-(ctx.width - #dir - 2))
fname = dir .. "/…" .. file
end
end
local dir, file = fname:match("^(.*)/(.+)$")
return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } }
or { { fname, hl = "file" } }
end,
},
sections = {
{ section = "header" },
{ section = "keys", gap = 1, padding = 1 },
{ section = "startup" },
},
},
notifier = { enabled = true },
indent = { enabled = true },
picker = { enabled = true },
statuscolumn = { enabled = true },
},
},
}

50
lua/plugins/ui.lua Normal file
View file

@ -0,0 +1,50 @@
return {
{ "RRethy/base16-nvim" },
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local has_lualine, lualine = pcall(require, "lualine")
if not has_lualine then
return
end
require("lualine").setup({
options = {
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "diagnostics" },
lualine_c = { "filename", "branch", "navic" },
lualine_x = { "lsp_status", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
end,
},
{
"nvimdev/lspsaga.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter", -- for syntax highlighting inside the popup
"nvim-tree/nvim-web-devicons", -- for pretty icons
},
opts = {
ui = {
border = "rounded",
},
symbol_in_winbar = { enable = true },
hover = {
max_width = 0.6,
open_link = "gx",
open_browser = "!google-chrome",
},
},
},
{
"akinsho/bufferline.nvim",
opts = {},
},
}