aboutsummaryrefslogtreecommitdiff
path: root/plugin/00-settings.lua
diff options
context:
space:
mode:
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