style: format with scripts/fmt.bash

This commit is contained in:
Price Hiller 2024-03-16 13:01:28 -05:00
parent 13169cdecd
commit c56f4ad68d
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
28 changed files with 172 additions and 236 deletions

View File

@ -3,7 +3,7 @@
main() { main() {
local mon_count local mon_count
mon_count="$(hyprctl monitors -j | jq length)" mon_count="$(hyprctl monitors -j | jq length)"
if (( mon_count > 1 )); then if ((mon_count > 1)); then
hyprctl keyword monitor "eDP-1, disable" hyprctl keyword monitor "eDP-1, disable"
fi fi
} }

View File

@ -19,7 +19,7 @@ M.setup = function()
local fts_to_lang_registration = { local fts_to_lang_registration = {
["azure-pipelines"] = "yaml", ["azure-pipelines"] = "yaml",
["dockerignore"] = "gitignore", ["dockerignore"] = "gitignore",
["zsh"] = "bash" ["zsh"] = "bash",
} }
vim.iter(fts_to_lang_registration):each(function(filetype, language) vim.iter(fts_to_lang_registration):each(function(filetype, language)

View File

@ -28,7 +28,7 @@ M.setup = function()
[vim.diagnostic.severity.WARN] = "", [vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "", [vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "", [vim.diagnostic.severity.HINT] = "",
} },
}, },
float = { float = {
focusable = true, focusable = true,

View File

@ -15,9 +15,9 @@ vim.g.neovide_remember_window_size = false
vim.g.neovide_fullscreen = false vim.g.neovide_fullscreen = false
-- Allow clipboard copy paste in neovim -- Allow clipboard copy paste in neovim
vim.keymap.set({ 'n', 'v' }, '<D-v>', '"+P') -- Paste normal and visual mode vim.keymap.set({ "n", "v" }, "<D-v>", '"+P') -- Paste normal and visual mode
vim.keymap.set({ 'i', 'c' }, '<D-v>', '<C-R>+') -- Paste insert and command mode vim.keymap.set({ "i", "c" }, "<D-v>", "<C-R>+") -- Paste insert and command mode
vim.keymap.set('t', '<D-v>', [[<C-\><C-N>"+P]]) -- Paste terminal mode vim.keymap.set("t", "<D-v>", [[<C-\><C-N>"+P]]) -- Paste terminal mode
-- Next/prev tabs -- Next/prev tabs
vim.keymap.set({ "", "!", "v", "t" }, "<D-x>", "<cmd>tabnext<CR>", { noremap = true, silent = true }) vim.keymap.set({ "", "!", "v", "t" }, "<D-x>", "<cmd>tabnext<CR>", { noremap = true, silent = true })
@ -25,4 +25,3 @@ vim.keymap.set({ "", "!", "v", "t" }, "<D-z>", "<cmd>tabprevious<CR>", { noremap
-- Spawn new terminal in new tab -- Spawn new terminal in new tab
vim.keymap.set({ "", "!", "v", "t" }, "<D-t>", "<cmd>tabnew | terminal<CR>", { noremap = true, silent = true }) vim.keymap.set({ "", "!", "v", "t" }, "<D-t>", "<cmd>tabnew | terminal<CR>", { noremap = true, silent = true })

View File

@ -2,7 +2,7 @@ return {
{ {
"LunarVim/bigfile.nvim", "LunarVim/bigfile.nvim",
opts = { opts = {
filesize = 10 filesize = 10,
} },
} },
} }

View File

@ -272,7 +272,10 @@ return {
--- If the completion item looks like a file path and exists, go ahead and --- If the completion item looks like a file path and exists, go ahead and
--- abbreviate it relative to the home directory --- abbreviate it relative to the home directory
if vim.fn.isdirectory(completion_item.abbr) == 1 or vim.fn.filereadable(completion_item.abbr) == 1 then if
vim.fn.isdirectory(completion_item.abbr) == 1
or vim.fn.filereadable(completion_item.abbr) == 1
then
completion_item.abbr = vim.fn.fnamemodify(completion_item.abbr, ":~") completion_item.abbr = vim.fn.fnamemodify(completion_item.abbr, ":~")
end end
@ -296,7 +299,7 @@ return {
disallow_fullfuzzy_matching = false, disallow_fullfuzzy_matching = false,
disallow_partial_matching = false, disallow_partial_matching = false,
disallow_fuzzy_matching = false, disallow_fuzzy_matching = false,
disallow_prefix_unmatching = false disallow_prefix_unmatching = false,
}, },
window = { window = {
documentation = { documentation = {
@ -433,7 +436,7 @@ return {
"!", "!",
}, },
}, },
priority = 100 priority = 100,
}, },
{ name = "cmdline_history", max_item_count = 3 }, { name = "cmdline_history", max_item_count = 3 },
{ name = "fuzzy_buffer", max_item_count = 3 }, { name = "fuzzy_buffer", max_item_count = 3 },

View File

@ -14,7 +14,7 @@ return {
end, end,
-- I know this is a lie below, but I'm used to the key being LSP bound, so fuck it -- I know this is a lie below, but I'm used to the key being LSP bound, so fuck it
desc = "LSP: Format", desc = "LSP: Format",
mode = { "v", "n" } mode = { "v", "n" },
}, },
}, },
opts = function() opts = function()

