nvim: Formatting

This commit is contained in:
Marty Oehme 2024-06-06 09:43:20 +02:00
parent 7eeeb9e85d
commit c03b88c6cc
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 53 additions and 30 deletions

View file

@ -22,7 +22,9 @@ local formatters = {
javascript = { { "prettierd", "prettier" } }, javascript = { { "prettierd", "prettier" } },
javascriptreact = { { "prettierd", "prettier" } }, javascriptreact = { { "prettierd", "prettier" } },
json = { "jq" }, json = { "jq" },
liquid = { { "prettierd", "prettier" } },
lua = { "stylua" }, lua = { "stylua" },
markdown = { { "prettierd", "prettier" } },
python = { "ruff_fix", "ruff_format" }, python = { "ruff_fix", "ruff_format" },
sh = { "shfmt" }, sh = { "shfmt" },
svelte = { { "prettierd", "prettier" } }, svelte = { { "prettierd", "prettier" } },
@ -123,7 +125,7 @@ return {
end, end,
}) })
end, end,
event = { "BufWritePost", "InsertLeave" }, event = { "BufWritePre", "InsertEnter" },
}, },
-- formatting setup -- formatting setup
@ -248,6 +250,7 @@ return {
"nvim-neotest/neotest", "nvim-neotest/neotest",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-neotest/nvim-nio",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim", "antoinemadec/FixCursorHold.nvim",

View file

@ -71,7 +71,15 @@ local prose_plugs = {
require("zk").edit(opts, { title = "Zk Orphans" }) require("zk").edit(opts, { title = "Zk Orphans" })
end) end)
end end
require("zk").setup({ picker = "telescope" }) require("zk").setup({
picker = "telescope",
lsp = {
auto_attach = {
enabled = true,
filteypes = { "markdown", "quarto" },
},
},
})
end, end,
ft = writing_ft, ft = writing_ft,
cmd = { cmd = {

View file

@ -3,34 +3,46 @@ return {
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
requires = { "nvim-tree/nvim-web-devicons", config = true }, requires = { "nvim-tree/nvim-web-devicons", config = true },
opts = { config = function()
options = { -- FIXME: Errors out on no pynvim installed
icons_enabled = true, -- local function molten()
theme = "auto", -- if
component_separators = { left = "", right = "" }, -- require("core.util").is_available("molten.status")
section_separators = { left = "", right = "" }, -- and require("molten.status").initialized() ~= ""
disabled_filetypes = {}, -- then
always_divide_middle = true, -- return "󱪄"
}, -- end
sections = { -- return ""
lualine_a = { "mode" }, -- end
lualine_b = { "branch", "diff", "diagnostics" }, require("lualine").setup({
lualine_c = { "filename" }, options = {
lualine_x = { "encoding", "fileformat", "filetype" }, icons_enabled = true,
lualine_y = { "progress" }, theme = "auto",
lualine_z = { "location" }, component_separators = { left = "", right = "" },
}, section_separators = { left = "", right = "" },
inactive_sections = { disabled_filetypes = {},
lualine_a = {}, always_divide_middle = true,
lualine_b = { "branch", "diff" }, },
lualine_c = { "filename" }, sections = {
lualine_x = {}, lualine_a = { "mode" },
lualine_y = { "location" }, lualine_b = { "branch", "diff", "diagnostics" },
lualine_z = {}, lualine_c = { "filename" },
}, lualine_x = { "encoding", "fileformat", "filetype", "molten" },
tabline = {}, lualine_y = { "progress" },
extensions = { "quickfix", "toggleterm" }, lualine_z = { "location" },
}, },
inactive_sections = {
lualine_a = {},
lualine_b = { "branch", "diff" },
lualine_c = { "filename" },
lualine_x = {},
lualine_y = { "location" },
lualine_z = {},
},
tabline = {},
extensions = { "quickfix", "toggleterm" },
})
end,
event = { "BufNewFile", "BufAdd", "BufWinEnter" }, event = { "BufNewFile", "BufAdd", "BufWinEnter" },
}, },
-- create pretty unobtrusive notifications -- create pretty unobtrusive notifications