New nvim config, add mangohud
This commit is contained in:
44
config/MangoHud/MangoHud.conf
Normal file
44
config/MangoHud/MangoHud.conf
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
################### File Generated by Goverlay ###################
|
||||||
|
legacy_layout=false
|
||||||
|
|
||||||
|
|
||||||
|
background_alpha=0.6
|
||||||
|
round_corners=0
|
||||||
|
background_alpha=0.6
|
||||||
|
background_color=000000
|
||||||
|
|
||||||
|
font_size=24
|
||||||
|
text_color=FFFFFF
|
||||||
|
position=top-left
|
||||||
|
toggle_hud=Shift_R+F12
|
||||||
|
pci_dev=0:03:00.0
|
||||||
|
table_columns=3
|
||||||
|
gpu_text=GPU
|
||||||
|
gpu_stats
|
||||||
|
gpu_temp
|
||||||
|
gpu_mem_temp
|
||||||
|
cpu_text=CPU
|
||||||
|
cpu_stats
|
||||||
|
|
||||||
|
cpu_temp
|
||||||
|
vram
|
||||||
|
vram_color=AD64C1
|
||||||
|
ram
|
||||||
|
ram_color=C26693
|
||||||
|
fps
|
||||||
|
fps_limit_method=late
|
||||||
|
toggle_fps_limit=Shift_L+F1
|
||||||
|
|
||||||
|
fps_limit=0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
output_folder=/home/mitch
|
||||||
|
log_duration=30
|
||||||
|
autostart_log=0
|
||||||
|
log_interval=100
|
||||||
|
toggle_logging=Shift_L+F2
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
-- This script skips sponsored segments of YouTube videos
|
-- This script skips sponsored segments of YouTube videos
|
||||||
-- using data from https://github.com/ajayyy/SponsorBlock
|
-- using data from https://github.com/ajayyy/SponsorBlock
|
||||||
|
|
||||||
local ON_WINDOWS = package.config:sub(1,1) ~= "/"
|
local ON_WINDOWS = package.config:sub(1, 1) ~= "/"
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
server_address = "https://sponsor.ajay.app",
|
server_address = "https://sponsor.ajay.app",
|
||||||
@@ -14,7 +14,7 @@ local options = {
|
|||||||
categories = "sponsor,intro,outro,interaction,selfpromo,filler",
|
categories = "sponsor,intro,outro,interaction,selfpromo,filler",
|
||||||
|
|
||||||
-- Categories to skip automatically
|
-- Categories to skip automatically
|
||||||
skip_categories = "sponsor, intro, selfpromo",
|
skip_categories = "sponsor,intro,selfpromo",
|
||||||
|
|
||||||
-- If true, sponsored segments will only be skipped once
|
-- If true, sponsored segments will only be skipped once
|
||||||
skip_once = true,
|
skip_once = true,
|
||||||
@@ -96,19 +96,20 @@ scripts_dir = mp.find_config_file("scripts")
|
|||||||
|
|
||||||
local sponsorblock = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.py")
|
local sponsorblock = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.py")
|
||||||
local uid_path = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.txt")
|
local uid_path = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.txt")
|
||||||
local database_file = options.local_database and utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.db") or ""
|
local database_file = options.local_database and utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.db") or
|
||||||
|
""
|
||||||
local youtube_id = nil
|
local youtube_id = nil
|
||||||
local ranges = {}
|
local ranges = {}
|
||||||
local init = false
|
local init = false
|
||||||
local segment = {a = 0, b = 0, progress = 0, first = true}
|
local segment = { a = 0, b = 0, progress = 0, first = true }
|
||||||
local retrying = false
|
local retrying = false
|
||||||
local last_skip = {uuid = "", dir = nil}
|
local last_skip = { uuid = "", dir = nil }
|
||||||
local speed_timer = nil
|
local speed_timer = nil
|
||||||
local fade_timer = nil
|
local fade_timer = nil
|
||||||
local fade_dir = nil
|
local fade_dir = nil
|
||||||
local volume_before = mp.get_property_number("volume")
|
local volume_before = mp.get_property_number("volume")
|
||||||
local categories = {}
|
local categories = {}
|
||||||
local all_categories = {"sponsor", "intro", "outro", "interaction", "selfpromo", "preview", "music_offtopic", "filler"}
|
local all_categories = { "sponsor", "intro", "outro", "interaction", "selfpromo", "preview", "music_offtopic", "filler" }
|
||||||
local chapter_cache = {}
|
local chapter_cache = {}
|
||||||
|
|
||||||
for category in string.gmatch(options.skip_categories, "([^,]+)") do
|
for category in string.gmatch(options.skip_categories, "([^,]+)") do
|
||||||
@@ -116,8 +117,11 @@ for category in string.gmatch(options.skip_categories, "([^,]+)") do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function file_exists(name)
|
function file_exists(name)
|
||||||
local f = io.open(name,"r")
|
local f = io.open(name, "r")
|
||||||
if f ~= nil then io.close(f) return true else return false end
|
if f ~= nil then
|
||||||
|
io.close(f)
|
||||||
|
return true
|
||||||
|
else return false end
|
||||||
end
|
end
|
||||||
|
|
||||||
function t_count(t)
|
function t_count(t)
|
||||||
@@ -167,7 +171,8 @@ end
|
|||||||
function create_chapter(chapter_title, chapter_time)
|
function create_chapter(chapter_title, chapter_time)
|
||||||
local chapters = mp.get_property_native("chapter-list")
|
local chapters = mp.get_property_native("chapter-list")
|
||||||
local duration = mp.get_property_native("duration")
|
local duration = mp.get_property_native("duration")
|
||||||
table.insert(chapters, {title=chapter_title, time=(duration == nil or duration > chapter_time) and chapter_time or duration - .001})
|
table.insert(chapters,
|
||||||
|
{ title = chapter_title, time = (duration == nil or duration > chapter_time) and chapter_time or duration - .001 })
|
||||||
table.sort(chapters, time_sort)
|
table.sort(chapters, time_sort)
|
||||||
mp.set_property_native("chapter-list", chapters)
|
mp.set_property_native("chapter-list", chapters)
|
||||||
end
|
end
|
||||||
@@ -230,9 +235,9 @@ function getranges(_, exists, db, more)
|
|||||||
tostring(options.sha256_length)
|
tostring(options.sha256_length)
|
||||||
}
|
}
|
||||||
if not legacy then
|
if not legacy then
|
||||||
sponsors = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
|
sponsors = mp.command_native({ name = "subprocess", capture_stdout = true, playback_only = false, args = args })
|
||||||
else
|
else
|
||||||
sponsors = utils.subprocess({args = args})
|
sponsors = utils.subprocess({ args = args })
|
||||||
end
|
end
|
||||||
mp.msg.debug("Got: " .. string.gsub(sponsors.stdout, "[\n\r]", ""))
|
mp.msg.debug("Got: " .. string.gsub(sponsors.stdout, "[\n\r]", ""))
|
||||||
if not string.match(sponsors.stdout, "^%s*(.*%S)") then return end
|
if not string.match(sponsors.stdout, "^%s*(.*%S)") then return end
|
||||||
@@ -291,7 +296,7 @@ function skip_ads(name, pos)
|
|||||||
mp.osd_message("[sponsorblock] skipping " .. t.category)
|
mp.osd_message("[sponsorblock] skipping " .. t.category)
|
||||||
end
|
end
|
||||||
t.skipped = true
|
t.skipped = true
|
||||||
last_skip = {uuid = uuid, dir = nil}
|
last_skip = { uuid = uuid, dir = nil }
|
||||||
if options.report_views or options.auto_upvote then
|
if options.report_views or options.auto_upvote then
|
||||||
local args = {
|
local args = {
|
||||||
options.python_path,
|
options.python_path,
|
||||||
@@ -307,9 +312,9 @@ function skip_ads(name, pos)
|
|||||||
options.auto_upvote and "1" or ""
|
options.auto_upvote and "1" or ""
|
||||||
}
|
}
|
||||||
if not legacy then
|
if not legacy then
|
||||||
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
|
mp.command_native_async({ name = "subprocess", playback_only = false, args = args }, function() end)
|
||||||
else
|
else
|
||||||
utils.subprocess_detached({args = args})
|
utils.subprocess_detached({ args = args })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if options.fast_forward ~= false then
|
if options.fast_forward ~= false then
|
||||||
@@ -363,28 +368,32 @@ function vote(dir)
|
|||||||
dir
|
dir
|
||||||
}
|
}
|
||||||
if not legacy then
|
if not legacy then
|
||||||
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
|
mp.command_native_async({ name = "subprocess", playback_only = false, args = args }, function() end)
|
||||||
else
|
else
|
||||||
utils.subprocess({args = args})
|
utils.subprocess({ args = args })
|
||||||
end
|
end
|
||||||
mp.osd_message("[sponsorblock] " .. updown .. "vote submitted")
|
mp.osd_message("[sponsorblock] " .. updown .. "vote submitted")
|
||||||
end
|
end
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
mp.command_native_async({name = "subprocess", playback_only = false, args = {
|
mp.command_native_async({
|
||||||
|
name = "subprocess",
|
||||||
|
playback_only = false,
|
||||||
|
args = {
|
||||||
options.python_path,
|
options.python_path,
|
||||||
sponsorblock,
|
sponsorblock,
|
||||||
"update",
|
"update",
|
||||||
database_file,
|
database_file,
|
||||||
options.server_address
|
options.server_address
|
||||||
}}, getranges)
|
}
|
||||||
|
}, getranges)
|
||||||
end
|
end
|
||||||
|
|
||||||
function file_loaded()
|
function file_loaded()
|
||||||
local initialized = init
|
local initialized = init
|
||||||
ranges = {}
|
ranges = {}
|
||||||
segment = {a = 0, b = 0, progress = 0, first = true}
|
segment = { a = 0, b = 0, progress = 0, first = true }
|
||||||
last_skip = {uuid = "", dir = nil}
|
last_skip = { uuid = "", dir = nil }
|
||||||
chapter_cache = {}
|
chapter_cache = {}
|
||||||
local video_path = mp.get_property("path", "")
|
local video_path = mp.get_property("path", "")
|
||||||
mp.msg.debug("Path: " .. video_path)
|
mp.msg.debug("Path: " .. video_path)
|
||||||
@@ -441,9 +450,9 @@ function file_loaded()
|
|||||||
options.display_name
|
options.display_name
|
||||||
}
|
}
|
||||||
if not legacy then
|
if not legacy then
|
||||||
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
|
mp.command_native_async({ name = "subprocess", playback_only = false, args = args }, function() end)
|
||||||
else
|
else
|
||||||
utils.subprocess_detached({args = args})
|
utils.subprocess_detached({ args = args })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not options.local_database or (not options.auto_update and file_exists(database_file)) then return end
|
if not options.local_database or (not options.auto_update and file_exists(database_file)) then return end
|
||||||
@@ -488,8 +497,8 @@ end
|
|||||||
|
|
||||||
function select_category(selected)
|
function select_category(selected)
|
||||||
for category in string.gmatch(options.categories, "([^,]+)") do
|
for category in string.gmatch(options.categories, "([^,]+)") do
|
||||||
mp.remove_key_binding("select_category_"..category)
|
mp.remove_key_binding("select_category_" .. category)
|
||||||
mp.remove_key_binding("kp_select_category_"..category)
|
mp.remove_key_binding("kp_select_category_" .. category)
|
||||||
end
|
end
|
||||||
submit_segment(selected)
|
submit_segment(selected)
|
||||||
end
|
end
|
||||||
@@ -506,10 +515,17 @@ function submit_segment(category)
|
|||||||
for category_id, category in pairs(all_categories) do
|
for category_id, category in pairs(all_categories) do
|
||||||
local category_title = (category:gsub("^%l", string.upper):gsub("_", " "))
|
local category_title = (category:gsub("^%l", string.upper):gsub("_", " "))
|
||||||
category_list = category_list .. category_id .. ": " .. category_title .. "\n"
|
category_list = category_list .. category_id .. ": " .. category_title .. "\n"
|
||||||
mp.add_forced_key_binding(tostring(category_id), "select_category_"..category, function() select_category(category) end)
|
mp.add_forced_key_binding(tostring(category_id), "select_category_" .. category,
|
||||||
mp.add_forced_key_binding("KP"..tostring(category_id), "kp_select_category_"..category, function() select_category(category) end)
|
function() select_category(category) end)
|
||||||
|
mp.add_forced_key_binding("KP" .. tostring(category_id), "kp_select_category_" .. category,
|
||||||
|
function() select_category(category) end)
|
||||||
end
|
end
|
||||||
mp.osd_message(string.format("[sponsorblock] press a number to select category for segment: %.2d:%.2d:%.2d to %.2d:%.2d:%.2d\n\n" .. category_list .. "\nyou can press Shift+G again for default (Sponsor) or hide this message with g", math.floor(start_time/(60*60)), math.floor(start_time/60%60), math.floor(start_time%60), math.floor(end_time/(60*60)), math.floor(end_time/60%60), math.floor(end_time%60)), 30)
|
mp.osd_message(
|
||||||
|
string.format(
|
||||||
|
"[sponsorblock] press a number to select category for segment: %.2d:%.2d:%.2d to %.2d:%.2d:%.2d\n\n" ..
|
||||||
|
category_list .. "\nyou can press Shift+G again for default (Sponsor) or hide this message with g",
|
||||||
|
math.floor(start_time / (60 * 60)), math.floor(start_time / 60 % 60), math.floor(start_time % 60),
|
||||||
|
math.floor(end_time / (60 * 60)), math.floor(end_time / 60 % 60), math.floor(end_time % 60)), 30)
|
||||||
else
|
else
|
||||||
mp.osd_message("[sponsorblock] submitting segment...", 30)
|
mp.osd_message("[sponsorblock] submitting segment...", 30)
|
||||||
local submit
|
local submit
|
||||||
@@ -527,12 +543,12 @@ function submit_segment(category)
|
|||||||
category or "sponsor"
|
category or "sponsor"
|
||||||
}
|
}
|
||||||
if not legacy then
|
if not legacy then
|
||||||
submit = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
|
submit = mp.command_native({ name = "subprocess", capture_stdout = true, playback_only = false, args = args })
|
||||||
else
|
else
|
||||||
submit = utils.subprocess({args = args})
|
submit = utils.subprocess({ args = args })
|
||||||
end
|
end
|
||||||
if string.match(submit.stdout, "success") then
|
if string.match(submit.stdout, "success") then
|
||||||
segment = {a = 0, b = 0, progress = 0, first = true}
|
segment = { a = 0, b = 0, progress = 0, first = true }
|
||||||
mp.osd_message("[sponsorblock] segment submitted")
|
mp.osd_message("[sponsorblock] segment submitted")
|
||||||
if options.make_chapters then
|
if options.make_chapters then
|
||||||
clean_chapters()
|
clean_chapters()
|
||||||
@@ -545,12 +561,12 @@ function submit_segment(category)
|
|||||||
mp.osd_message("[sponsorblock] segment submission failed, server is down. try again", 5)
|
mp.osd_message("[sponsorblock] segment submission failed, server is down. try again", 5)
|
||||||
elseif string.match(submit.stdout, "400") then
|
elseif string.match(submit.stdout, "400") then
|
||||||
mp.osd_message("[sponsorblock] segment submission failed, impossible inputs", 5)
|
mp.osd_message("[sponsorblock] segment submission failed, impossible inputs", 5)
|
||||||
segment = {a = 0, b = 0, progress = 0, first = true}
|
segment = { a = 0, b = 0, progress = 0, first = true }
|
||||||
elseif string.match(submit.stdout, "429") then
|
elseif string.match(submit.stdout, "429") then
|
||||||
mp.osd_message("[sponsorblock] segment submission failed, rate limited. try again", 5)
|
mp.osd_message("[sponsorblock] segment submission failed, rate limited. try again", 5)
|
||||||
elseif string.match(submit.stdout, "409") then
|
elseif string.match(submit.stdout, "409") then
|
||||||
mp.osd_message("[sponsorblock] segment already submitted", 3)
|
mp.osd_message("[sponsorblock] segment already submitted", 3)
|
||||||
segment = {a = 0, b = 0, progress = 0, first = true}
|
segment = { a = 0, b = 0, progress = 0, first = true }
|
||||||
else
|
else
|
||||||
mp.osd_message("[sponsorblock] segment submission failed", 5)
|
mp.osd_message("[sponsorblock] segment submission failed", 5)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
],
|
],
|
||||||
"news": {
|
"news": {
|
||||||
"NEWS.md": "3314"
|
"NEWS.md": "6077"
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 6
|
||||||
}
|
}
|
||||||
@@ -5,16 +5,17 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
|
-- add LazyVim and import its plugins
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
|
-- import any extras modules here
|
||||||
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
-- { import = "lazyvim.plugins.extras.lang.json" },
|
||||||
-- { import = "lazyvim.plugins.extras.lang.yaml" },
|
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||||
-- { import = "lazyvim.plugins.extras.lang.tailwind" },
|
-- import/override with your plugins
|
||||||
-- { import = "lazyvim.plugins.extras.lang.markdown" },
|
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
@@ -25,8 +26,8 @@ require("lazy").setup({
|
|||||||
-- have outdated releases, which may break your Neovim install.
|
-- have outdated releases, which may break your Neovim install.
|
||||||
version = false, -- always use the latest git commit
|
version = false, -- always use the latest git commit
|
||||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
|
-- colorscheme = "gruvbox",
|
||||||
},
|
},
|
||||||
-- install = { colorscheme = { "tokyonight", "habamax" } },
|
|
||||||
checker = { enabled = true }, -- automatically check for plugin updates
|
checker = { enabled = true }, -- automatically check for plugin updates
|
||||||
performance = {
|
performance = {
|
||||||
rtp = {
|
rtp = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
-- Options are automatically loaded before lazy.nvim startup
|
-- Options are automatically loaded before lazy.nvim startup
|
||||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||||
-- Add any additional options here
|
-- Add any additional options here
|
||||||
|
--
|
||||||
LazyVim.terminal.setup("fish")
|
LazyVim.terminal.setup("fish")
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|||||||
@@ -192,14 +192,6 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Use <tab> for completion and snippets (supertab)
|
-- Use <tab> for completion and snippets (supertab)
|
||||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
keys = function()
|
|
||||||
return {}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- then: setup supertab in cmp
|
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@@ -213,17 +205,16 @@ return {
|
|||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
elseif vim.snippet.active({ direction = 1 }) then
|
||||||
-- this way you will only jump inside the snippet region
|
vim.schedule(function()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
vim.snippet.jump(1)
|
||||||
luasnip.expand_or_jump()
|
end)
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
@@ -233,8 +224,10 @@ return {
|
|||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif vim.snippet.active({ direction = -1 }) then
|
||||||
luasnip.jump(-1)
|
vim.schedule(function()
|
||||||
|
vim.snippet.jump(-1)
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,12 +2,21 @@ return {
|
|||||||
-- add gruvbox
|
-- add gruvbox
|
||||||
{ "ellisonleao/gruvbox.nvim" },
|
{ "ellisonleao/gruvbox.nvim" },
|
||||||
|
|
||||||
|
-- Adding extras
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.toml" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.sql" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.vue" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||||
|
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
|
||||||
|
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
|
||||||
-- Configure LazyVim to load gruvbox
|
-- Configure LazyVim to load gruvbox
|
||||||
{
|
{
|
||||||
"LazyVim/LazyVim",
|
"LazyVim/LazyVim",
|
||||||
dependencies = {
|
|
||||||
"ellisonleao/gruvbox.nvim",
|
|
||||||
},
|
|
||||||
opts = {
|
opts = {
|
||||||
colorscheme = "gruvbox",
|
colorscheme = "gruvbox",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
return {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"bash-language-server",
|
|
||||||
"vue-language-server",
|
|
||||||
"dockerfile-language-server",
|
|
||||||
"typescript-language-server",
|
|
||||||
"html-lsp",
|
|
||||||
"marksman",
|
|
||||||
"csharp-language-server",
|
|
||||||
"sqls",
|
|
||||||
"json-lsp",
|
|
||||||
"phpactor"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
return {}
|
|
||||||
-- return {
|
|
||||||
-- "neovim/nvim-lspconfig",
|
|
||||||
-- opts = {
|
|
||||||
-- -- LSP Server Settings
|
|
||||||
-- ---@type lspconfig.options
|
|
||||||
-- servers = {
|
|
||||||
-- lua_ls = {
|
|
||||||
-- -- Use this to add any additional keymaps
|
|
||||||
-- -- for specific lsp servers
|
|
||||||
-- ---@type LazyKeysSpec[]
|
|
||||||
-- -- keys = {},
|
|
||||||
-- settings = {
|
|
||||||
-- Lua = {
|
|
||||||
-- workspace = {
|
|
||||||
-- checkThirdParty = false,
|
|
||||||
-- },
|
|
||||||
-- codeLens = {
|
|
||||||
-- enable = true,
|
|
||||||
-- },
|
|
||||||
-- completion = {
|
|
||||||
-- callSnippet = "Replace",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- -- tsserver = {},
|
|
||||||
-- biome = {},
|
|
||||||
-- volar = {
|
|
||||||
-- settings = {},
|
|
||||||
-- },
|
|
||||||
-- pyright = {},
|
|
||||||
-- },
|
|
||||||
-- -- return true if you don't want this server to be setup with lspconfig
|
|
||||||
-- ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
|
||||||
-- setup = {},
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
@@ -27,7 +27,7 @@ return {
|
|||||||
"scss",
|
"scss",
|
||||||
"dockerfile",
|
"dockerfile",
|
||||||
"c_sharp",
|
"c_sharp",
|
||||||
"php"
|
"php",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
],
|
],
|
||||||
"news": {
|
"news": {
|
||||||
"NEWS.md": "3314"
|
"NEWS.md": "6077"
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 6
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
-- bootstrap lazy.nvim
|
-- bootstrap lazy.nvim
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||||
@@ -8,13 +9,12 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
|||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
-- add LazyVim and import its plugins
|
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
-- import any extras modules here
|
|
||||||
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
-- { import = "lazyvim.plugins.extras.lang.json" },
|
||||||
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
-- { import = "lazyvim.plugins.extras.lang.yaml" },
|
||||||
-- import/override with your plugins
|
-- { import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||||
|
-- { import = "lazyvim.plugins.extras.lang.markdown" },
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
@@ -26,7 +26,7 @@ require("lazy").setup({
|
|||||||
version = false, -- always use the latest git commit
|
version = false, -- always use the latest git commit
|
||||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
},
|
},
|
||||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
-- install = { colorscheme = { "tokyonight", "habamax" } },
|
||||||
checker = { enabled = true }, -- automatically check for plugin updates
|
checker = { enabled = true }, -- automatically check for plugin updates
|
||||||
performance = {
|
performance = {
|
||||||
rtp = {
|
rtp = {
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ LazyVim.terminal.setup("fish")
|
|||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
opt.mouse = ""
|
opt.mouse = "a"
|
||||||
|
opt.termguicolors = true
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"ellisonleao/gruvbox.nvim",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"LazyVim/LazyVim",
|
|
||||||
opts = {
|
|
||||||
colorscheme = "gruvbox",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
return {
|
|
||||||
"lukas-reineke/headlines.nvim",
|
|
||||||
opts = function()
|
|
||||||
local opts = {}
|
|
||||||
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do
|
|
||||||
opts[ft] = {
|
|
||||||
headline_highlights = {},
|
|
||||||
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66
|
|
||||||
bullets = {},
|
|
||||||
}
|
|
||||||
for i = 1, 6 do
|
|
||||||
local hl = "Headline" .. i
|
|
||||||
vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true })
|
|
||||||
table.insert(opts[ft].headline_highlights, hl)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return opts
|
|
||||||
end,
|
|
||||||
ft = { "markdown", "norg", "rmd", "org" },
|
|
||||||
config = function(_, opts)
|
|
||||||
-- PERF: schedule to prevent headlines slowing down opening a file
|
|
||||||
vim.schedule(function()
|
|
||||||
require("headlines").setup(opts)
|
|
||||||
require("headlines").refresh()
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
15
config/nvim_old/lua/plugins/lazyvim.lua
Normal file
15
config/nvim_old/lua/plugins/lazyvim.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
return {
|
||||||
|
-- add gruvbox
|
||||||
|
{ "ellisonleao/gruvbox.nvim" },
|
||||||
|
|
||||||
|
-- Configure LazyVim to load gruvbox
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
dependencies = {
|
||||||
|
"ellisonleao/gruvbox.nvim",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
colorscheme = "gruvbox",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
return {
|
|
||||||
"iamcco/markdown-preview.nvim",
|
|
||||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
|
||||||
build = function()
|
|
||||||
vim.fn["mkdp#util#install"]()
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>cp",
|
|
||||||
ft = "markdown",
|
|
||||||
"<cmd>MarkdownPreviewToggle<cr>",
|
|
||||||
desc = "Markdown Preview",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[do FileType]])
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
return {
|
return {
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = {
|
||||||
vim.list_extend(opts.ensure_installed, {
|
ensure_installed = {
|
||||||
|
"bash-language-server",
|
||||||
"vue-language-server",
|
"vue-language-server",
|
||||||
"biome",
|
"dockerfile-language-server",
|
||||||
"ast-grep",
|
"typescript-language-server",
|
||||||
"sqlls",
|
"html-lsp",
|
||||||
"marksman",
|
"marksman",
|
||||||
"markdownlint",
|
"csharp-language-server",
|
||||||
"js-debug-adapter",
|
"sqls",
|
||||||
})
|
"json-lsp",
|
||||||
end,
|
"phpactor"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
|
||||||
cmd = "Neotree",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>fe",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
|
|
||||||
end,
|
|
||||||
desc = "Explorer NeoTree (Root Dir)",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>fE",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
|
|
||||||
end,
|
|
||||||
desc = "Explorer NeoTree (cwd)",
|
|
||||||
},
|
|
||||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
|
|
||||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
|
||||||
{
|
|
||||||
"<leader>ge",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
|
||||||
end,
|
|
||||||
desc = "Git Explorer",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>be",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
|
||||||
end,
|
|
||||||
desc = "Buffer Explorer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
deactivate = function()
|
|
||||||
vim.cmd([[Neotree close]])
|
|
||||||
end,
|
|
||||||
init = function()
|
|
||||||
if vim.fn.argc(-1) == 1 then
|
|
||||||
local stat = vim.uv.fs_stat(vim.fn.argv(0))
|
|
||||||
if stat and stat.type == "directory" then
|
|
||||||
require("neo-tree")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
opts = {
|
opts = {
|
||||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||||
@@ -58,53 +13,5 @@ return {
|
|||||||
hide_gitignored = true,
|
hide_gitignored = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["<space>"] = "none",
|
|
||||||
["Y"] = {
|
|
||||||
function(state)
|
|
||||||
local node = state.tree:get_node()
|
|
||||||
local path = node:get_id()
|
|
||||||
vim.fn.setreg("+", path, "c")
|
|
||||||
end,
|
|
||||||
desc = "Copy Path to Clipboard",
|
|
||||||
},
|
},
|
||||||
["O"] = {
|
|
||||||
function(state)
|
|
||||||
require("lazy.util").open(state.tree:get_node().path, { system = true })
|
|
||||||
end,
|
|
||||||
desc = "Open with System Application",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
default_component_configs = {
|
|
||||||
indent = {
|
|
||||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
|
||||||
expander_collapsed = "",
|
|
||||||
expander_expanded = "",
|
|
||||||
expander_highlight = "NeoTreeExpander",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local function on_move(data)
|
|
||||||
LazyVim.lsp.on_rename(data.source, data.destination)
|
|
||||||
end
|
|
||||||
|
|
||||||
local events = require("neo-tree.events")
|
|
||||||
opts.event_handlers = opts.event_handlers or {}
|
|
||||||
vim.list_extend(opts.event_handlers, {
|
|
||||||
{ event = events.FILE_MOVED, handler = on_move },
|
|
||||||
{ event = events.FILE_RENAMED, handler = on_move },
|
|
||||||
})
|
|
||||||
require("neo-tree").setup(opts)
|
|
||||||
vim.api.nvim_create_autocmd("TermClose", {
|
|
||||||
pattern = "*lazygit",
|
|
||||||
callback = function()
|
|
||||||
if package.loaded["neo-tree.sources.git_status"] then
|
|
||||||
require("neo-tree.sources.git_status").refresh()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,38 @@
|
|||||||
return {
|
return {}
|
||||||
"neovim/nvim-lspconfig",
|
-- return {
|
||||||
---@class PluginLspOpts
|
-- "neovim/nvim-lspconfig",
|
||||||
opts = {
|
-- opts = {
|
||||||
---@type lspconfig.options
|
-- -- LSP Server Settings
|
||||||
servers = {
|
-- ---@type lspconfig.options
|
||||||
pyright = {},
|
-- servers = {
|
||||||
marksman = {},
|
-- lua_ls = {
|
||||||
--@type lspconfig.options.tsserver
|
-- -- Use this to add any additional keymaps
|
||||||
tsserver = {
|
-- -- for specific lsp servers
|
||||||
keys = {
|
-- ---@type LazyKeysSpec[]
|
||||||
{
|
-- -- keys = {},
|
||||||
"<leader>co",
|
-- settings = {
|
||||||
function()
|
-- Lua = {
|
||||||
vim.lsp.buf.code_action({
|
-- workspace = {
|
||||||
apply = true,
|
-- checkThirdParty = false,
|
||||||
context = {
|
-- },
|
||||||
only = { "source.organizeImports.ts" },
|
-- codeLens = {
|
||||||
diagnostics = {},
|
-- enable = true,
|
||||||
},
|
-- },
|
||||||
})
|
-- completion = {
|
||||||
end,
|
-- callSnippet = "Replace",
|
||||||
desc = "Organize Imports",
|
-- },
|
||||||
},
|
-- },
|
||||||
{
|
-- },
|
||||||
"<leader>cR",
|
-- },
|
||||||
function()
|
-- -- tsserver = {},
|
||||||
vim.lsp.buf.code_action({
|
-- biome = {},
|
||||||
apply = true,
|
-- volar = {
|
||||||
context = {
|
-- settings = {},
|
||||||
only = { "source.removeUnused.ts" },
|
-- },
|
||||||
diagnostics = {},
|
-- pyright = {},
|
||||||
},
|
-- },
|
||||||
})
|
-- -- return true if you don't want this server to be setup with lspconfig
|
||||||
end,
|
-- ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||||
desc = "Remove Unused Imports",
|
-- setup = {},
|
||||||
},
|
-- },
|
||||||
},
|
-- }
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
settings = {
|
|
||||||
completions = {
|
|
||||||
completeFunctionCalls = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ return {
|
|||||||
"vue",
|
"vue",
|
||||||
"xml",
|
"xml",
|
||||||
"csv",
|
"csv",
|
||||||
|
"css",
|
||||||
|
"scss",
|
||||||
|
"dockerfile",
|
||||||
|
"c_sharp",
|
||||||
|
"php"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
13
config/nvim_old/lua/plugins/telescope-fzf-native.lua
Normal file
13
config/nvim_old/lua/plugins/telescope-fzf-native.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable("make") == 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user