Compare commits

..

3 commits

Author SHA1 Message Date
3e0753bc1b
decruft 2023-03-20 09:22:08 -05:00
7bb16affdb
add completion generator 2023-03-20 09:19:27 -05:00
2b5e645faa
updates to nvim 2023-03-20 09:13:07 -05:00
6 changed files with 557 additions and 146 deletions

View file

@ -1,5 +1,5 @@
{ {
"LazyVim": { "branch": "main", "commit": "6b740fd300d7b6dccd1dd2c722ee6a4c7a5b718a" }, "LazyVim": { "branch": "main", "commit": "11d414c35841b35604e98cdc2d05e756da3c9421" },
"LuaSnip": { "branch": "master", "commit": "a835e3d680c5940b61780c6af07885db95382478" }, "LuaSnip": { "branch": "master", "commit": "a835e3d680c5940b61780c6af07885db95382478" },
"alpha-nvim": { "branch": "main", "commit": "3847d6baf74da61e57a13e071d8ca185f104dc96" }, "alpha-nvim": { "branch": "main", "commit": "3847d6baf74da61e57a13e071d8ca185f104dc96" },
"bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" }, "bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" },
@ -11,47 +11,47 @@
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
"flit.nvim": { "branch": "main", "commit": "4c1739137acd3e7f03e2065a7be8a4dc41c7e461" }, "flit.nvim": { "branch": "main", "commit": "4c1739137acd3e7f03e2065a7be8a4dc41c7e461" },
"friendly-snippets": { "branch": "main", "commit": "2f5b8a41659a19bd602497a35da8d81f1e88f6d9" }, "friendly-snippets": { "branch": "main", "commit": "25ddcd96540a2ce41d714bd7fea2e7f75fea8ead" },
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" }, "gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"lazy.nvim": { "branch": "main", "commit": "5550f9927195dee9444eee4f26b1a22fcd88a191" }, "lazy.nvim": { "branch": "main", "commit": "887eb75591520a01548134c4623617b639289d0b" },
"leap.nvim": { "branch": "main", "commit": "2ff8eac67bed41005ea2032728a0336c784de611" }, "leap.nvim": { "branch": "main", "commit": "f74473d23ebf60957e0db3ff8172349a82e5a442" },
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3924f2d264097b2caf13e713485dbc3e9d616574" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "2b811031febe5f743e07305738181ff367e1e452" },
"mason.nvim": { "branch": "main", "commit": "441c9ea2ab385c2e6407a637775b4b392533d265" }, "mason.nvim": { "branch": "main", "commit": "a192887fd0c29275cf2acb4a83bcbdf63399f8df" },
"mini.ai": { "branch": "main", "commit": "d5a9f6b50fc6285fb876667e67394bbee2d5c70c" }, "mini.ai": { "branch": "main", "commit": "d5a9f6b50fc6285fb876667e67394bbee2d5c70c" },
"mini.bufremove": { "branch": "main", "commit": "68f9111aa81545022bb5afe7d576311a0fc29969" }, "mini.bufremove": { "branch": "main", "commit": "68f9111aa81545022bb5afe7d576311a0fc29969" },
"mini.comment": { "branch": "main", "commit": "f045998636c6fd746297220b8c692bf1e91568cb" }, "mini.comment": { "branch": "main", "commit": "f045998636c6fd746297220b8c692bf1e91568cb" },
"mini.indentscope": { "branch": "main", "commit": "43f6761c9a3e397b7c12b3c72f678bcf61efcfcf" }, "mini.indentscope": { "branch": "main", "commit": "43f6761c9a3e397b7c12b3c72f678bcf61efcfcf" },
"mini.pairs": { "branch": "main", "commit": "771c08bd313614c7e9a1904d277ac76eb226f674" }, "mini.pairs": { "branch": "main", "commit": "771c08bd313614c7e9a1904d277ac76eb226f674" },
"mini.surround": { "branch": "main", "commit": "b450a3aff91b4108c0e9ba9e82633d65deb5802b" }, "mini.surround": { "branch": "main", "commit": "b450a3aff91b4108c0e9ba9e82633d65deb5802b" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "205184aa0e0f08e8a1249d9bb37b45bae85f01b9" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "20c2f2f5ba083bbb1e37b8bc3d590621434f31e9" },
"neoconf.nvim": { "branch": "main", "commit": "48178e12a8b722f36ca9f0e8ff0a5487b45de493" }, "neoconf.nvim": { "branch": "main", "commit": "bc531ca41ba55d87416b4b3ade606ff81236389b" },
"neodev.nvim": { "branch": "main", "commit": "abdc346ff59c414698de551f876bcf3f223ed224" }, "neodev.nvim": { "branch": "main", "commit": "0a8e312923671e78499b2e204f0f678379ba92c1" },
"nim.nvim": { "branch": "master", "commit": "87afde2ae995723e0338e1851c3b3c1cbd81d955" }, "nim.nvim": { "branch": "master", "commit": "87afde2ae995723e0338e1851c3b3c1cbd81d955" },
"noice.nvim": { "branch": "main", "commit": "a132d4210f9e4ed7b034d98e61eba877c6991a49" }, "noice.nvim": { "branch": "main", "commit": "92b058ad183fccd3b970f03ae49094596a6c735b" },
"nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" },
"null-ls.nvim": { "branch": "main", "commit": "09e99259f4cdd929e7fb5487bf9d92426ccf7cc1" }, "null-ls.nvim": { "branch": "main", "commit": "456a983ce9843123e51b955f50925077ca7207d5" },
"nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },
"nvim-lspconfig": { "branch": "master", "commit": "4bb0f1845c5cc6465aecedc773fc2d619fcd8faf" }, "nvim-lspconfig": { "branch": "master", "commit": "0f94c5fded29c0024254259f3d8a0284bfb507ea" },
"nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" }, "nvim-navic": { "branch": "master", "commit": "f1ffbc3f5736add66c31e02f4c53d238e040600b" },
"nvim-notify": { "branch": "master", "commit": "02047199e2752223c77c624160f720ca227944a9" }, "nvim-notify": { "branch": "master", "commit": "02047199e2752223c77c624160f720ca227944a9" },
"nvim-spectre": { "branch": "master", "commit": "201ccd1f6ce98a4e509359c8994e111a52a02515" }, "nvim-spectre": { "branch": "master", "commit": "2d7d23c1122bb2589880236e932d373933b07937" },
"nvim-treesitter": { "branch": "master", "commit": "89e5fa66cf53854f45cfcfae45afb93171cf5c05" }, "nvim-treesitter": { "branch": "master", "commit": "25b656a4b771ee7d440e506280b9ae546d6f7233" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5b2bcb9ca8315879181f468b37a897100d631005" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "582cbb5a4cb50f6161cac8cc01f55aeaff6d836a" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" },
"nvim-web-devicons": { "branch": "master", "commit": "f1b1cee3a561590a6c1637a9326c406f6e4af914" }, "nvim-web-devicons": { "branch": "master", "commit": "467d135bbefa6fbe8380c8b6498228f8b21244a6" },
"persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" }, "persistence.nvim": { "branch": "main", "commit": "c814fae5c37aa0aba9cd9da05df6e52b88d612c3" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
"telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" },
"todo-comments.nvim": { "branch": "main", "commit": "6ccb0bebeb22dbe31940776a750db54b844ae653" }, "todo-comments.nvim": { "branch": "main", "commit": "14e2cd9a6e5e67483a03660f08471ca9a981c4a5" },
"tokyonight.nvim": { "branch": "main", "commit": "467d889ba82a74e26821c812aa8e70d7dff04c6c" }, "tokyonight.nvim": { "branch": "main", "commit": "edffa82026914be54c8220973b0385f61d3392f0" },
"trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" }, "trouble.nvim": { "branch": "main", "commit": "7915277a259fdff5d46c6f1d2e100df2ec384d3b" },
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"vim-nix": { "branch": "master", "commit": "7d23e97d13c40fcc6d603b291fe9b6e5f92516ee" }, "vim-nix": { "branch": "master", "commit": "7d23e97d13c40fcc6d603b291fe9b6e5f92516ee" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" }, "vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" },
"which-key.nvim": { "branch": "main", "commit": "fb027738340502b556c3f43051f113bcaa7e8e63" }, "which-key.nvim": { "branch": "main", "commit": "d1afcd48f309af58fdb43adc4581bf4b5684768b" },
"zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" } "zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" }
} }

