1

Update generated neovim config

This commit is contained in:
2024-08-15 14:28:54 +02:00
parent 07409c223d
commit 25cfcf2941
3809 changed files with 351157 additions and 0 deletions

View File

@ -0,0 +1,7 @@
root = true
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8

View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/folke/noice.nvim/discussions
about: Use Github discussions instead

View File

@ -0,0 +1,16 @@
## Description
<!-- Describe the big picture of your changes to communicate to the maintainers
why we should accept this pull request. -->
## Related Issue(s)
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->

View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -0,0 +1,8 @@
name: "PR Labeler"
on:
- pull_request_target
jobs:
labeler:
uses: folke/github/.github/workflows/labeler.yml@main
secrets: inherit

View File

@ -0,0 +1,18 @@
name: PR Title
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
- ready_for_review
permissions:
pull-requests: read
jobs:
pr-title:
uses: folke/github/.github/workflows/pr.yml@main
secrets: inherit

View File

@ -0,0 +1,11 @@
name: Stale Issues & PRs
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/stale.yml@main
secrets: inherit

View File

@ -0,0 +1,13 @@
name: Update Repo
on:
workflow_dispatch:
schedule:
# Run every hour
- cron: "0 * * * *"
jobs:
update:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/update.yml@main
secrets: inherit

View File

@ -0,0 +1,7 @@
return {
-- nui.nvim can be lazy loaded
{ "MunifTanjim/nui.nvim", lazy = true },
{
"folke/noice.nvim",
},
}

View File

@ -0,0 +1,110 @@
local require = require("noice.util.lazy")
local Config = require("noice.config")
local Format = require("noice.text.format")
local Manager = require("noice.message.manager")
local builtin = require("fzf-lua.previewer.builtin")
local fzf = require("fzf-lua")
local M = {}
---@alias NoiceEntry {message: NoiceMessage, ordinal: string, display: string}
---@param message NoiceMessage
---@return NoiceEntry
function M.entry(message)
message = Format.format(message, "fzf")
local line = message._lines[1]
local hl = { message.id .. " " } ---@type string[]
for _, text in ipairs(line._texts) do
---@type string?
local hl_group = text.extmark and text.extmark.hl_group
hl[#hl + 1] = hl_group and fzf.utils.ansi_from_hl(hl_group, text:content()) or text:content()
end
return {
message = message,
ordinal = message:content(),
display = table.concat(hl, ""),
}
end
function M.find()
local messages = Manager.get(Config.options.commands.history.filter, {
history = true,
sort = true,
reverse = true,
})
---@type table<number, NoiceEntry>
local ret = {}
for _, message in ipairs(messages) do
ret[message.id] = M.entry(message)
end
return ret
end
---@param messages table<number, NoiceEntry>
function M.previewer(messages)
local previewer = builtin.buffer_or_file:extend()
function previewer:new(o, opts, fzf_win)
previewer.super.new(self, o, opts, fzf_win)
self.title = "Noice"
setmetatable(self, previewer)
return self
end
function previewer:parse_entry(entry_str)
local id = tonumber(entry_str:match("^%d+"))
local entry = messages[id]
assert(entry, "No message found for entry: " .. entry_str)
return entry
end
function previewer:populate_preview_buf(entry_str)
local buf = self:get_tmp_buffer()
local entry = self:parse_entry(entry_str)
assert(entry, "No message found for entry: " .. entry_str)
---@type NoiceMessage
local m = Format.format(entry.message, "fzf_preview")
m:render(buf, Config.ns)
self:set_preview_buf(buf)
self.win:update_title(" Noice ")
self.win:update_scrollbar()
end
return previewer
end
---@param opts? table<string, any>
function M.open(opts)
local messages = M.find()
opts = vim.tbl_deep_extend("force", opts or {}, {
prompt = false,
winopts = {
title = " Noice ",
title_pos = "center",
preview = {
title = " Noice ",
title_pos = "center",
},
},
previewer = M.previewer(messages),
fzf_opts = {
["--no-multi"] = "",
["--with-nth"] = "2..",
},
actions = {
default = function() end,
},
})
local lines = vim.tbl_map(function(entry)
return entry.display
end, vim.tbl_values(messages))
return fzf.fzf_exec(lines, opts)
end
return M

View File

@ -0,0 +1,3 @@
#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash
nvim -l tests/minit.lua --minitest

View File

@ -0,0 +1,15 @@
#!/usr/bin/env -S nvim -l
vim.env.LAZY_STDPATH = ".tests"
vim.env.LAZY_PATH = vim.fs.normalize("~/projects/lazy.nvim")
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
-- Setup lazy.nvim
require("lazy.minit").setup({
spec = {
{
dir = vim.uv.cwd(),
opts = {},
},
},
})