Compare commits

..

15 Commits

Author SHA1 Message Date
6b4c872f2d chore(main): release 9.2.0 ()
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-06 15:53:13 +02:00
6e0e01f5b4 fix(config): fixed issues related to LazyFile. Fixes 2023-10-06 15:40:27 +02:00
a1c5886947 feat(conform): ignore formatting errors for injected languages and fix condition example 2023-10-06 09:26:14 +02:00
8a1de2b90a fix(elixir): only enable credo when installed. Fixes 2023-10-06 09:18:07 +02:00
3823f177e9 chore(build): auto-generate vimdoc 2023-10-06 07:03:24 +00:00
f1ea518e29 fix(which-key): change surround group key () 2023-10-06 09:02:45 +02:00
cce46cd640 chore(main): release 9.1.1 ()
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-06 01:02:16 +02:00
337cfdbec4 fix(ui): include extmark signs in signcolumn. Fixes 2023-10-05 23:34:32 +02:00
b2af941290 ci: disable blank issues 2023-10-05 16:33:01 +02:00
f219364656 chore(main): release 9.1.0 ()
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-05 16:03:46 +02:00
6f1cdfe4bd feat(dashboard): add projects if enabled () 2023-10-05 15:59:44 +02:00
1eb019274b fix(options): set default laststatus=3 and set it to 0 before loading dashboard to prevent flickering 2023-10-05 10:43:21 +02:00
d6b56c075e fix(dasboard): disable alpha only once 2023-10-05 09:53:50 +02:00
6f6d587998 chore(build): auto-generate vimdoc 2023-10-05 06:08:38 +00:00
d3e7f7717e fix(tailwind): allow overriding filetypes. Fixes 2023-10-05 08:07:56 +02:00
14 changed files with 148 additions and 29 deletions

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file

@ -0,0 +1 @@
blank_issues_enabled: false