View file

@ -45,8 +45,24 @@ return {
"shellcheck", "shellcheck",
"shfmt", "shfmt",
"ruff", "ruff",
"ruff-lsp",
"nimlsp",
"lua-language-server", "lua-language-server",
}, },
}, },
}, },
{
"jose-elias-alvarez/null-ls.nvim",
opts = function()
local nls = require("null-ls")
return {
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
sources = {
nls.builtins.formatting.stylua,
nls.builtins.formatting.shfmt,
nls.builtins.diagnostics.ruff,
},
}
end,
},
} }

View file

@ -0,0 +1,497 @@
#compdef pdm
PDM_PYTHON="$HOME/.local/pipx/venvs/pdm/bin/python"
PDM_PIP_INDEXES=($(command ${PDM_PYTHON} -m pdm config pypi.url))
_pdm() {
emulate -L zsh -o extended_glob
typeset -A opt_args
local context state state_descr line
local curcontext=$curcontext ret=1
local -a arguments=(
{-h,--help}'[Show help message and exit]'
{-v,--verbose}'[Show detailed output]'
)
local sub_commands=(
'add:Add package(s) to pyproject.toml and install them'
'build:Build artifacts for distribution'
'cache:Control the caches of PDM'
'completion:Generate completion scripts for the given shell'
'config:Display the current configuration'
'export:Export the locked packages set to other formats'
'import:Import project metadata from other formats'
'info:Show the project information'
'init:Initialize a pyproject.toml for PDM'
'install:Install dependencies from lock file'
'list:List packages installed in the current working set'
'lock:Resolve and lock dependencies'
'self:Manage the PDM program itself (previously known as plugin)'
'publish:Build and publish the project to PyPI'
'remove:Remove packages from pyproject.toml'
'run:Run commands or scripts with local packages loaded'
'search:Search for PyPI packages'
'show:Show the package information'
'sync:Synchronize the current working set with lock file'
'update:Update package(s) in pyproject.toml'
'use:Use the given python version or path as base interpreter'
)
_arguments -s -C -A '-*' \
$arguments \
{-c,--config}'[Specify another config file path(env var: PDM_CONFIG_FILE)]' \
{-V,--version}'[Show the version and exit]' \
{-I,--ignore-python}'[Ignore the Python path saved in the .pdm.toml config]' \
'--pep582:Print the command line to be eval by the shell:shell:(zsh bash fish tcsh csh)' \
'*:: :->_subcmds' \
&& return 0
if (( CURRENT == 1 )); then
_describe -t commands 'pdm subcommand' sub_commands
return
fi
curcontext=${curcontext%:*}:$words[1]
case $words[1] in
add)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-d,--dev}'[Add packages into dev dependencies]'
{-G,--group}'[Specify the target dependency group to add into]:group:_pdm_groups'
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
'--no-sync[Only write pyproject.toml and do not sync the working set]'
'--save-compatible[Save compatible version specifiers]'
'--save-wildcard[Save wildcard version specifiers]'
'--save-exact[Save exact version specifiers]'
'--save-minimum[Save minimum version specifiers]'
'--update-reuse[Reuse pinned versions already present in lock file if possible]'
'--update-eager[Try to update the packages and their dependencies recursively]'
'--update-all[Update all dependencies and sub-dependencies]'
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]'
{--pre,--prerelease}'[Allow prereleases to be pinned]'
{-e+,--editable+}'[Specify editable packages]:packages'
"--no-isolation[do not isolate the build in a clean environment]"
"--dry-run[Show the difference only without modifying the lockfile content]"
'*:packages:_pdm_pip_packages'
)
;;
build)
arguments+=(
"--no-sdist[Don't build source tarballs]"
"--no-wheel[Don't build wheels]"
{-d+,--dest+}'[Target directory to put artifacts]:directory:_files -/'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
'--no-clean[Do not clean the target directory]'
{-C,--config-setting}'[Pass options to the backend. options with a value must be specified after "=": "--config-setting=--opt(=value)" or "-C--opt(=value)"]'
"--no-isolation[do not isolate the build in a clean environment]"
)
;;
cache)
_arguments -C \
$arguments \
': :->command' \
'*:: :->args' && ret=0
case $state in
command)
local -a actions=(
"clear:Clean all the files under cache directory"
"remove:Remove files matching the given pattern"
"list:List the built wheels stored in the cache"
"info:Show the info and current size of caches"
)
_describe -t command 'pdm cache actions' actions && ret=0
;;
args)
case $words[1] in
clear)
compadd -X type 'hashes' 'http' 'wheels' 'metadata' 'packages' && ret=0
;;
*)
_message "pattern" && ret=0
;;
esac
;;
esac
return $ret
;;
config)
_arguments -s \
{-g,--global}'[Use the global project, supply the project root with `-p` option]' \
{-l,--local}"[Set config in the project's local configuration file]" \
{-d,--delete}'[Unset a configuration key]' \
'1:key:->keys' \
'2:value:_files' && return 0
if [[ $state == keys ]]; then
local l mbegin mend match keys=()
for l in ${(f)"$(command ${PDM_PYTHON} -m pdm config)"}; do
if [[ $l == (#b)" "#(*)" = "(*) ]]; then
keys+=("$match[1]:$match[2]")
fi
done
_describe -t key "key" keys && return 0
fi
;;
export)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-f+,--format+}"[Specify the export file format]:format:(pipfile poetry flit requirements setuppy)"
"--without-hashes[Don't include artifact hashes]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{-o+,--output+}"[Write output to the given file, or print to stdout if not given]:output file:_files"
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]"
{--prod,--production}"[Unselect dev dependencies]"
"--no-default[Don't include dependencies from the default group]"
)
;;
import)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-f+,--format+}"[Specify the file format explicitly]:format:(pipfile poetry flit requirements)"
'1:filename:_files'
)
;;
info)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
'--python[Show the interpreter path]'
'--where[Show the project root path]'
'--env[Show PEP 508 environment markers]'
'--packages[Show the packages root]'
)
;;
init)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-n,--non-interactive}"[Don't ask questions but use default values]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
'--python[Specify the Python version/path to use]:python:'
)
;;
install)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{--prod,--production}"[Unselect dev dependencies]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--no-lock[Don't do lock if lock file is not found or outdated]"
"--no-default[Don\'t include dependencies from the default group]"
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-isolation[do not isolate the build in a clean environment]"
"--dry-run[Show the difference only without modifying the lock file content]"
"--check[Check if the lock file is up to date and fail otherwise]"
)
;;
list)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-r,--reverse}'[Reverse the dependency graph]'
'--fields[Select information to output as a comma separated string.]:fields:'
"--sort[Sort the output using a given field name. If nothing is set, no sort is applied. Multiple fields can be combined with ',']:sort:"
'--json[Output dependencies in JSON document format]'
'--csv[Output dependencies in CSV document format]'
'--markdown[Output dependencies and legal notices in markdown document format - best effort basis]'
'--graph[Display a graph of dependencies]'
"--freeze[Show the installed dependencies as pip's requirements.txt format]"
"--include[Dependency groups to include in the output. By default all are included]:include:"
"--exclude[Dependency groups to exclude from the output]:exclude:"
"--resolve[Resolve all requirements to output licenses (instead of just showing those currently installed)"
)
;;
lock)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
"--no-isolation[Do not isolate the build in a clean environment]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--refresh[Don't update pinned versions, only refresh the lock file]"
"--check[Check if the lock file is up to date and quit]"
)
;;
self)
_arguments -C \
$arguments \
': :->command' \
'*:: :->args' && ret=0
case $state in
command)
local -a actions=(
"add:Install packages to the PDM's environment"
"remove:Remove packages from PDM's environment"
"list:List all packages installed with PDM"
"update:Update PDM itself"
)
_describe -t command 'pdm self actions' actions && ret=0
;;
args)
case $words[1] in
add)
arguments+=(
'--pip-args[Arguments that will be passed to pip install]:pip args:'
'*:packages:_pdm_pip_packages'
)
;;
remove)
arguments+=(
'--pip-args[Arguments that will be passed to pip uninstall]:pip args:'
{-y,--yes}'[Answer yes on the question]'
'*:packages:_pdm_pip_packages'
)
;;
list)
arguments+=(
'--plugins[List plugins only]'
)
;;
update)
arguments+=(
'--head[Update to the latest commit on the main branch]'
'--pre[Update to the latest prerelease version]'
'--pip-args[Arguments that will be passed to pip uninstall]:pip args:'
)
;;
*)
;;
esac
;;
esac
return $ret
;;
publish)
arguments+=(
{-r,--repository}'[The repository name or url to publish the package to }[env var: PDM_PUBLISH_REPO]]:repository:'
{-u,--username}'[The username to access the repository [env var: PDM_PUBLISH_USERNAME]]:username:'
{-P,--password}'[The password to access the repository [env var: PDM_PUBLISH_PASSWORD]]:password:'
{-S,--sign}'[Upload the package with PGP signature]'
{-i,--identity}'[GPG identity used to sign files.]:gpg identity:'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-c,--comment}'[The comment to include with the distribution file.]:comment:'
"--ca-certs[The path to a PEM-encoded Certificate Authority bundle to use for publish server validation]:cacerts:_files"
"--no-build[Don't build the package before publishing]"
)
;;
remove)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G,--group}'[Specify the target dependency group to remove from]:group:_pdm_groups'
{-d,--dev}"[Remove packages from dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--no-sync[Only write pyproject.toml and do not uninstall packages]"
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-isolation[do not isolate the build in a clean environment]"
"--dry-run[Show the difference only without modifying the lockfile content]"
"*:packages:_pdm_packages"
)
;;
run)
_arguments -s \
{-g,--global}'[Use the global project, supply the project root with `-p` option]' \
{-l,--list}'[Show all available scripts defined in pyproject.toml]' \
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]' \
{-s,--site-packages}'[Load site-packages from the selected interpreter]' \
'(-)1:command:->command' \
'*:arguments: _normal ' && return 0
if [[ $state == command ]]; then
_command_names -e
local local_commands=($(_pdm_scripts))
_describe "local command" local_commands
return 0
fi
;;
search)
arguments+=(
'1:query string:'
)
;;
show)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
'--name[Show name]'
'--version[Show version]'
'--summary[Show summary]'
'--license[Show license]'
'--platform[Show platform]'
'--keywords[Show keywords]'
'1:package:'
)
;;
sync)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{--prod,--production}"[Unselect dev dependencies]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
'--dry-run[Only prints actions without actually running them]'
{-r,--reinstall}"[Force reinstall existing dependencies]"
'--clean[Clean unused packages]'
"--only-keep[Only keep the selected packages]"
"--no-default[Don\'t include dependencies from the default group]"
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-isolation[do not isolate the build in a clean environment]"
)
;;
update)
arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
'--save-compatible[Save compatible version specifiers]'
'--save-wildcard[Save wildcard version specifiers]'
'--save-exact[Save exact version specifiers]'
'--save-minimum[Save minimum version specifiers]'
'--update-reuse[Reuse pinned versions already present in lock file if possible]'
'--update-eager[Try to update the packages and their dependencies recursively]'
'--update-all[Update all dependencies and sub-dependencies]'
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-sync[Only update lock file but do not sync packages]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]'
{--pre,--prerelease}'[Allow prereleases to be pinned]'
{-d,--dev}'[Select dev dependencies]'
{--prod,--production}"[Unselect dev dependencies]"
"--no-default[Don\'t include dependencies from the default group]"
{-t,--top}'[Only update those list in pyproject.toml]'
"--dry-run[Show the difference only without modifying the lockfile content]"
"--outdated[Show the difference only without modifying the lockfile content]"
"--no-isolation[do not isolate the build in a clean environment]"
"*:packages:_pdm_packages"
)
;;
use)
arguments+=(
{-f,--first}'[Select the first matched interpreter]'
{-i,--ignore-remembered}'[Ignore the remembered selection]'
'*:python:_files'
)
;;
esac
_arguments -s $arguments && ret=0
return ret
}
_pdm_groups() {
if [[ ! -f pyproject.toml ]]; then
_message "not a pdm project"
return 1
fi
local l groups=() in_groups=0
while IFS= read -r l; do
case $l in
"["project.optional-dependencies"]") in_groups=1 ;;
"["tool.pdm.dev-dependencies"]") in_groups=1 ;;
"["*"]") in_groups=0 ;;
*"= [")
if (( in_groups )); then
groups+=$l[(w)1]
fi
;;
esac
done <pyproject.toml
compadd -X groups -a groups
}
_get_packages_with_python() {
command ${PDM_PYTHON} - << EOF
import sys
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
import os, re
PACKAGE_REGEX = re.compile(r'^[A-Za-z][A-Za-z0-9._-]*')
def get_packages(lines):
return [PACKAGE_REGEX.match(line).group() for line in lines]
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
packages = get_packages(data.get('project', {}).get('dependencies', []))
for reqs in data.get('project', {}).get('optional-dependencies', {}).values():
packages.extend(get_packages(reqs))
for reqs in data.get('tool', {}).get('pdm', {}).get('dev-dependencies', {}).values():
packages.extend(get_packages(reqs))
print(*set(packages))
EOF
}
_pdm_scripts() {
local scripts=() package_dir=$($PDM_PYTHON -m pdm info --packages)
if [[ -f pyproject.toml ]]; then
local l in_scripts=0
while IFS= read -r l; do
case $l in
"["tool.pdm.scripts"]") in_scripts=1 ;;
"["*"]") in_scripts=0 ;;
*"= "*)
if (( in_scripts )); then
scripts+=$l[(w)1]
fi
;;
esac
done < pyproject.toml
fi
if [[ $package_dir != "None" ]]; then
scripts+=($package_dir/bin/*(N:t))
fi
echo $scripts
}
_pdm_packages() {
if [[ ! -f pyproject.toml ]]; then
_message "not a pdm project"
return 1
fi
local packages=(${=$(_get_packages_with_python)})
compadd -X packages -a packages
}
_pdm_caching_policy() {
[[ ! -f $1 && -n "$1"(Nm+28) ]]
}
_pdm_pip_packages_update() {
typeset -g _pdm_packages
if _cache_invalid pdm_packages || ! _retrieve_cache pdm_packages; then
local index
for index in $PDM_PIP_INDEXES; do
_pdm_packages+=($(command curl -sL $index | command sed -nE '/<a href/ s/.*>(.+)<.*/\1/p'))
done
_store_cache pdm_packages _pdm_packages
fi
}
_pdm_pip_packages() {
if (( ! $+commands[curl] || ! $+commands[sed] )); then
_message "package name"
return 1
fi
local update_policy
zstyle ":completion:${curcontext%:}:" use-cache on
zstyle -s ":completion:${curcontext%:}:" cache-policy update_policy
if [[ -z $update_policy ]]; then
zstyle ":completion:${curcontext%:}:" cache-policy _pdm_caching_policy
fi
local -a _pdm_packages
_pdm_pip_packages_update
compadd -X packages -a _pdm_packages
}
_pdm "$@"

