feat: move formatting plugins to formatting.lua

This commit is contained in:
Devin Haska 2024-04-26 22:49:30 -06:00
parent bd031587a5
commit bca2c8ec94
7 changed files with 214 additions and 204 deletions

View file

@ -1,43 +1,43 @@
return {
'goolord/alpha-nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
"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 = {
" ",
" ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ",
" ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ",
" ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ",
" ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ",
" ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ",
" ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ",
" ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ",
" ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ",
" ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ",
" ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ",
" ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ",
" ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ",
" ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ",
" ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ",
" ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ",
" ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ",
" ▄█████████▄▄ ",
" ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ",
" ▄▄█████▀▀▀▀ ▀■ ",
" ▄███▀▀▀▀ ",
" ■▀▀ ",
" ",
}
-- 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>"),
}
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
};
alpha.setup(dashboard.opts)
end,
}

View file

@ -0,0 +1,20 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
css = { "prettierd" },
scss = { "prettierd" },
html = { "djlint" },
lua = { "stylelua" },
javascript = { "prettierd" },
javascriptreact = { "prettierd" },
json = { "prettierd" },
jsonc = { "prettierd" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
},
format_on_save = {
lsp_fallback = true,
},
},
}

View file

@ -1,10 +1,10 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<Leader>gs", vim.cmd.Git, { desc = "View `git status`" })
vim.keymap.set("n", "gh", "<cmd>diffget //2<CR>", { desc = "Pick gitdiff on left" })
vim.keymap.set("n", "gl", "<cmd>diffget //3<CR>", { desc = "Pick gitdiff on right" })
vim.keymap.set("n", "<Leader>gp", ":Git push<CR>", { desc = "Run `git push`" })
vim.keymap.set("n", "<Leader>gc", ":Git checkout ", { desc = "Git checkout" })
end
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<Leader>gs", vim.cmd.Git, { desc = "View `git status`" })
vim.keymap.set("n", "gh", "<cmd>diffget //2<CR>", { desc = "Pick gitdiff on left" })
vim.keymap.set("n", "gl", "<cmd>diffget //3<CR>", { desc = "Pick gitdiff on right" })
vim.keymap.set("n", "<Leader>gp", ":Git push<CR>", { desc = "Run `git push`" })
vim.keymap.set("n", "<Leader>gc", ":Git checkout ", { desc = "Git checkout" })
end,
}

View file

@ -1,76 +1,52 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "tsserver", "html" }
})
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "tsserver", "html" },
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.lua_ls.setup({
capabilities = capabilities
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.tsserver.setup({
capabilities = capabilities,
})
lspconfig.tsserver.setup({
capabilities = capabilities,
})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" })
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Show signature" })
vim.keymap.set('n', '<Leader>f', vim.lsp.buf.format, { desc = "Format buffer" })
vim.keymap.set('n', '<Leader>ca', vim.lsp.buf.code_action, { desc = "View code actions" })
end
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
config = function()
local mason_tool_installer = require("mason-tool-installer")
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" })
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action, { desc = "View code actions" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
config = function()
local mason_tool_installer = require("mason-tool-installer")
mason_tool_installer.setup({
ensure_installed = {
"djlint",
"prettierd",
"eslint_d",
},
automatic_installation = true
})
end
},
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "eslint_d" },
javascriptreact = { "eslint_d" },
json = { "prettierd" },
jsonc = { "prettierd" },
yaml = { "prettierd" },
typescript = { "eslint_d" },
typescriptreact = { "eslint_d" },
html = { "djlint" },
ejs = { "prettierd" },
css = { "prettierd" },
scss = { "prettierd" },
graphql = { "prettierd" },
["_"] = { "trim_whitespace" },
},
format_on_save = {
lsp_fallback = true,
},
},
}
mason_tool_installer.setup({
ensure_installed = {
"djlint",
"prettierd",
"eslint_d",
},
automatic_installation = true,
})
end,
},
}

View file

@ -1,12 +1,12 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
icons_enabled = true,
theme = 'tokyonight'
}
})
end
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
icons_enabled = true,
theme = "tokyonight",
},
})
end,
}

View file

@ -1,26 +1,40 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = { "lua", "javascript", "typescript", "tsx", "htmldjango", "html", "jsonc", "json", "jsdoc", "markdown", "markdown_inline", "vim", "vimdoc" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true }
})
end
},
{
"nvim-treesitter/nvim-treesitter-context",
opts = {
max_lines = 2,
}
},
{
'windwp/nvim-autopairs',
event = "InsertEnter",
opts = {}
}
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = {
"lua",
"javascript",
"typescript",
"tsx",
"htmldjango",
"html",
"jsonc",
"json",
"jsdoc",
"markdown",
"markdown_inline",
"vim",
"vimdoc",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
},
{
"nvim-treesitter/nvim-treesitter-context",
opts = {
max_lines = 2,
},
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {},
},
}

View file

@ -1,55 +1,55 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
opts = {
indent = {
char = "",
tab_char = "",
},
scope = { enabled = false },
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
main = "ibl",
},
{
"echasnovski/mini.indentscope",
opts = {
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
{
"lukas-reineke/indent-blankline.nvim",
opts = {
indent = {
char = "",
tab_char = "",
},
scope = { enabled = false },
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
main = "ibl",
},
{
"echasnovski/mini.indentscope",
opts = {
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
}