feat: config refresh

This commit is contained in:
Devin Haska 2024-12-23 18:47:58 -08:00
parent a24128cfca
commit f956194c53
16 changed files with 217 additions and 233 deletions

View file

@ -16,7 +16,32 @@ return {
event = "VeryLazy",
opts = {
lang = {
graphql = "# %s",
html = "<!-- %s -->",
javascript = {
"// %s", -- default commentstring when no treesitter node matches
"/* %s */",
call_expression = "// %s", -- specific commentstring for call_expression
jsx_attribute = "// %s",
jsx_element = "{/* %s */}",
jsx_fragment = "{/* %s */}",
spread_element = "// %s",
statement_block = "// %s",
},
pug = "//- %s",
php = "// %s",
tsx = {
"// %s", -- default commentstring when no treesitter node matches
"/* %s */",
call_expression = "// %s", -- specific commentstring for call_expression
jsx_attribute = "// %s",
jsx_element = "{/* %s */}",
jsx_fragment = "{/* %s */}",
spread_element = "// %s",
statement_block = "// %s",
},
twig = "{# %s #}",
typescript = { "// %s", "/* %s */" }, -- langs can have multiple commentstrings
},
},
},

View file

@ -1,36 +1,66 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
css = { "prettierd" },
scss = { "prettierd" },
html = { "djlint" },
lua = { "stylua" },
markdown = { "prettierd" },
javascript = { "prettierd" },
javascriptreact = { "prettierd" },
json = { "prettierd" },
jsonc = { "prettierd" },
toml = { "taplo" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
},
format_on_save = {
lsp_fallback = true,
},
formatters = {
taplo = {
args = function()
-- conform.nvim does not parse bash envvars, so we do it ourselves
local CONFIG_PATH = os.getenv("HOME") .. "/.config/taplo/taplo.toml"
return {
"format",
"--config",
CONFIG_PATH,
"-",
}
end,
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
css = { "prettierd" },
scss = { "prettierd" },
html = { "djlint" },
lua = { "stylua" },
markdown = { "prettierd" },
javascript = { "prettierd" },
javascriptreact = { "prettierd" },
json = { "prettierd" },
jsonc = { "prettierd" },
php = { "php_cs_fixer" },
toml = { "taplo" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
twig = { "twig-cs-fixer" },
},
format_on_save = {
lsp_fallback = true,
},
formatters = {
taplo = {
args = function()
-- conform.nvim does not parse bash envvars, so we do it ourselves
local CONFIG_PATH = os.getenv("HOME") .. "/.config/taplo/taplo.toml"
return {
"format",
"--config",
CONFIG_PATH,
"-",
}
end,
},
php_cs_fixer = {
args = function()
local CONFIG_PATH = os.getenv("HOME") .. "/.config/php-cs-fixer/php-cs-fixer.php"
return {
"fix",
"$FILENAME",
"--config",
CONFIG_PATH,
}
end,
},
},
},
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
opts = {
ensure_installed = {
"djlint",
"php-cs-fixer",
"prettierd",
"proselint",
"stylua",
"twig-cs-fixer",
},
auto_update = true,
automatic_installation = true,
},
},
}

View file

@ -1,22 +1,4 @@
return {
{
"kdheepak/lazygit.nvim",
event = "VeryLazy",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
keys = {
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
},
{
"lewis6991/gitsigns.nvim",
event = "VeryLazy",
@ -38,7 +20,6 @@ return {
},
},
keys = {
{ "<leader>ghb", ":Gitsigns blame_line<CR>", desc = "Blame line" },
{ "<leader>ghs", ":Gitsigns stage_hunk<CR>", desc = "Stage hunk", mode = { "n", "v" } },
{ "<leader>ghr", ":Gitsigns reset_hunk<CR>", desc = "Reset hunk", mode = { "n", "v" } },
},

View file

@ -11,25 +11,14 @@ return {
"eslint",
"html",
"lua_ls",
"psalm", -- .php
"taplo", -- .toml
"ts_ls",
"twiggy_language_server", -- .twig
"yamlls", -- .yml
},
},
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
opts = {
ensure_installed = {
"djlint",
"prettierd",
"proselint",
"stylua",
},
auto_update = true,
automatic_installation = true,
},
},
-- lspconfig should be the last step.
{
"neovim/nvim-lspconfig",
@ -49,10 +38,12 @@ return {
})
end,
},
html = {},
lua_ls = {},
html = {},
psalm = {},
taplo = {},
tsserver = {},
ts_ls = {},
twiggy_language_server = {},
yamlls = {},
},
},

