repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell: struggeling with linux system PATH. such a mees. much wow

fda47e6cfd078446567092ca5374a41d40f78c77

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (10)

environment.d/package.conf

Added
new file mode 100644
1 +PATH = "$PATH:/home/oli/Packages/Binaries"

git/gitconfig

Modified
57 57 insteadOf = "isp:"
59 59 [url "git@github.com:"]
60 - insteadOf = "gh:"
60 + insteadOf = "github:"
62 62 [status]
63 63 branch = true

neovim/lua/bugabinga/java.lua

Modified
240 240 handlers = {
241 241 ['language/status'] = function(_, status)
242 242 if status.message == 'ServiceReady' and jdtls_ss_id ~= nil then
243 + vim.notify('Stopping jdtls_ss: ' .. jdtls_ss_id)
243 244 vim.lsp.stop_client(jdtls_ss_id, true)
255 256 description = 'Starts jdlts (with syntax mode initially)',
256 257 command = function()
257 258 local path = vim.api.nvim_buf_get_name(0)
259 + -- FIXME: often, jdtls_ss stays open...
258 260 jdtls_ss_id = vim.lsp.start(create_config(true, path))
259 - puk 'jdtls'.start_or_attach(create_config(false, path))
261 + -- puk 'jdtls'.start_or_attach(create_config(false, path))

neovim/lua/bugabinga/treesitter.lua

Modified
6 6 require 'bugabinga.health'.add_dependency
7 7 { name_of_executable = 'zig' }
8 - { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter' }
9 - { name_of_executable = 'tar' }
10 - { name_of_executable = 'curl' }
8 + { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter' }
9 + { name_of_executable = 'tar' }
10 + { name_of_executable = 'curl' }
12 12 local treesitter = puk 'nvim-treesitter'
13 13 treesitter.setup {}
16 16 description = 'Try loading a treesitter parser, if available.',
17 17 events = 'FileType',
18 18 pattern = '*',
19 - command = function ( data )
19 + command = function(data)
20 20 local match = data.match
21 21 if match == 'text' then return end
22 - if table.contains( ignored.filetypes, match ) then
23 - vim.notify( 'Ignore ' .. match .. ' for treesitter.', vim.log.levels.TRACE )
22 + if table.contains(ignored.filetypes, match) then
23 + vim.notify('Ignore ' .. match .. ' for treesitter.', vim.log.levels.TRACE)
24 24 return
26 - local ok, err = pcall( vim.treesitter.start )
26 + local ok, err = pcall(vim.treesitter.start)
27 27 if not ok then
28 28 local available = require 'nvim-treesitter.parsers'
29 29 local potential_parser = available[match]
30 30 if potential_parser then
31 - vim.notify( 'Found potential treesitter parser for current filetype. Trying to install it. ' .. match )
32 - vim.cmd.TSInstall( match )
33 - require 'nvim-treesitter.install'.install( match, { force = false }, function ()
31 + vim.notify('Found potential treesitter parser for current filetype. Trying to install it. ' .. match)
32 + vim.cmd.TSInstall(match)
33 + require 'nvim-treesitter.install'.install(match, { force = false }, function()
34 34 vim.treesitter.start()
35 35 -- vim.cmd.edit()
36 - end )
36 + end)
37 37 elseif err then
38 - vim.notify( err, vim.log.levels.ERROR )
38 + vim.notify(err, vim.log.levels.ERROR)
40 40 return
43 43 vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
44 44 end,
46 +-- add asciidoc parser
47 +auto 'install_asciidoc_parser' {
48 + description = "Install asciidoc parser into nvim-treesitter",
49 + events = 'User',
50 + pattern = 'TSUpdate',
51 + command = function()
52 + require('nvim-treesitter.parsers').asciidoc = {
53 + install_info = {
54 + url = 'https://github.com/cathaysia/tree-sitter-asciidoc',
55 + revision = "5b6ccea9953b939959f447f7bfea699ae6968a99",
56 + branch = 'master', -- only needed if different from default branch
57 + location = 'tree-sitter-asciidoc',
58 + generate = false,
59 + generate_from_json = false,
60 + queries = 'queries/asciidoc', -- also install queries from given directory
61 + },
62 + }
63 + end,

neovim/lua/std/ignored.lua

Modified
14 14 'minipick',
15 15 'ivy',
16 16 'lazy',
17 + 'man',
17 18 'neo-tree',
18 19 'neo-tree-popup',
19 20 'notify',

nushell/modules/package/environment_path.nu

Deleted
deleted file mode 100644
1 -# setup PATH envrionment for installed packages
3 -use ./folders.nu
5 -# sets PATH, so that it points to installed packages
6 -export def --env set-system-path [] {
7 - let bin = (folders binaries)
8 - match $nu.os-info.family {
9 - 'unix' => {
10 - if ( $env.PATH | find $bin | is-empty) {
11 - let envd = [$nu.home-dir .config environment.d] | path join
12 - if(not ($envd | path exists)) {
13 - error make {msg: $"systemd environment.d must exist under ($envd)!"}
14 - }
15 - let packgage_path = $'PATH = "$PATH:($bin)"'
16 - $packgage_path | save --raw ([$envd package.conf] | path join)
17 - $env | upsert PATH $bin
18 - }
19 - }
20 - 'windows' => {
21 - if ( $env.Path | find $bin | is-empty ) {
22 - let ps_command = $"
23 - $newPath = [Environment]::GetEnvironmentVariable\(\"Path\", \"User\"\) + \";($bin)\"
24 - [Environment]::SetEnvironmentVariable\(\"Path\", $newPath, \"User\"\)"
25 - run-external powershell '-EncodedCommand' ($ps_command | endode base64)
26 - $env | upsert Path $bin
27 - }
28 - }
29 - }
30 -}

nushell/modules/package/installer.nu

Modified
9 9 use ./extractor.nu
10 10 use ./folders.nu
13 +# check if installed packages are synced with current manifests
14 +# check if current installed packages are installed via correct source
12 16 export def install [
13 17 query: string

nushell/modules/package/os_path.nu

Added
new file mode 100644
1 +# setup PATH envrionment for installed packages
3 +use ./folders.nu
5 +# sets PATH, so that it points to installed packages
6 +export def --env setup-system-path [] {
7 + let bin = (folders binaries)
8 + match $nu.os-info.family {
9 + 'unix' => {
10 + if ( $env.PATH | find $bin | is-empty) {
11 + let envd = [$nu.home-path .config environment.d] | path join
12 + if (not ($envd | path exists)) {
13 + error make {msg: $"systemd environment.d must exist under ($envd)!"}
14 + }
15 + let package_conf = [$envd package.conf] | path join
16 + if (not ($package_conf | path exists)) {
17 + let packgage_path = $'PATH = "$PATH:($bin)"'
18 + $packgage_path | save --raw ($package_conf)
19 + $env | upsert PATH $bin
20 + }
21 + }
22 + }
23 + 'windows' => {
24 + if ( $env.Path | find $bin | is-empty ) {
25 + let ps_command = $"
26 + $newPath = [Environment]::GetEnvironmentVariable\(\"Path\", \"User\"\) + \";($bin)\"
27 + [Environment]::SetEnvironmentVariable\(\"Path\", $newPath, \"User\"\)"
28 + run-external powershell '-EncodedCommand' ($ps_command | endode base64)
29 + $env | upsert Path $bin
30 + }
31 + }
32 + }
33 + null

nushell/modules/package/provider.nu

Modified
8 8 # It depends on the availablity of packages in their given source.
10 10 use ./folders.nu
11 -use ./environment_path.nu
11 +use ./os_path.nu
12 12 use ./installer.nu
14 14 export def provision [] {
43 - # check if current installed packages are installed via correct source
44 - # uninstall non-provisioned
46 - environment_path setup
43 + os_path setup-system-path

wezterm/bugabinga/launch.lua

Modified
2 2 local wez = require 'wezterm'
4 4 return function ( cfg )
5 5 cfg.launch_menu = {
6 + {
7 + label = 'Anime (new)',
8 + args = { 'nu', '--execute', 'ani-cli --skip'},
9 + cwd = wez.home_dir,
10 + },
11 + {
12 + label = 'Anime (continue)',
13 + args = { 'nu', '--execute', 'ani-cli --skip --continue'},
14 + cwd = wez.home_dir,
15 + },
7 17 label = 'Upgrade',
8 18 args = { 'topgrade', },