repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim, nushell: maintanence update to newer versions

df581cf616747379b83c55ea7c4eee537fb76e16

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (12)

neovim/lua/bugabinga/colorizer.lua

Modified
1 1 local want = require 'bugabinga.std.want'
2 2 want { 'colorizer' }(function(colorizer)
3 - colorizer.setup({ '*' }, {
4 - RGB = true, -- #RGB hex codes
5 - RRGGBB = true, -- #RRGGBB hex codes
6 - names = false, -- "Name" codes like Blue oe blue
7 - RRGGBBAA = true, -- #RRGGBBAA hex codes
8 - rgb_fn = true, -- CSS rgb() and rgba() functions
9 - hsl_fn = true, -- CSS hsl() and hsla() functions
10 - css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
11 - css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
12 - mode = 'virtualtext', -- Set the display mode.
13 - virtualtext = '■', -- the virtual text block mode = 'background',
14 - })
3 + colorizer.setup {
4 + filetypes = { "*" },
5 + user_default_options = {
6 + RGB = true, -- #RGB hex codes
7 + RRGGBB = true, -- #RRGGBB hex codes
8 + names = true, -- "Name" codes like Blue or blue
9 + RRGGBBAA = false, -- #RRGGBBAA hex codes
10 + AARRGGBB = false, -- 0xAARRGGBB hex codes
11 + rgb_fn = false, -- CSS rgb() and rgba() functions
12 + hsl_fn = false, -- CSS hsl() and hsla() functions
13 + css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
14 + css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
15 + -- Available modes for `mode`: foreground, background, virtualtext
16 + mode = "background", -- Set the display mode.
17 + -- Available methods are false / true / "normal" / "lsp" / "both"
18 + -- True is same as normal
19 + tailwind = false, -- Enable tailwind colors
20 + -- parsers can contain values used in |user_default_options|
21 + sass = { enable = false, parsers = { css }, }, -- Enable sass colors
22 + virtualtext = "■",
23 + },
24 + -- all the sub-options of filetypes apply to buftypes
25 + buftypes = {},
26 + }
15 28 end)

neovim/lua/bugabinga/colortheme.lua