@ -1,5 +1,40 @@
# Changelog
## [9.2.0](https://github.com/LazyVim/LazyVim/compare/v9.1.1...v9.2.0) (2023-10-06)
### Features
* **conform:** ignore formatting errors for injected languages and fix condition example ([a1c5886](https://github.com/LazyVim/LazyVim/commit/a1c5886947e20059ad7802e71e0a82b413af6657))
### Bug Fixes
* **config:** fixed issues related to LazyFile. Fixes [#1601](https://github.com/LazyVim/LazyVim/issues/1601) ([6e0e01f](https://github.com/LazyVim/LazyVim/commit/6e0e01f5b4dd7e97abbb50241a207d36d0ce9cd5))
* **elixir:** only enable credo when installed. Fixes [#1546](https://github.com/LazyVim/LazyVim/issues/1546) ([8a1de2b](https://github.com/LazyVim/LazyVim/commit/8a1de2b90a699bdfee704f3d4422e2ced18ae0f3))
* **which-key:** change surround group key ([#1598](https://github.com/LazyVim/LazyVim/issues/1598)) ([f1ea518](https://github.com/LazyVim/LazyVim/commit/f1ea518e29a601b773d9c9c94489fc9d273c2dea))
## [9.1.1](https://github.com/LazyVim/LazyVim/compare/v9.1.0...v9.1.1) (2023-10-05)
### Bug Fixes
* **ui:** include extmark signs in signcolumn. Fixes [#1596](https://github.com/LazyVim/LazyVim/issues/1596) ([337cfdb](https://github.com/LazyVim/LazyVim/commit/337cfdbec43003cb2c269e59b27167aa752bf41f))
## [9.1.0](https://github.com/LazyVim/LazyVim/compare/v9.0.2...v9.1.0) (2023-10-05)
### Features
* **dashboard:** add projects if enabled ([#1595](https://github.com/LazyVim/LazyVim/issues/1595)) ([6f1cdfe](https://github.com/LazyVim/LazyVim/commit/6f1cdfe4bd2ec9a85c92a312fa52ba86e02d1a9f))
### Bug Fixes
* **dasboard:** disable alpha only once ([d6b56c0](https://github.com/LazyVim/LazyVim/commit/d6b56c075e88ce12e9e16fb2eeeea38fb7853600))
* **options:** set default laststatus=3 and set it to 0 before loading dashboard to prevent flickering ([1eb0192](https://github.com/LazyVim/LazyVim/commit/1eb019274b5564e66ac6c7e119c140bae262e10c))
* **tailwind:** allow overriding filetypes. Fixes [#1590](https://github.com/LazyVim/LazyVim/issues/1590) ([d3e7f77](https://github.com/LazyVim/LazyVim/commit/d3e7f7717e960bb883b35e9a75badfd5b938cace))
## [9.0.2](https://github.com/LazyVim/LazyVim/compare/v9.0.1...v9.0.2) (2023-10-04)

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 04
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 06
==============================================================================
Table of Contents *LazyVim-table-of-contents*

@ -32,9 +32,6 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function(event)
if event.data and event.data.lazy_file then
return
end
local exclude = { "gitcommit" }
local buf = event.buf
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then

@ -2,6 +2,7 @@
local M = {}
M.lazy_version = ">=9.1.0"
M.use_lazy_file = true
---@class LazyVimOptions
local defaults = {
@ -136,7 +137,10 @@ function M.setup(opts)
end,
})
M.lazy_file()
M.use_lazy_file = M.use_lazy_file and require("lazy.core.handler.event").trigger_events == nil
if M.use_lazy_file then
M.lazy_file()
end
require("lazy.core.util").try(function()
if type(M.colorscheme) == "function" then
@ -155,31 +159,50 @@ end
-- Properly load file based plugins without blocking the UI
function M.lazy_file()
local events = {} ---@type {event: string, pattern?: string, buf: number, data?: any}[]
local events = {} ---@type {event: string, buf: number, data?: any}[]
local function load()
if #events == 0 then
return
end
local Event = require("lazy.core.handler.event")
local Util = require("lazy.core.util")
vim.api.nvim_del_augroup_by_name("lazy_file")
Util.track({ event = "LazyFile" })
---@type table<string,string[]>
local skips = { FileType = Event.get_augroups("FileType") }
for _, event in ipairs(events) do
skips[event.event] = skips[event.event] or Event.get_augroups(event.event)
end
vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile", modeline = false })
for _, event in ipairs(events) do
vim.api.nvim_exec_autocmds(event.event, {
pattern = event.pattern,
modeline = false,
buffer = event.buf,
data = { lazy_file = true },
Event.trigger({
event = event.event,
exclude = skips[event.event],
data = event.data,
buf = event.buf,
})
if vim.bo[event.buf].filetype then
Event.trigger({
event = "FileType",
exclude = skips.FileType,
buf = event.buf,
})
end
end
vim.api.nvim_exec_autocmds("CursorMoved", { modeline = false })
events = {}
Util.track()
end
-- schedule wrap so that nested autocmds are executed
-- and the UI can continue rendering without blocking
load = vim.schedule_wrap(load)
vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost", "BufNewFile" }, {
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
group = vim.api.nvim_create_augroup("lazy_file", { clear = true }),
callback = function(event)
table.insert(events, event)
@ -251,6 +274,9 @@ function M.init()
)
plugin[1] = M.renames[plugin[1]]
end
if not M.use_lazy_file and type(plugin) == "table" and plugin.event == "LazyFile" then
plugin.event = { "BufReadPost", "BufNewFile" }
end
return add(self, plugin, ...)
end

@ -16,7 +16,7 @@ opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 0
opt.laststatus = 3 -- global statusline
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number

@ -282,7 +282,7 @@ return {
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["gs"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },

@ -33,9 +33,10 @@ return {
-- You can also define any custom formatters here.
---@type table<string,table>
formatters = {
injected = { options = { ignore_errors = true } },
-- -- Example of using dprint only when a dprint.json file is present
-- dprint = {
-- condition = function(ctx)
-- condition = function(self, ctx)
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
-- end,
-- },

@ -33,6 +33,9 @@ return {
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
if vim.fn.executable("credo") == 0 then
return
end
local nls = require("null-ls")
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
@ -43,10 +46,13 @@ return {
{
"mfussenegger/nvim-lint",
optional = true,
opts = {
linters_by_ft = {
opts = function(_, opts)
if vim.fn.executable("credo") == 0 then
return
end
opts.linters_by_ft = {
elixir = { "credo" },
},
},
}
end,
},
}

@ -4,16 +4,30 @@ return {
opts = {
servers = {
tailwindcss = {
-- exclude a filetype from the default_config
filetypes_exclude = { "markdown" },
-- add additional filetypes to the default_config
filetypes_include = {},
-- to fully override the default_config, change the below
-- filetypes = {}
},
},
setup = {
tailwindcss = function(_, opts)
local tw = require("lspconfig.server_configurations.tailwindcss")
opts.filetypes = opts.filetypes or {}
-- Add default filetypes
vim.list_extend(opts.filetypes, tw.default_config.filetypes)
-- Remove excluded filetypes
--- @param ft string
opts.filetypes = vim.tbl_filter(function(ft)
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
end, tw.default_config.filetypes)
end, opts.filetypes)
-- Add additional filetypes
vim.list_extend(opts.filetypes, opts.filetypes_include)
end,
},
},

@ -4,10 +4,6 @@ return {
{
"glepnir/dashboard-nvim",
event = "VimEnter",
dependencies = {
-- disable alpha
{ "goolord/alpha-nvim", enabled = false },
},
opts = function()
local logo = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z

@ -42,4 +42,17 @@ return {
vim.list_extend(opts.items, items)
end,
},
{
"glepnir/dashboard-nvim",
optional = true,
opts = function(_, opts)
local projects = {
action = "Telescope projects",
desc = " Projects",
icon = "",
key = "p",
}
table.insert(opts.config.center, 3, projects)
end,
},
}

@ -316,6 +316,7 @@ return {
return dashboard
end,
config = function(_, dashboard)
vim.o.laststatus = 0
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()

@ -1,15 +1,44 @@
local M = {}
---@alias Sign {name:string, text:string, texthl:string}
---@alias Sign {name:string, text:string, texthl:string, priority:number}
-- Returns a list of regular and extmark signs sorted by priority (low to high)
---@return Sign[]
---@param buf number
---@param lnum number
function M.get_signs(buf, lnum)
---@diagnostic disable-next-line: no-unknown
return vim.tbl_map(function(sign)
return vim.fn.sign_getdefined(sign.name)[1]
-- Get regular signs
---@type Sign[]
local signs = vim.tbl_map(function(sign)
---@type Sign
local ret = vim.fn.sign_getdefined(sign.name)[1]
ret.priority = sign.priority
return ret
end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs)
-- Get extmark signs
local extmarks = vim.api.nvim_buf_get_extmarks(
buf,
-1,
{ lnum - 1, 0 },
{ lnum - 1, -1 },
{ details = true, type = "sign" }
)
for _, extmark in pairs(extmarks) do
signs[#signs + 1] = {
name = extmark[4].sign_hl_group,
text = extmark[4].sign_text,
texthl = extmark[4].sign_hl_group,
priority = extmark[4].priority,
}
end
-- Sort by priority
table.sort(signs, function(a, b)
return (a.priority or 0) < (b.priority or 0)
end)
return signs
end
---@return Sign?
@ -66,7 +95,7 @@ function M.statuscolumn()
for _, s in ipairs(M.get_signs(buf, vim.v.lnum)) do
if s.name:find("GitSign") then
right = s
elseif not left then
else
left = s
end
end