try and make everything confined to 80chars

This commit is contained in:
2025-05-18 22:32:28 -04:00
parent d0155fcc7c
commit f9311db805
6 changed files with 38 additions and 20 deletions

View File

@ -9,7 +9,8 @@ end
-- bootstrap plugin manager -- bootstrap plugin manager
local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep" local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep"
if vim.fn.empty(vim.fn.glob(path)) > 0 then if vim.fn.empty(vim.fn.glob(path)) > 0 then
vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", path }) vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep",
path })
end end
vim.cmd("packadd dep") vim.cmd("packadd dep")
@ -32,8 +33,10 @@ require("dep") {
-- aquire all plugin specs -- aquire all plugin specs
local plugs = {} local plugs = {}
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/conf/plugins/*.lua", true)) do for _, file in ipairs(vim.api.nvim_get_runtime_file(
local ret = misc.include("conf.plugins."..file:gsub("^.*/", ""):gsub("%.lua$", "")) "lua/conf/plugins/*.lua", true)) do
local ret = misc.include("conf.plugins."..file:gsub("^.*/",
""):gsub("%.lua$", ""))
if type(ret) ~= "boolean" then if type(ret) ~= "boolean" then
plugs[#plugs + 1] = ret plugs[#plugs + 1] = ret
end end

View File

@ -24,14 +24,22 @@ map("n", "<leader>x", function() -- execute order 111
if vim.fn.getftype(fn) == "file" then if vim.fn.getftype(fn) == "file" then
local perm = vim.fn.getfperm(fn) local perm = vim.fn.getfperm(fn)
if string.match(perm, "x", 3) then if string.match(perm, "x", 3) then
vim.notify("Removed executable flags", vim.log.levels.INFO, { title = misc.appid }) vim.notify("Removed executable flags", vim.log.levels.INFO, {
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."-"..string.sub(fn, 4, 5).."-"..string.sub(fn, 7, 8).."-") title = misc.appid
})
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."-"..string.sub(fn, 4, 5).."-"
..string.sub(fn, 7, 8).."-")
else else
vim.notify("Add executable flags", vim.log.levels.INFO, { title = misc.appid }) vim.notify("Add executable flags", vim.log.levels.INFO, {
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."x"..string.sub(fn, 4, 5).."x"..string.sub(fn, 7, 8).."x") title = misc.appid
})
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."x"..string.sub(fn, 4, 5).."x"
..string.sub(fn, 7, 8).."x")
end end
else else
vim.notify("File doesn't exist", vim.log.levels.INFO, { title = misc.appid }) vim.notify("File doesn't exist", vim.log.levels.INFO, {
title = misc.appid
})
end end
end, { desc = "toggle executable flag of the file" }) end, { desc = "toggle executable flag of the file" })
@ -50,7 +58,8 @@ vim.keymap.set("n", "z=", function()
end end
local cword = vim.fn.expand("<cword>") local cword = vim.fn.expand("<cword>")
local prompt = "Change "..vim.inspect(cword).." to:" local prompt = "Change "..vim.inspect(cword).." to:"
vim.ui.select(vim.fn.spellsuggest(cword, vim.o.lines), { prompt = prompt }, spell_on_choice) vim.ui.select(vim.fn.spellsuggest(cword, vim.o.lines), { prompt = prompt },
spell_on_choice)
end, { desc = "Shows spelling suggestions" }) end, { desc = "Shows spelling suggestions" })
-- quickfix -- quickfix

View File

@ -13,9 +13,8 @@ return { "ThePrimeagen/harpoon",
map("n", "<leader>a", function() map("n", "<leader>a", function()
harpoon:list():add() harpoon:list():add()
vim.notify("added "..vim.fn.expand("%:t").." to quickmarks", vim.log.levels.INFO, { vim.notify("added "..vim.fn.expand("%:t").." to quickmarks",
title = misc.appid vim.log.levels.INFO, { title = misc.appid })
})
end, { desc = "add current file to quickmarks" }) end, { desc = "add current file to quickmarks" })
map("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) map("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)

View File

@ -56,7 +56,8 @@ return { "L3MON4D3/LuaSnip",
end) end)
-- load all snippets from snippet directory -- load all snippets from snippet directory
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua", true)) do for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
true)) do
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "") local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
local ret = misc.include("snippets."..fn) local ret = misc.include("snippets."..fn)
if type(ret) ~= "boolean" then if type(ret) ~= "boolean" then

View File

@ -6,7 +6,8 @@ local function parse_output(proc)
local result = proc:wait() local result = proc:wait()
local ret = {} local ret = {}
if result.code == 0 then if result.code == 0 then
for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do for line in vim.gsplit(result.stdout, "\n", {
plain = true, trimempty = true }) do
-- Remove trailing slash -- Remove trailing slash
line = line:gsub("/$", "") line = line:gsub("/$", "")
ret[line] = true ret[line] = true
@ -20,16 +21,20 @@ local function new_git_status()
return setmetatable({}, { return setmetatable({}, {
__index = function(self, key) __index = function(self, key)
local ignore_proc = vim.system( local ignore_proc = vim.system(
{ "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" }, { "git", "ls-files", "--ignored", "--exclude-standard", "--others",
"--directory" },
{
cwd = key,
text = true,
}
)
local tracked_proc = vim.system({ "git", "ls-tree", "HEAD",
"--name-only" },
{ {
cwd = key, cwd = key,
text = true, text = true,
} }
) )
local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
cwd = key,
text = true,
})
local ret = { local ret = {
ignored = parse_output(ignore_proc), ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc), tracked = parse_output(tracked_proc),

View File

@ -48,7 +48,8 @@ return { "nvim-treesitter/nvim-treesitter",
-- disable in big files -- disable in big files
-- TODO: update before nvim 1.0 when vim.loop is removed -- TODO: update before nvim 1.0 when vim.loop is removed
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) local ok, stats = pcall(vim.loop.fs_stat,
vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then
return true return true
end end