View file

@ -1,13 +1,11 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
event = "VeryLazy",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
keys = {
{ "<Leader>ee", "<cmd>Neotree toggle<CR>", desc = "Toggle Neotree" },
{ "<Leader>er", "<cmd>Neotree reveal<CR>", desc = "Reveal file" },

23
lua/plugins/snack.lua Normal file
View file

@ -0,0 +1,23 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
dashboard = { enabled = true },
git = { enabled = true },
lazygit = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
scratch = { enabled = true },
statuscolumn = { enabled = true },
terminal = { enabled = true },
},
keys = {
{ "<leader>.", function() Snacks.scratch() end, desc = "Toggle Scratch Buffer" },
{ "<leader>S", function() Snacks.scratch.select() end, desc = "Select Scratch Buffer" },
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" },
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" },
{ "<c-/>", function() Snacks.terminal() end, desc = "Toggle Terminal" },
}
}

View file

@ -3,8 +3,11 @@ return {
"nvim-treesitter/nvim-treesitter",
version = false,
build = ":TSUpdate",
event = { "VeryLazy" },
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
opts = {
ensure_installed = {
"graphql",
"html",
"htmldjango",
"javascript",
@ -14,8 +17,10 @@ return {
"lua",
"markdown",
"markdown_inline",
"php",
"pug",
"tsx",
"twig",
"typescript",
"vim",
"vimdoc",

View file

@ -1,6 +1,7 @@
return {
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
@ -36,17 +37,20 @@ return {
scope = { enabled = false },
exclude = {
filetypes = {
"help",
"Trouble",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"help",
"lazy",
"mason",
"neo-tree",
"notify",
"snacks_dashboard",
"snacks_notif",
"snacks_terminal",
"snacks_win",
"toggleterm",
"lazyterm",
"trouble",
},
},
},
@ -61,84 +65,25 @@ return {
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"Trouble",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"help",
"lazy",
"mason",
"neo-tree",
"notify",
"snacks_dashboard",
"snacks_notif",
"snacks_terminal",
"snacks_win",
"toggleterm",
"lazyterm",
"trouble",
},
callback = function()
vim.b.miniindentscope_disable = true
callback = function(data)
vim.b[data.buf].miniindentscope_disable = true
end,
})
end,
},
{
"rcarriga/nvim-notify",
opts = {
timeout = 2000,
stages = "static",
},
},
{
"MunifTanjim/nui.nvim",
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {},
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
},
{
"goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- https://github.com/MaximilianLloyd/ascii.nvim
dashboard.section.header.val = {
" ",
" ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ",
" ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ",
" ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ",
" ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ",
" ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ",
" ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ",
" ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ",
" ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ",
" ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ",
" ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ",
" ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ",
" ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ",
" ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ",
" ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ",
" ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ",
" ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ",
" ▄█████████▄▄ ",
" ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ",
" ▄▄█████▀▀▀▀ ▀■ ",
" ▄███▀▀▀▀ ",
" ■▀▀ ",
" ",
}
dashboard.section.buttons.val = {
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button("SPC ee", " > File explorer", "<cmd>Neotree<CR>"),
dashboard.button("q", " > Quit", "<cmd>qa<CR>"),
}
alpha.setup(dashboard.opts)
end,
},
}