diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2026-04-04 03:16:27 +0200 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2026-04-04 10:12:16 +0200 |
| commit | 8bb513a86e8bea07fdb8cea71d254d46ffc7806b (patch) | |
| tree | 745bd411d173e4da9355b214dc74edde08f42692 /lua/pml68/settings.lua | |
| parent | feat: enable ui2, add back LspLog command (diff) | |
| download | nvim-8bb513a86e8bea07fdb8cea71d254d46ffc7806b.tar.gz | |
feat!: migrate to vim.pack
Diffstat (limited to '')
| -rw-r--r-- | plugin/00-settings.lua (renamed from lua/pml68/settings.lua) | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/lua/pml68/settings.lua b/plugin/00-settings.lua index 071d139..fba8771 100644 --- a/lua/pml68/settings.lua +++ b/plugin/00-settings.lua @@ -7,14 +7,15 @@ vim.o.laststatus = 3 vim.o.winborder = "rounded" -local function branch_name() - local branch = vim.fn.system("git branch --show-current 2> /dev/null | tr -d '\n'") - if branch ~= "" then - return " " .. branch - else - return "" - end -end +-- Plugin specific +vim.g.rustfmt_autosave = 1 +vim.g.vimtex_view_method = 'mupdf' +vim.g.guard_config = { + fmt_on_save = true, + lsp_as_default_formatter = true, +} + +vim.g.mason_path = vim.fn.stdpath("data") .. "/mason/bin" vim.diagnostic.config({ virtual_lines = true }) @@ -55,27 +56,48 @@ local function get_attached_clients() return language_servers end -vim.api.nvim_create_autocmd({ "FileType", "BufEnter", "FocusGained" }, { - callback = function() - vim.b.branch_name = branch_name() - end -}) - vim.api.nvim_create_user_command("LspLog", function(_) vim.cmd("edit " .. vim.fn.stdpath("state") .. "/lsp.log") end, { desc = "Show LSP log", }) +vim.api.nvim_create_user_command("PackUpdate", function(_) + vim.pack.update() +end, { + desc = "Update vim.pack plugins", +}) + +vim.api.nvim_create_user_command("PackList", function(_) + vim.pack.update(nil, { offline = true }) +end, { + desc = "List vim.pack plugins", +}) + require("vim._core.ui2").enable({ enable = true, }) +local function branch_name() + local branch = vim.fn.system("git branch --show-current 2> /dev/null | tr -d '\n'") + if branch ~= "" then + return " " .. branch + else + return "" + end +end + +vim.api.nvim_create_autocmd({ "FileType", "BufEnter", "FocusGained" }, { + callback = function() + vim.b.branch_name = branch_name() + end +}) + function Status_Line() return " " .. "%<" .. " %f " - .. vim.b.branch_name + .. (vim.b.branch_name or "") .. " %m" .. " %= " .. diagnostics() @@ -115,4 +137,4 @@ vim.o.foldmethod = "expr" vim.o.foldenable = false vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" -vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. ":" .. vim.env.PATH +vim.env.PATH = vim.g.mason_path .. ":" .. vim.env.PATH |
