Compare commits
7 Commits
870758fc6e
...
873b17f69e
Author | SHA1 | Date | |
---|---|---|---|
873b17f69e | |||
d302b91b6f | |||
12c0a32a80 | |||
9f6988687a | |||
ad8e26fe6c | |||
3eb9864112 | |||
6d07d72121 |
@ -86,8 +86,8 @@ M.setup = function()
|
|||||||
|
|
||||||
---@type string? The file extension if detected
|
---@type string? The file extension if detected
|
||||||
local extension = vim.fn.fnamemodify(path, ":e")
|
local extension = vim.fn.fnamemodify(path, ":e")
|
||||||
---@type string? The filename if detected
|
---@type string The filename if detected
|
||||||
local filename = vim.fn.fnamemodify(path, ":t")
|
local filename = vim.fn.fnamemodify(path, ":t") or "[Unknown Filename]"
|
||||||
|
|
||||||
---Open a given file path in a given program and remove the buffer for the file.
|
---Open a given file path in a given program and remove the buffer for the file.
|
||||||
---@param buf integer The buffer handle for the opening buffer
|
---@param buf integer The buffer handle for the opening buffer
|
||||||
@ -104,35 +104,22 @@ M.setup = function()
|
|||||||
vim.api.nvim_buf_delete(buf, { force = true })
|
vim.api.nvim_buf_delete(buf, { force = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
local extension_callbacks = {
|
local extensions = {
|
||||||
["pdf"] = open_mime,
|
"pdf",
|
||||||
["djvu"] = "pdf",
|
"djvu",
|
||||||
["wav"] = open_mime,
|
"wav",
|
||||||
["png"] = open_mime,
|
"png",
|
||||||
["jpg"] = "png",
|
"jpg",
|
||||||
["docx"] = open_mime,
|
"docx",
|
||||||
["mp4"] = open_mime,
|
"mp4",
|
||||||
["webm"] = open_mime,
|
"webm",
|
||||||
["pptx"] = open_mime,
|
"pptx",
|
||||||
["gif"] = "mp4",
|
"gif",
|
||||||
}
|
}
|
||||||
|
|
||||||
---Get the extension callback for a given extension. Will do a recursive lookup if an extension callback is actually
|
if extension and not extension:match("^%s*$") and intercept_file_open then
|
||||||
---of type string to get the correct extension
|
if vim.list_contains(extensions, extension) then
|
||||||
---@param ext string A file extension. Example: `png`.
|
open_mime(bufnr, path, filename)
|
||||||
---@return fun(bufnr: integer, path: string, filename: string?) extension_callback The extension callback to invoke, expects a buffer handle, file path, and filename.
|
|
||||||
local function extension_lookup(ext)
|
|
||||||
local callback = extension_callbacks[ext]
|
|
||||||
if type(callback) == "string" then
|
|
||||||
callback = extension_lookup(callback)
|
|
||||||
end
|
|
||||||
return callback
|
|
||||||
end
|
|
||||||
|
|
||||||
if extension ~= nil and not extension:match("^%s*$") and intercept_file_open then
|
|
||||||
local callback = extension_lookup(extension)
|
|
||||||
if type(callback) == "function" then
|
|
||||||
callback(bufnr, path, filename)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -1,14 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
{
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
opts = {
|
|
||||||
current_line_blame = true,
|
|
||||||
current_line_blame_opts = {
|
|
||||||
delay = 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
keys = {
|
keys = {
|
||||||
|
@ -1108,7 +1108,7 @@ return {
|
|||||||
disable_winbar_cb = function(args)
|
disable_winbar_cb = function(args)
|
||||||
return conditions.buffer_matches({
|
return conditions.buffer_matches({
|
||||||
buftype = { "nofile", "prompt", "quickfix", "terminal" },
|
buftype = { "nofile", "prompt", "quickfix", "terminal" },
|
||||||
filetype = { "fugitive", "Trouble", "dashboard", ".*neogit.*", "no-neck-pain" },
|
filetype = { "fugitive", "Trouble", "dashboard", ".*neogit.*", "Overseer.*" },
|
||||||
}, args.buf)
|
}, args.buf)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"RaafatTurki/hex.nvim",
|
|
||||||
opts = {
|
|
||||||
-- Make it explicit, auto detection is cool and all, but annoying for my use case
|
|
||||||
is_buf_binary_pre_read = function()
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
is_buf_binary_post_read = function()
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"HexDump",
|
|
||||||
"HexAssemble",
|
|
||||||
"HexToggle",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"shortcuts/no-neck-pain.nvim",
|
|
||||||
opts = {
|
|
||||||
width = 160,
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"NoNeckPain",
|
|
||||||
"NoNeckPainResize",
|
|
||||||
"NoNeckPainWidthDown",
|
|
||||||
"NoNeckPainScratchPad",
|
|
||||||
"NoNeckPainToggleLeftSide",
|
|
||||||
"NoNeckPainToggleRightSide",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<localleader>b", "<cmd>NoNeckPain<cr>", desc = "NoNeckPain: Toggle" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -0,0 +1,61 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/overseer.nvim",
|
||||||
|
cmd = {
|
||||||
|
"OverseerOpen",
|
||||||
|
"OverseerClose",
|
||||||
|
"OverseerToggle",
|
||||||
|
"OverseerSaveBundle",
|
||||||
|
"OverseerLoadBundle",
|
||||||
|
"OverseerDeleteBundle",
|
||||||
|
"OverseerRunCmd",
|
||||||
|
"OverseerRun",
|
||||||
|
"OverseerInfo",
|
||||||
|
"OverseerBuild",
|
||||||
|
"OverseerQuickAction",
|
||||||
|
"OverseerTaskAction",
|
||||||
|
"OverseerClearCache",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>r", desc = "Overseer" },
|
||||||
|
{ "<leader>rr", "<cmd>OverseerRun<CR>", desc = "Overseer: Run" },
|
||||||
|
{ "<leader>rt", "<cmd>OverseerToggle<CR>", desc = "Overseer: Toggle" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local overseer = require("overseer")
|
||||||
|
overseer.setup()
|
||||||
|
local tempname_caches = {}
|
||||||
|
|
||||||
|
--- Get a temp file bound to the bufnr
|
||||||
|
local function tempname()
|
||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
if not tempname_caches[bufnr] then
|
||||||
|
tempname_caches[bufnr] = vim.fn.tempname()
|
||||||
|
end
|
||||||
|
return tempname_caches[bufnr]
|
||||||
|
end
|
||||||
|
overseer.register_template(
|
||||||
|
---@type overseer.TemplateDefinition
|
||||||
|
{
|
||||||
|
name = "Watch Typst",
|
||||||
|
desc = "Run `typst watch` and view the PDF",
|
||||||
|
---@return overseer.TaskDefinition
|
||||||
|
builder = function(_)
|
||||||
|
return {
|
||||||
|
cmd = {
|
||||||
|
"typst",
|
||||||
|
"watch",
|
||||||
|
"--open=xdg-open",
|
||||||
|
vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
|
||||||
|
tempname() .. ".pdf",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
condition = {
|
||||||
|
filetype = "typst",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"chomosuke/typst-preview.nvim",
|
|
||||||
ft = "typst",
|
|
||||||
build = function()
|
|
||||||
require("typst-preview").update()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
@ -320,3 +320,5 @@ lookups
|
|||||||
incrementing
|
incrementing
|
||||||
rebalance
|
rebalance
|
||||||
backend
|
backend
|
||||||
|
STDIN
|
||||||
|
stdin
|
||||||
|
Binary file not shown.
@ -23,7 +23,7 @@
|
|||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
"MessageAccessoriesAPI": {
|
"MessageAccessoriesAPI": {
|
||||||
"enabled": false
|
"enabled": true
|
||||||
},
|
},
|
||||||
"MessageDecorationsAPI": {
|
"MessageDecorationsAPI": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
@ -681,6 +681,9 @@
|
|||||||
},
|
},
|
||||||
"SettingsStoreAPI": {
|
"SettingsStoreAPI": {
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
},
|
||||||
|
"UserSettingsAPI": {
|
||||||
|
"enabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
@ -693,6 +696,6 @@
|
|||||||
"authenticated": false,
|
"authenticated": false,
|
||||||
"url": "https://api.vencord.dev/",
|
"url": "https://api.vencord.dev/",
|
||||||
"settingsSync": false,
|
"settingsSync": false,
|
||||||
"settingsSyncVersion": 1718769847454
|
"settingsSyncVersion": 1719128377334
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user