View file

@ -0,0 +1,20 @@
#!/usr/bin/env zsh
CURDIR=${0:a:h}
is-exe () {
[ -x "$(command -v $1)" ] && return 0 || return 1
}
gen() {
if is-exe "$1"; then
echo "$1 updated"
"$@" | sed "s#$HOME#\$HOME#g" >$CURDIR/"_$argv[1]"
else
echo "skipping $1"
fi
}
echo "GENERATING COMPLETION SCRIPTS"
echo "-----------------------------"
gen pdm completion zsh

View file

@ -1,38 +0,0 @@
arch:
# utils
- zsh
- nano
- vim
- curl
- wget
- git
- coreutils
- unzip
- openssh
- tmux
# system
- bluez-utils
- dhcpcd
# environment
- xorg-server
- xorg-apps
- xorg-xinit
- xf86-video-vesa
- lightdm
- rofi
- dunst
# tools
- alacritty
- vivaldi
aur:
# tools
- visual-studio-code-bin
# environment
- lightdm-mini-greeter
- leftwm
- leftwm-theme-git
- picom-git
- polybar
# fun
- macchina

View file

@ -1,84 +0,0 @@
tool: &default
asset: x86_64-unknown-linux-gnu
# environment
sheldon:
user: rossmacarthur
starship:
user: starship
asset: starship-x86_64-unknown-linux-gnu.tar.gz
# general
lsd:
<<: *default
user: Peltoche
ripgrep:
user: BurntSushi
to: rg
fd:
<<: *default
user: sharkdp
bat:
<<: *default
user: sharkdp
just:
user: casey
zoxide:
user: ajeetdsouza
gum:
user: charmbracelet
asset: linux_x86_64.tar.gz
custom_flags: "--asset ^.sbom"
fzf:
user: junegunn
# system monitoring
bottom:
asset: x86_64-unknown-linux-gnu.tar.gz
user: ClementTsang
file: btm
to: btm
btop:
user: aristocratos
# git
lazygit:
user: jesseduffield
cli:
user: cli
asset: linux_amd64.tar.gz
to: gh
glab:
user: profclems
asset: Linux_x86_64.tar.gz
#node
fnm:
user: Schniz
# editing
neovim:
user: neovim
to: nvim
sh:
user: mvdan
to: shfmt
atuin:
user: ellie
lazydocker:
user: jesseduffield
delta:
<<: *default
user: dandavison
# file management
gdu:
user: dundee
to: gdu
asset: gdu_linux_amd64.tgz
lf:
user: gokcehan