Merge branch 'main' into lang/typst

This commit is contained in:
Võ Quang Chiến 2024-09-17 13:36:09 +07:00 committed by GitHub
commit f67fe0319b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 9 deletions

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2024 July 25
*LazyVim.txt* For Neovim Last change: 2024 September 16
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View file

@ -20,9 +20,12 @@ vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
-- LazyVim automatically configures lazygit:
-- * theme, based on the active colorscheme.
-- * editorPreset to nvim-remote
-- * editPreset to nvim-remote
-- * enables nerd font icons
-- Set to false to disable.
-- Set the options you want to override in `~/.config/lazygit/custom.yml`
-- WARN: on Windows you might want to set `editPreset: "nvim"` due to
-- this issue https://github.com/jesseduffield/lazygit/issues/3467
vim.g.lazygit_config = true
-- Options for the LazyVim statuscolumn

View file

@ -137,7 +137,7 @@ return {
function()
local grug = require("grug-far")
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
grug.grug_far({
grug.open({
transient = true,
prefills = {
filesFilter = ext and ext ~= "" and "*." .. ext or nil,

View file

@ -23,7 +23,6 @@ return {
local user = vim.env.USER or "User"
user = user:sub(1, 1):upper() .. user:sub(2)
return {
model = "gpt-4",
auto_insert_mode = true,
show_help = true,
question_header = "" .. user .. " ",

View file

@ -76,6 +76,7 @@ return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = function()
require("lazy").load({ plugins = { "markdown-preview.nvim" } })
vim.fn["mkdp#util#install"]()
end,
keys = {
@ -92,7 +93,7 @@ return {
},
{
"MeanderingProgrammer/markdown.nvim",
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "norg", "rmd", "org" },
code = {

View file

@ -10,6 +10,7 @@ return {
-- stylua: ignore
keys = {
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
{ "<leader>qS", function() require("persistence").select() end,desc = "Select Session" },
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
},

View file

@ -70,6 +70,10 @@ function M.open(opts)
if ok then
M.config_dir = lines[1]
vim.env.LG_CONFIG_FILE = LazyVim.norm(M.config_dir .. "/config.yml" .. "," .. M.theme_path)
local custom_config = LazyVim.norm(M.config_dir .. "/custom.yml")
if vim.uv.fs_stat(custom_config) and vim.uv.fs_stat(custom_config).type == "file" then
vim.env.LG_CONFIG_FILE = vim.env.LG_CONFIG_FILE .. "," .. custom_config
end
else
---@diagnostic disable-next-line: cast-type-mismatch
---@cast lines string

View file

@ -33,6 +33,7 @@ M.renames = {
["null-ls.nvim"] = "none-ls.nvim",
["romgrk/nvim-treesitter-context"] = "nvim-treesitter/nvim-treesitter-context",
["glepnir/dashboard-nvim"] = "nvimdev/dashboard-nvim",
["markdown.nvim"] = "render-markdown.nvim",
}
function M.save_core()

View file

@ -127,9 +127,25 @@ M.number = M.wrap({
M.diagnostics = M.wrap({
name = "Diagnostics",
get = function()
return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled()
local enabled = false
if vim.diagnostic.is_enabled then
enabled = vim.diagnostic.is_enabled()
elseif vim.diagnostic.is_disabled then
enabled = not vim.diagnostic.is_disabled()
end
return enabled
end,
set = function(state)
if vim.fn.has("nvim-0.10") == 0 then
if state then
pcall(vim.diagnostic.enable)
else
pcall(vim.diagnostic.disable)
end
else
vim.diagnostic.enable(state)
end
end,
set = vim.diagnostic.enable,
})
M.inlay_hints = M.wrap({