dotfiles
bugabingas dorkfiles
owned by bugabinga
resurecting puk :(
375c32163039f23b83dca66e20a4f9e9a33af3ba
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (3)
41 +* inline simple plugins into config (in-and-out, refjump)
41 42 * merge mini-nvim with main config
42 43 * learn mini.operators
new file mode 100755 10 + let data_path = nvim --headless --clean +
'lua print(vim.fn.stdpath "data")' +q | complete | get stderr
11 + let cache_path = nvim --headless --clean +
'lua print(vim.fn.stdpath "cache")' +q | complete | get stderr
12 + let plugins_path = [
$data_path site pack puk opt ] | path join
13 + let plugin_specs = open puk.plugins.nuon
14 + $plugin_specs | par-
each { install-spec
$in $plugins_path $cache_path }
15 + nvim --headless -u NONE +
'helptags ALL' +q
20 +def make-plugin-path [
23 +] { [
$plugins_path $spec.name] | path join }
28 +def make-commit-file-path [
30 +] { [
$plugin_path .commit.puk] | path join }
32 +def plugin-is-installed [
36 + let predicted_plugin_path = make-plugin-path
$spec $plugins_path 37 + if not (
$predicted_plugin_path | path exists ) {
40 + let commit_file_path = make-commit-file-path
$predicted_plugin_path 41 + if not (
$commit_file_path | path exists) {
44 + let commit = open --raw
$commit_file_path | str trim
45 + $commit ==
$spec.commit 48 +def generate-download-url [
51 + let url_format =
match $spec.source {
52 + github => {
'https://github.com/{repo}/archive/{commit}.tar.gz ' },
53 + codeberg => {
'https://codeberg.org/{repo}/archive/{commit}.tar.gz' },
54 + srht => {
'https://git.sr.ht/{repo}/archive/{commit}.tar.gz' },
56 + msg:
'unknown plugin source given' 58 + text:
'dunno this one' 59 + span: (metadata
$spec.source).span
64 + $spec | format pattern
$url_format 67 +def download-plugin [
71 + let archive_path = [
$cache_path (
$spec.name +
'.tar.gz') ] | path join
72 + if (
$archive_path | path exists) {
73 + return
$archive_path 75 + let url = generate-download-url
$spec 76 + http get --raw
$url | save
$archive_path 80 +def unpack-plugin-archive [
84 + let tmp_path = mktemp --directory
86 + run-external tar
'--extract' '--file' $archive_path '--directory' $tmp_path '--strip-components=1' 88 + if $spec.build != null {
89 + print $
"Build step for plugin ($spec.name) detected! Executing now..." 91 + run-external
$spec.build.0 ...(
$spec.build | range
1.. )
101 + let plugin_path = make-plugin-path
$spec $plugins_path 102 + try { rm --trash --recursive
$plugin_path }
105 + glob **/*.{lua,vim,scm,txt,so,dll,dylib} --exclude [**/tests/**, **/scripts/**, **/fixtures/**, **/target/release/deps/**] |
106 + path relative-to (pwd) |
107 + par-
each { | file |
108 + let rebased_parent = [
$plugin_path (
$file | path dirname | to text)] | path join
109 + mkdir
$rebased_parent 110 + cp
$file $rebased_parent 112 + let commit_file_path = make-commit-file-path
$plugin_path 113 + $spec.commit | save
$commit_file_path 122 + if (plugin-is-installed
$spec $plugins_path) {
123 + print $
"Plugin ($spec.name) is already installed and up-to-date!" 126 + let archive_path = download-plugin
$spec $cache_path 127 + let unpacked_path = unpack-plugin-archive
$spec $archive_path 128 + let installed_plugin_path = install-plugin
$spec $unpacked_path $plugins_path 130 + print $
"Plugin ($spec.name) installed into ($installed_plugin_path)!" neovim/puk.plugins.nuon
Addednew file mode 100644 2 + [name, source, repo, commit, build];
4 + [blink, github, 'Saghen/blink.cmp', '180be7ba574033baa30fa8af0db4f59db7353584', [cargo build '--release'] ],
5 + [nvim-surround, github, 'kylechui/nvim-surround', 'dca2e998ff26681ee422b92c6ed39b3d2908d8a9', null ],
6 + [ivy, github, 'AdeAttwood/ivy.nvim', 'cfa7e29ae4d955508d4f7f2ef08cc0c51ee745ed', null ],
7 + [in-and-out, github, 'ysmb-wtsg/in-and-out.nvim', 'ab24cafadc3418dffb0c7e9b0621cff60b9ac551', null ],
8 + [neoterm, github, 'itmecho/neoterm.nvim', '23a780136892b1128485f20d772a771e528b651b', null ],