Modified
1 1 local want = require 'bugabinga.std.want'
2 2 want { 'boo-colorscheme' } (function(boo)
3 - boo.use()
3 + local themes = { 'sunset_cloud', 'radioactive_waste', 'forest_stream', 'crimson_moonlight'}
4 + local random_theme = themes[(math.floor(math.random() * #themes))]
5 + boo.use{
6 + italic = true,
7 + theme = random_theme,
8 + }
4 9 vim.api.nvim_set_hl(0, 'LspReferenceText', {})
5 10 vim.api.nvim_set_hl(0, 'LspReferenceRead', {
6 11 standout = true,

neovim/lua/bugabinga/lsp.lua

Modified
10 10 'lsp-zero',
11 11 'null-ls',
12 12 'nvim-lsp-installer',
13 - 'lua-dev',
13 + 'neodev',
14 14 'rust-tools',
15 15 'nvim-navic',
16 16 'lsp-status',
17 -} (function(zero, null_ls, installer, luadev, rust, navic, lsp_status)
17 +} (function(zero, null_ls, installer, neodev, rust, navic, lsp_status)
18 18 installer.settings {
19 19 ui = {
20 20 --TODO: use some global float window settings
50 50 zero.build_options('jdtls', {})
52 52 -- lua neovim lsp
53 - luadev.setup {
53 + neodev.setup {
54 54 lspconfig = zero.defaults.nvim_workspace(),
76 76 sources = {
77 77 formatting.stylua,
78 78 formatting.clang_format,
79 - formatting.codespell,
80 79 formatting.jq,
81 80 formatting.protolint,
82 81 formatting.shellharden,
88 87 diagnostics.actionlint.with(diagnostics_on_save),
89 88 diagnostics.checkmake.with(diagnostics_on_save),
90 - diagnostics.codespell.with(diagnostics_on_save),
91 - diagnostics.editorconfig_checker.with(diagnostics_on_save).with { command = 'editorconfig-checker' },
92 89 diagnostics.gitlint.with(diagnostics_on_save),
93 90 diagnostics.protoc_gen_lint.with(diagnostics_on_save),
94 91 diagnostics.protolint.with(diagnostics_on_save),
114 111 local function setup_keybinds_and_actions(client, buffer_number)
115 112 -- TODO: make format changed lines command
116 - local capabilities = client.resolved_capabilities
113 + local capabilities = client.server_capabilities
117 114 if capabilities.document_formatting then
119 116 description = 'Format buffer using LSP',

neovim/lua/bugabinga/options/ui.lua

Modified
72 72 vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
74 74 -- font
75 -vim.opt.guifont = 'BlexMono Nerd Font:h11:antialias=true'
75 +vim.opt.guifont = 'BlexMono NF:h16:antialias=true'
77 77 -- neovide only options
78 78 if vim.g.neovide then

neovim/lua/bugabinga/plugins/init.lua

Modified
67 67 -- show color values inline
68 68 -- this plugins seems a little unmaintained right now.
69 69 -- using some forks for now
70 - --'norcalli/nvim-colorizer.lua',
71 - --'NvChad/nvim-colorizer.lua',
72 - 'lasse16/nvim-colorizer.lua',
70 + 'NvChad/nvim-colorizer.lua',
73 71 -- intelligent commenting
74 72 'numToStr/Comment.nvim',
75 73 -- show git status in ui

neovim/lua/bugabinga/registers.lua

Modified
1 --- vim.g.registers_return_symbol = "\n" --'⏎' by default
2 --- vim.g.registers_tab_symbol = "\t" --'·' by default
3 --- vim.g.registers_space_symbol = " " --' ' by default
4 -vim.g.registers_delay = 0 --0 by default, milliseconds to wait before opening the popup window
5 -vim.g.registers_register_key_sleep = 0 --0 by default, seconds to wait before closing the window when a register key is pressed
6 -vim.g.registers_show_empty_registers = 1 --1 by default, an additional line with the registers without content
7 -vim.g.registers_trim_whitespace = 1 --1 by default, don't show whitespace at the begin and end of the registers
8 -vim.g.registers_hide_only_whitespace = 1 --0 by default, don't show registers filled exclusively with whitespace
9 -vim.g.registers_window_border = 'rounded' --'none' by default, can be 'none', 'single','double', 'rounded', 'solid', or 'shadow' (requires Neovim 0.5.0+)
10 -vim.g.registers_window_min_height = 3 --3 by default, minimum height of the window when there is the cursor at the bottom
11 -vim.g.registers_window_max_width = 100 --100 by default, maximum width of the window
12 -vim.g.registers_normal_mode = 1 --1 by default, open the window in normal mode
13 -vim.g.registers_visual_mode = 1 --1 by default, open the window in visual mode
14 -vim.g.registers_insert_mode = 1 --1 by default, open the window in insert mode
15 --- vim.g.registers_show = "*+\"" --'*+\"-/_=#%.0123456789abcdefghijklmnopqrstuvwxyz' by default, which registers to show and in what order
1 +local want = require 'bugabinga.std.want'
2 +want{ 'registers' } (function(registers)
3 + registers.setup {
5 + -- Show these registers in the order of the string
6 + show = "*+\"-/_=#%.0123456789abcdefghijklmnopqrstuvwxyz:",
7 + -- Show a line at the bottom with registers that aren't filled
8 + show_empty = true,
9 + -- Expose the :Registers user command
10 + register_user_command = true,
11 + -- Always transfer all selected registers to the system clipboard
12 + system_clipboard = true,
13 + -- Don't show whitespace at the begin and end of the register's content
14 + trim_whitespace = true,
15 + -- Don't show registers which are exclusively filled with whitespace
16 + hide_only_whitespace = true,
17 + -- Show a character next to the register name indicating how the register will be applied
18 + show_register_types = true,
20 + bind_keys = {
21 + -- Show the window when pressing " in normal mode, applying the selected register as part of a motion, which is the default behavior of Neovim
22 + normal = registers.show_window({ mode = "motion" }),
23 + -- Show the window when pressing " in visual mode, applying the selected register as part of a motion, which is the default behavior of Neovim
24 + visual = registers.show_window({ mode = "motion" }),
25 + -- Show the window when pressing <C-R> in insert mode, inserting the selected register, which is the default behavior of Neovim
26 + insert = registers.show_window({ mode = "insert" }),
28 + -- When pressing the key of a register, apply it with a very small delay, which will also highlight the selected register
29 + registers = registers.apply_register({ delay = 0.1 }),
30 + -- Immediately apply the selected register line when pressing the return key
31 + return_key = registers.apply_register(),
32 + -- Close the registers window when pressing the Esc key
33 + escape = registers.close_window(),
35 + -- Move the cursor in the registers window down when pressing <C-N>
36 + ctrl_n = registers.move_cursor_down(),
37 + -- Move the cursor in the registers window up when pressing <C-P>
38 + ctrl_p = registers.move_cursor_up(),
39 + -- Move the cursor in the registers window down when pressing <C-J>
40 + ctrl_j = registers.move_cursor_down(),
41 + -- Move the cursor in the registers window up when pressing <C-K>
42 + ctrl_k = registers.move_cursor_up(),
43 + },
45 + events = {
46 + -- When a register line is highlighted, show a preview in the main buffer with how the register will be applied, but only if the register will be inserted or pasted
47 + on_register_highlighted = registers.preview_highlighted_register({ if_mode = { "insert", "paste" } }),
48 + },
50 + symbols = {
51 + -- Show a special character for line breaks
52 + newline = "⏎",
53 + -- Show space characters without changes
54 + space = " ",
55 + -- Show a special character for tabs
56 + tab = "·",
57 + -- The character to show when a register will be applied in a char-wise fashion
58 + register_type_charwise = "ᶜ",
59 + -- The character to show when a register will be applied in a line-wise fashion
60 + register_type_linewise = "ˡ",
61 + -- The character to show when a register will be applied in a block-wise fashion
62 + register_type_blockwise = "ᵇ",
63 + },
65 + window = {
66 + -- The window can't be wider than 100 characters
67 + max_width = 100,
68 + -- Show a small highlight in the sign column for the line the cursor is on
69 + highlight_cursorline = true,
70 + -- Don't draw a border around the registers window
71 + border = "rounded",
72 + -- Apply a tiny bit of transparency to the the window, letting some characters behind it bleed through
73 + transparency = 10,
74 + },
76 + -- Highlight the sign registers as regular Neovim highlights
77 + sign_highlights = {
78 + cursorline = "Visual",
79 + selection = "Constant",
80 + default = "Function",
81 + unnamed = "Statement",
82 + read_only = "Type",
83 + expression = "Exception",
84 + black_hole = "Error",
85 + alternate_buffer = "Operator",
86 + last_search = "Tag",
87 + delete = "Special",
88 + yank = "Delimiter",
89 + history = "Number",
90 + named = "Todo",
91 + },
93 + }
94 +end)

neovim/lua/bugabinga/search.lua

Modified
3 3 local map = require 'bugabinga.std.keymap'
4 4 local want = require 'bugabinga.std.want'
6 6 want { 'hlslens' } (function(lens)
8 + lens.setup()
8 10 -- this highlight links by default to WildMenu, which is to offensive
9 11 vim.api.nvim_set_hl(0, 'HlSearchLens', { link = 'Search' })

neovim/lua/bugabinga/treesitter.lua

Modified
10 10 'neogen',
11 11 } (function(install, configs, parsers, hlargs, neogen)
12 12 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
13 - -- install.prefer_git = true
13 + install.prefer_git = true
15 15 configs.setup {
16 16 -- A list of parser names, or "all"
17 17 ensure_installed = 'all',
18 - -- Install parsers synchronously (only applied to `ensure_installed`)
19 - sync_install = true,
18 + -- Install parsers asynchronously (only applied to `ensure_installed`)
19 + -- The synchronous install method seems to rely on a posix shell, which i
20 + -- do not use.
21 + sync_install = false,
20 22 -- Automatically install missing parsers when entering buffer
21 23 auto_install = true,

nushell/config.nu

Modified
269 269 event: { send: menu name: commands_with_description }
273 +# must be done, after defining config, since zoxide mutates it
274 +use zoxide.nu *

nushell/modules/prompt.nu

Modified
1 -# Custom integration of zoxide into nushell.
2 -# Since nushell 0.60.0 the autogenerated code of zoxide is no longer useful.
3 -# =============================================================================
4 -#
5 -# Hook configuration for zoxide.
6 -#
8 -# Hook to add new entries to the database.
9 -# This hook gets exported out of the module so that it can be integrated inot the prompt
10 -def zoxide-hook [] {
11 - shells
12 - | where active == true
13 - | get path
14 - | each { | path | zoxide add -- $path }
15 - | ignore
18 -# =============================================================================
20 -# Jump to a directory using only keywords.
21 -export def-env zoxide-jump [...rest:string] {
22 - let span = (metadata $rest).span
23 - #normalize path
24 - let pwd = ($env.PWD | path expand)
25 - let z_jump = ( do --ignore-errors { zoxide query --exclude $pwd -- $rest } )
27 - if ($z_jump | is-empty) {
28 - error make {
29 - msg: "Zoxide could not find any match for the given query.",
30 - label: {
31 - text: "no matches for this query",
32 - start: $span.start,
33 - end: $span.end
34 - }
35 - }
36 - }
38 - # zoxide returns even single results with a newline at the end...
39 - cd ($z_jump | str trim --right --char (char newline) )
42 -export alias z = zoxide-jump
44 1 # Map of paths to icons.
45 2 # These will be used to replace certain path segments in the prompt for example.
46 3 # Order these paths for precedence.
89 46 def create_left_prompt [] {
90 - zoxide-hook
91 47 set-window-title
93 49 # normalize path
130 86 ] | str collect
133 -# Use nushell functions to define your right and left prompt
134 -export def-env PROMPT_COMMAND [] { create_left_prompt }
135 -export def-env PROMPT_COMMAND_RIGHT [] { create_right_prompt }
89 +export-env {
90 + # Use nushell functions to define your right and left prompt
91 + let-env PROMPT_COMMAND = { create_left_prompt }
92 + let-env PROMPT_COMMAND_RIGHT = { create_right_prompt }
137 -# The prompt indicators are environmental variables that represent
138 -# the state of the prompt
139 -export def-env PROMPT_INDICATOR [] { $"(ansi purple) (char prompt) (ansi reset)" }
140 -export def-env PROMPT_INDICATOR_VI_INSERT [] { $"(ansi purple) (char pipe) (ansi reset)" }
141 -export def-env PROMPT_INDICATOR_VI_NORMAL [] { $"(ansi purple) (char prompt) (ansi reset)" }
142 - export def-env PROMPT_MULTILINE_INDICATOR [] { $"(ansi purple) (char prompt)(char prompt) (ansi reset)" }
94 + # The prompt indicators are environmental variables that represent
95 + # the state of the prompt
96 + let-env PROMPT_INDICATOR = $"(ansi purple) (char prompt) (ansi reset)"
97 + let-env PROMPT_INDICATOR_VI_INSERT = $"(ansi purple) (char pipe) (ansi reset)"
98 + let-env PROMPT_INDICATOR_VI_NORMAL = $"(ansi purple) (char prompt) (ansi reset)"
99 + let-env PROMPT_MULTILINE_INDICATOR = $"(ansi purple) (char prompt)(char prompt) (ansi reset)"

nushell/modules/zoxide.nu

Added
new file mode 100644
1 +# Code generated by zoxide. DO NOT EDIT.
3 +# =============================================================================
4 +#
5 +# Hook configuration for zoxide.
6 +#
8 +# Initialize hook to add new entries to the database.
9 +export-env {
10 + let-env config = ($env | default {} config).config
11 + let-env config = ($env.config | default {} hooks)
12 + let-env config = ($env.config | update hooks ($env.config.hooks | default [] pre_prompt))
13 + let-env config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append {
14 + zoxide add -- $env.PWD
15 + }))
18 +# =============================================================================
20 +# When using zoxide with --no-cmd, alias these internal functions as desired.
23 +# Jump to a directory using only keywords.
24 +export def-env __zoxide_z [...rest:string] {
25 + # `z -` does not work yet, see https://github.com/nushell/nushell/issues/4769
26 + let arg0 = ($rest | append '~').0
27 + let path = if (($rest | length) <= 1) && ($arg0 == '-' || ($arg0 | path expand | path type) == dir) {
28 + $arg0
29 + } else {
30 + (zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n")
31 + }
32 + cd $path
35 +# Jump to a directory using interactive search.
36 +export def-env __zoxide_zi [...rest:string] {
37 + cd $'(zoxide query -i -- $rest | str trim -r -c "\n")'
40 +# =============================================================================
42 +# Commands for zoxide. Disable these using --no-cmd.
45 +export alias z = __zoxide_z
46 +export alias zi = __zoxide_zi
48 +# =============================================================================
50 +# Add this to your env file (find it by running `$nu.env-path` in Nushell):
52 +# zoxide init nushell --hook prompt | save ~/.zoxide.nu
54 +# Now, add this to the end of your config file (find it by running
55 +# `$nu.config-path` in Nushell):
57 +# source ~/.zoxide.nu
59 +# Note: zoxide only supports Nushell v0.63.0 and above.

tools/cargo-tools.nu

Modified
46 46 [ "selene" "selene" [ "--no-default-features" ] ]
47 47 [ "stylua" "stylua" [ "--features" "lua52" ] ]
48 48 [ "taplo-cli" "taplo" [] ]
49 + [ "lms" "lms" [] ]
49 50 [ "coreutils" "coreutils" (coreutils-features) ]