View File

@ -14,7 +14,7 @@ return {
icons = false, icons = false,
run_in_floaterm = true, run_in_floaterm = true,
trouble = true, trouble = true,
luasnip = true luasnip = true,
}) })
end, end,
event = { "CmdlineEnter" }, event = { "CmdlineEnter" },

View File

@ -52,8 +52,8 @@ return {
{ "NvimNotifyTrace", { fg = colors.oniViolet } }, { "NvimNotifyTrace", { fg = colors.oniViolet } },
{ "StatusLineNC", { bg = nil } }, { "StatusLineNC", { bg = nil } },
{ "WinBarNC", { bg = nil } }, { "WinBarNC", { bg = nil } },
{ "Visual", { bg = colors.sumiInk5 }}, { "Visual", { bg = colors.sumiInk5 } },
{ "CursorLine", { bg = colors.sumiInk4 }}, { "CursorLine", { bg = colors.sumiInk4 } },
{ "CursorLineNr", { fg = colors.roninYellow, bg = palette.theme.ui.bg_m1 } }, { "CursorLineNr", { fg = colors.roninYellow, bg = palette.theme.ui.bg_m1 } },
{ "CursorLineFold", { fg = colors.crystalBlue, bg = palette.theme.ui.bg_m1 } }, { "CursorLineFold", { fg = colors.crystalBlue, bg = palette.theme.ui.bg_m1 } },
{ "CursorLineSign", { bg = palette.theme.ui.bg_m1 } }, { "CursorLineSign", { bg = palette.theme.ui.bg_m1 } },
@ -194,7 +194,14 @@ return {
{ "TreesitterContext", { bg = colors.sumiInk0 } }, { "TreesitterContext", { bg = colors.sumiInk0 } },
{ "FloatTitle", { bg = "NONE" } }, { "FloatTitle", { bg = "NONE" } },
{ "DiffviewFilePanelTitle", { fg = colors.crystalBlue } }, { "DiffviewFilePanelTitle", { fg = colors.crystalBlue } },
{ "DiffviewDiffDeleteDim", { fg = function() return get_hl("Comment")().fg end } }, {
"DiffviewDiffDeleteDim",
{
fg = function()
return get_hl("Comment")().fg
end,
},
},
{ "LspInlayHint", { fg = colors.springViolet2, bg = colors.winterBlue } }, { "LspInlayHint", { fg = colors.springViolet2, bg = colors.winterBlue } },
{ "@text", { fg = colors.fujiWhite } }, { "@text", { fg = colors.fujiWhite } },
{ "RainbowDelimiterRed", { fg = colors.peachRed } }, { "RainbowDelimiterRed", { fg = colors.peachRed } },

View File

@ -477,9 +477,9 @@ return {
maxMemoryMB = 60000, maxMemoryMB = 60000,
flake = { flake = {
autoArchive = true, autoArchive = true,
autoEvalInputs = true autoEvalInputs = true,
} },
} },
}, },
}, },
}) })

View File

