Update generated neovim config
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
5
config/neovim/store/lazy-plugins/noice.nvim/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
config/neovim/store/lazy-plugins/noice.nvim/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal 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
|
||||
16
config/neovim/store/lazy-plugins/noice.nvim/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
config/neovim/store/lazy-plugins/noice.nvim/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal 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. -->
|
||||
|
||||
6
config/neovim/store/lazy-plugins/noice.nvim/.github/dependabot.yml
vendored
Normal file
6
config/neovim/store/lazy-plugins/noice.nvim/.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
8
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/labeler.yml
vendored
Normal file
8
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
name: "PR Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
uses: folke/github/.github/workflows/labeler.yml@main
|
||||
secrets: inherit
|
||||
18
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/pr.yml
vendored
Normal file
18
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/pr.yml
vendored
Normal 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
|
||||
11
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/stale.yml
vendored
Normal file
11
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/stale.yml
vendored
Normal 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
|
||||
13
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/update.yml
vendored
Normal file
13
config/neovim/store/lazy-plugins/noice.nvim/.github/workflows/update.yml
vendored
Normal 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
|
||||
7
config/neovim/store/lazy-plugins/noice.nvim/lazy.lua
Normal file
7
config/neovim/store/lazy-plugins/noice.nvim/lazy.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
-- nui.nvim can be lazy loaded
|
||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
},
|
||||
}
|
||||
@ -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
|
||||
3
config/neovim/store/lazy-plugins/noice.nvim/scripts/test
Executable file
3
config/neovim/store/lazy-plugins/noice.nvim/scripts/test
Executable file
@ -0,0 +1,3 @@
|
||||
#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash
|
||||
|
||||
nvim -l tests/minit.lua --minitest
|
||||
15
config/neovim/store/lazy-plugins/noice.nvim/tests/minit.lua
Normal file
15
config/neovim/store/lazy-plugins/noice.nvim/tests/minit.lua
Normal 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 = {},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user