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,7 +3,18 @@ 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()
-- FIXME: Errors out on no pynvim installed
-- local function molten()
-- if
-- require("core.util").is_available("molten.status")
-- and require("molten.status").initialized() ~= ""
-- then
-- return "󱪄"
-- end
-- return ""
-- end
require("lualine").setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = "auto", theme = "auto",
@ -16,7 +27,7 @@ return {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" }, lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" }, lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" }, lualine_x = { "encoding", "fileformat", "filetype", "molten" },
lualine_y = { "progress" }, lualine_y = { "progress" },
lualine_z = { "location" }, lualine_z = { "location" },
}, },
@ -30,7 +41,8 @@ return {
}, },
tabline = {}, tabline = {},
extensions = { "quickfix", "toggleterm" }, extensions = { "quickfix", "toggleterm" },
}, })
end,
event = { "BufNewFile", "BufAdd", "BufWinEnter" }, event = { "BufNewFile", "BufAdd", "BufWinEnter" },
}, },
-- create pretty unobtrusive notifications -- create pretty unobtrusive notifications