@ -7,7 +7,7 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-go", "nvim-neotest/neotest-go",
"mrcjkb/rustaceanvim", "mrcjkb/rustaceanvim",
"nvim-neotest/neotest-plenary" "nvim-neotest/neotest-plenary",
}, },
keys = { keys = {
{ "<localleader>n", desc = "> Neotest" }, { "<localleader>n", desc = "> Neotest" },
@ -25,18 +25,18 @@ return {
return { return {
diagnostic = { diagnostic = {
enable = true, enable = true,
severity = 1 severity = 1,
}, },
discovery = { discovery = {
concurrent = 4 concurrent = 4,
}, },
status = { status = {
virtual_text = true virtual_text = true,
}, },
adapters = { adapters = {
require("neotest-plenary"), require("neotest-plenary"),
require("neotest-go"), require("neotest-go"),
require('rustaceanvim.neotest') require("rustaceanvim.neotest"),
}, },
} }
end, end,

View File

@ -8,7 +8,7 @@ return {
"Nmlogs", "Nmlogs",
"Nmdelete", "Nmdelete",
"Nmread", "Nmread",
"Nmwrite" "Nmwrite",
}, },
config = function() config = function()
require("netman") require("netman")

View File

@ -25,7 +25,11 @@ return {
local hl = vim.api.nvim_get_hl(0, { name = name, link = false }) local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
vim.api.nvim_set_hl(0, name, vim.tbl_deep_extend("force", hl, { bg = bg, force = true })) vim.api.nvim_set_hl(0, name, vim.tbl_deep_extend("force", hl, { bg = bg, force = true }))
local cul_hl_name = name .. "Cul" local cul_hl_name = name .. "Cul"
vim.api.nvim_set_hl(0, cul_hl_name, vim.tbl_deep_extend("force", hl, { bg = cl_bg, nocombine = true, force = true })) vim.api.nvim_set_hl(
0,
cul_hl_name,
vim.tbl_deep_extend("force", hl, { bg = cl_bg, nocombine = true, force = true })
)
sign.culhl = cul_hl_name sign.culhl = cul_hl_name
vim.fn.sign_define(sign.name, sign) vim.fn.sign_define(sign.name, sign)
end end

View File

@ -206,7 +206,7 @@ return {
frecency = { frecency = {
show_scores = true, show_scores = true,
auto_validate = true, auto_validate = true,
db_safe_mode = false db_safe_mode = false,
}, },
}, },
}) })

View File

@ -109,9 +109,11 @@ end
U.select_hl = function(name, fields) U.select_hl = function(name, fields)
---@return vim.api.keyset.highlight ---@return vim.api.keyset.highlight
return function() return function()
return vim.iter(U.get_hl(name)()):filter(function(k, _) return vim.iter(U.get_hl(name)())
:filter(function(k, _)
return vim.list_contains(fields, k) return vim.list_contains(fields, k)
end):fold({}, function(t, k, v) end)
:fold({}, function(t, k, v)
t[k] = v t[k] = v
return t return t
end) end)
@ -119,4 +121,3 @@ U.select_hl = function(name, fields)
end end
return U return U

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
get-album-info () { get-album-info() {
local class local class
local text="" local text=""
@ -25,7 +25,6 @@ get-album-info () {
done done
} }
main() { main() {
get-album-info get-album-info
} }

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
main () { main() {
local notify_application_name="RF Status" local notify_application_name="RF Status"
local enable_airplane_mode=true local enable_airplane_mode=true
@ -11,7 +11,6 @@ main () {
local device local device
local device_type local device_type
for rf_status in $(rfkill -J | jq '.rfkilldevices[]' | jq -r tostring); do for rf_status in $(rfkill -J | jq '.rfkilldevices[]' | jq -r tostring); do
rf_soft_status="$(printf "%s" "${rf_status}" | jq -r '.soft')" rf_soft_status="$(printf "%s" "${rf_status}" | jq -r '.soft')"
rf_hard_status="$(printf "%s" "${rf_status}" | jq -r '.hard')" rf_hard_status="$(printf "%s" "${rf_status}" | jq -r '.hard')"
@ -45,7 +44,6 @@ main () {
fi fi
fi fi
} }
main main

View File

@ -28,13 +28,13 @@ return {
{ key = "l", action = wezterm.action.RotatePanes("Clockwise") }, { key = "l", action = wezterm.action.RotatePanes("Clockwise") },
{ key = "RightArrow", action = wezterm.action.RotatePanes("Clockwise") }, { key = "RightArrow", action = wezterm.action.RotatePanes("Clockwise") },
{ key = "Escape", action = "PopKeyTable" }, { key = "Escape", action = "PopKeyTable" },
} },
}, },
keys = { keys = {
{ {
key = "r", key = "r",
mods = "SUPER", mods = "SUPER",
action = "ReloadConfiguration" action = "ReloadConfiguration",
}, },
{ {
key = "z", key = "z",
@ -153,7 +153,6 @@ return {
name = "rotate_panes", name = "rotate_panes",
one_shot = false, one_shot = false,
}), }),
} },
}, },
} }

View File

@ -1,4 +1,4 @@
return { return {
window_decorations = "TITLE | RESIZE", window_decorations = "TITLE | RESIZE",
win32_system_backdrop = "Acrylic" win32_system_backdrop = "Acrylic",
} }

View File

@ -57,7 +57,6 @@ wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_wid
title = "N/A" title = "N/A"
end end
if tab.is_active then if tab.is_active then
bg = color_names.kanagawa.sumiInk0 bg = color_names.kanagawa.sumiInk0
fg = color_names.kanagawa.oniViolet fg = color_names.kanagawa.oniViolet
@ -146,8 +145,9 @@ wezterm.on("update-right-status", function(window, pane)
local key_table = window:active_key_table() local key_table = window:active_key_table()
if key_table then if key_table then
leader = leader_text leader = leader_text
key_table = "󰌌 " .. key_table:gsub("_", " "):gsub("(%l)(%w*)", function (a,b) key_table = "󰌌 "
return string.upper(a)..b .. key_table:gsub("_", " "):gsub("(%l)(%w*)", function(a, b)
return string.upper(a) .. b
end) end)
end end

View File

@ -1,6 +0,0 @@
#compdef aws
_aws () {
local e
e=$(dirname ${funcsourcetrace[1]%:*})/aws_zsh_completer.sh
if [[ -f $e ]]; then source $e; fi
}

View File

@ -1,60 +0,0 @@
# Source this file to activate auto completion for zsh using the bash
# compatibility helper. Make sure to run `compinit` before, which should be
# given usually.
#
# % source /path/to/zsh_complete.sh
#
# Typically that would be called somewhere in your .zshrc.
#
# Note, the overwrite of _bash_complete() is to export COMP_LINE and COMP_POINT
# That is only required for zsh <= edab1d3dbe61da7efe5f1ac0e40444b2ec9b9570
#
# https://github.com/zsh-users/zsh/commit/edab1d3dbe61da7efe5f1ac0e40444b2ec9b9570
#
# zsh relases prior to that version do not export the required env variables!
autoload -Uz bashcompinit
bashcompinit -i
_bash_complete() {
local ret=1
local -a suf matches
local -x COMP_POINT COMP_CWORD
local -a COMP_WORDS COMPREPLY BASH_VERSINFO
local -x COMP_LINE="$words"
local -A savejobstates savejobtexts
(( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))
(( COMP_CWORD = CURRENT - 1))
COMP_WORDS=( $words )
BASH_VERSINFO=( 2 05b 0 1 release )
savejobstates=( ${(kv)jobstates} )
savejobtexts=( ${(kv)jobtexts} )
[[ ${argv[${argv[(I)nospace]:-0}-1]} = -o ]] && suf=( -S '' )
matches=( ${(f)"$(compgen $@ -- ${words[CURRENT]})"} )
if [[ -n $matches ]]; then
if [[ ${argv[${argv[(I)filenames]:-0}-1]} = -o ]]; then
compset -P '*/' && matches=( ${matches##*/} )
compset -S '/*' && matches=( ${matches%%/*} )
compadd -Q -f "${suf[@]}" -a matches && ret=0
else
compadd -Q "${suf[@]}" -a matches && ret=0
fi
fi
if (( ret )); then
if [[ ${argv[${argv[(I)default]:-0}-1]} = -o ]]; then
_default "${suf[@]}" && ret=0
elif [[ ${argv[${argv[(I)dirnames]:-0}-1]} = -o ]]; then
_directories "${suf[@]}" && ret=0
fi
fi
return ret
}
complete -C aws_completer aws

View File

@ -4,8 +4,12 @@ init() {
local wkdir="${BASE_ZSH_CONFIG_DIR}/config/completions" local wkdir="${BASE_ZSH_CONFIG_DIR}/config/completions"
FPATH="${FPATH}:${wkdir}/completions" FPATH="${FPATH}:${wkdir}/completions"
autoload -Uz compinit autoload bashcompinit && bashcompinit
compinit autoload -Uz compinit && compinit
if command -v aws_completer >/dev/null 2>&1; then
complete -C "$(command -v aws_completer)" aws
fi
} }
init init

View File

@ -1,31 +1,22 @@
# Some of these functions were taken from https://github.com/NixOS/nixpkgs/blob/master/lib/ # Some of these functions were taken from https://github.com/NixOS/nixpkgs/blob/master/lib/
{ lib ? (import <nixpkgs> { }).lib }: { lib ? (import <nixpkgs> { }).lib }: rec {
rec { hasSuffix = suffix: string:
hasSuffix =
suffix:
string:
let let
lenSuffix = builtins.stringLength suffix; lenSuffix = builtins.stringLength suffix;
lenString = builtins.stringLength string; lenString = builtins.stringLength string;
in in (lenString >= lenSuffix
( && (builtins.substring (lenString - lenSuffix) lenString string)
lenString >= lenSuffix && (builtins.substring (lenString - lenSuffix) lenString string) == suffix == suffix);
);
recurseDir = dir: recurseDir = dir:
let let dirContents = builtins.readDir dir;
dirContents = builtins.readDir dir; in (builtins.concatMap (dirItem:
in
(builtins.concatMap
(dirItem:
let let
itemType = builtins.getAttr dirItem dirContents; itemType = builtins.getAttr dirItem dirContents;
itemPath = dir + "/${dirItem}"; itemPath = dir + "/${dirItem}";
in in if itemType == "directory" then
if itemType == "directory" then
(recurseDir itemPath) (recurseDir itemPath)
else else
[ itemPath ]) [ itemPath ]) (builtins.attrNames dirContents));
(builtins.attrNames dirContents));
recurseFilesInDir = dir: suffix: recurseFilesInDir = dir: suffix:
(builtins.filter (file: hasSuffix "${suffix}" file) (recurseDir dir)); (builtins.filter (file: hasSuffix "${suffix}" file) (recurseDir dir));
recurseFilesInDirs = dirs: suffix: recurseFilesInDirs = dirs: suffix:
@ -35,14 +26,13 @@ rec {
let let
f = attrPath: f = attrPath:
lib.zipAttrsWith (n: values: lib.zipAttrsWith (n: values:
if lib.tail values == [ ] if lib.tail values == [ ] then
then lib.head values lib.head values
else if lib.all builtins.isList values else if lib.all builtins.isList values then
then lib.unique (lib.concatLists values) lib.unique (lib.concatLists values)
else if lib.all builtins.isAttrs values else if lib.all builtins.isAttrs values then
then f (attrPath ++ [ n ]) values f (attrPath ++ [ n ]) values
else lib.last values else
); lib.last values);
in in f [ ] attrList;
f [ ] attrList;
} }

View File

@ -4,9 +4,7 @@ let
"age1yubikey1qfnj0k4mkzrn8ef5llwh2sv6hd7ckr0qml3n9hzdpz9c59ypvryhyst87k0" "age1yubikey1qfnj0k4mkzrn8ef5llwh2sv6hd7ckr0qml3n9hzdpz9c59ypvryhyst87k0"
"age1ur2lr3z6d2eftgxcalc6s5x9840ew9x43upl9k23wg0ugacrn5as4zl6sj" "age1ur2lr3z6d2eftgxcalc6s5x9840ew9x43upl9k23wg0ugacrn5as4zl6sj"
]; ];
secrets = let dir = "files"; secrets = let dir = "files"; in { };
in {
};
in if agenix then in if agenix then
(builtins.listToAttrs (builtins.concatMap (secretName: [{ (builtins.listToAttrs (builtins.concatMap (secretName: [{
name = builtins.toString secretName; name = builtins.toString secretName;