repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk

b1f3fe131f7ecee1799f8566755dbdc38df184c2

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (14)

git/gitconfig

Modified
1 1 [user]
2 - name = Oliver Jan Krylow
3 - email = oliver@bugabinga.net
2 + name = Oliver Jan Krylow
3 + email = oliver@bugabinga.net
5 5 [core]
6 - editor = nvim
7 - quotepath = false
8 - autocrlf = input
9 - pager = delta
10 - safecrlf = false
11 - symlinks = true
12 - fscache = true
6 + editor = nvim
7 + quotepath = false
8 + autocrlf = input
9 + pager = delta
10 + safecrlf = false
11 + symlinks = true
12 + fscache = true
13 13 preloadIndex = true
15 15 [help]
23 23 autosquash = true
25 25 [diff]
26 - colorMoved = default
27 - tool = difftastic
26 + colorMoved = default
27 + tool = difftastic
29 29 [difftool]
30 - prompt = false
30 + prompt = false
32 32 [difftool "meld"]
33 - cmd = "meld \"$LOCAL\" \"$REMOTE\""
33 + cmd = "meld \"$LOCAL\" \"$REMOTE\""
35 35 [difftool "difftastic"]
36 - cmd = "difft \"$LOCAL\" \"$REMOTE\""
36 + cmd = "difft \"$LOCAL\" \"$REMOTE\""
38 38 [pager]
39 - difftool = true
39 + difftool = true
41 41 [merge]
42 - tool = nvim_merge
42 + tool = nvim_merge
44 44 [mergetool]
45 - keepBackup = false
46 - prompt = false
45 + keepBackup = false
46 + prompt = false
48 48 [mergetool "meld_merge"]
49 - cmd = "meld \"$LOCAL\" \"$MERGED\" \"$REMOTE\" "
49 + cmd = "meld \"$LOCAL\" \"$MERGED\" \"$REMOTE\" "
51 51 [mergetool "nvim_merge"]
52 - cmd = "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\" "
52 + cmd = "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\" "
54 54 [push]
55 - autoSetupRemote = true
56 - default = "upstream"
55 + autoSetupRemote = true
56 + default = "upstream"
58 58 [pull]
59 - rebase = false
59 + rebase = false
61 61 [interactive]
62 - diffFilter = delta --color-only
62 + diffFilter = delta --color-only
64 64 [delta]
65 - side-by-side = true
66 - line-numbers = true
67 - decorations = true
68 - navigate = true
69 - syntax-theme = none
65 + side-by-side = true
66 + line-numbers = true
67 + decorations = true
68 + navigate = true
69 + syntax-theme = none
71 71 [interactive]
72 - diffFilter = delta --color-only
72 + diffFilter = delta --color-only
74 74 [init]
75 - defaultBranch = trunk
75 + defaultBranch = trunk
77 77 [commit]
78 - verbose = true
78 + verbose = true
80 80 [help]
81 81 # try to automatically correct mispelled git commands
82 - autocorrect = 7
82 + autocorrect = 7
84 84 # In order to have host-specific configuration, I include additional settings here.
85 85 # On each host a different file might be symlinked into '.gitconfig.include'.
86 86 [include]
87 - path = .gitconfig.include
87 + path = .gitconfig.include

neovim/init.lua

Modified
8 8 -- ▀▀▀ █ █ ██ █
9 9 -- ▀ ▀
11 +-- enable lua bytecode caching
12 +vim.loader.enable()
11 14 -- setup debug mode
12 15 -- require 'std.debug'.toggle()

neovim/lua/bugabinga/editorconfig.lua

Modified
31 31 editorconfig.properties.diagnostic = function ( bufnr, value )
32 32 local option = tobool( value )
33 33 if option then
34 - vim.diagnostic.enable( bufnr )
34 + vim.diagnostic.enable( true, { bufnr = bufnr, } )
35 35 else
36 - vim.diagnostic.disable( bufnr )
36 + vim.diagnostic.enable( false, { bufnr = bufnr } )

neovim/lua/bugabinga/plugins/lint.lua

Modified
10 10 opts = {
11 11 linters_by_ft = {
12 - lua = { 'luacheck', },
12 + lua = { 'selene', },
13 13 sh = { 'shellcheck', },
14 - nu = { 'nu-check', },
14 + -- TODO make this linter
15 + -- nu = { 'nu-check', },
16 17 linters = {},

nushell/config.nu

Modified
1 1 # Nushell Config File
2 -use table.nu *
3 -use os.nu *
4 -use prompt.nu *
5 -use aliases.nu *
6 -use todo.nu
7 -use openssl.nu *
2 +use modules/table.nu *
3 +use modules/os.nu *
4 +use modules/prompt.nu *
5 +use modules/aliases.nu *
6 +use modules/todo.nu
7 +use modules/openssl.nu *
8 +use modules/md.nu
10 +# TODO: use nugu colors
9 11 # for more information on themes see
10 12 # https://github.com/nushell/nushell/blob/main/docs/How_To_Coloring_and_Theming.md
11 13 let default_theme = {
79 81 quick: true # set this to false to prevent auto-selecting completions when only one remains
80 82 partial: true # set this to false to prevent partial filling of the prompt
82 - hooks: {
83 - pre_prompt: [{||
84 - if (which direnv | is-empty) {
85 - return
86 - }
87 - direnv export json | from json | default {} | load-env
88 - }]
89 - }
90 84 float_precision: 2
91 85 use_ansi_coloring: true
92 86 filesize: {
99 93 max_size: 10000
100 94 sync_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
102 - menus: [
103 - # Configuration for default nushell menus
104 - # Note the lack of source parameter
105 - {
106 - name: completion_menu
107 - only_buffer_difference: false
108 - marker: "| "
109 - type: {
110 - layout: columnar
111 - columns: 4
112 - # col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
113 - col_padding: 2
114 - }
115 - style: {
116 - text: green
117 - selected_text: green_reverse
118 - description_text: yellow
119 - }
120 - }
121 - {
122 - name: history_menu
123 - only_buffer_difference: true
124 - marker: "? "
125 - type: {
126 - layout: list
127 - page_size: 10
128 - }
129 - style: {
130 - text: green
131 - selected_text: green_reverse
132 - description_text: yellow
133 - }
134 - }
135 - {
136 - name: help_menu
137 - only_buffer_difference: true
138 - marker: "? "
139 - type: {
140 - layout: description
141 - columns: 4
142 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
143 - col_padding: 2
144 - selection_rows: 4
145 - description_rows: 10
146 - }
147 - style: {
148 - text: green
149 - selected_text: green_reverse
150 - description_text: yellow
151 - }
152 - }
153 - # Example of extra menus created using a nushell source
154 - # Use the source field to create a list of records that populates
155 - # the menu
156 - {
157 - name: commands_menu
158 - only_buffer_difference: false
159 - marker: "# "
160 - type: {
161 - layout: columnar
162 - columns: 4
163 - col_width: 20
164 - col_padding: 2
165 - }
166 - style: {
167 - text: green
168 - selected_text: green_reverse
169 - description_text: yellow
170 - }
171 - source: { |buffer, position|
172 - $nu.scope.commands
173 - | where command =~ $buffer
174 - | each { |it| {value: $it.command description: $it.usage} }
175 - }
176 - }
177 - {
178 - name: vars_menu
179 - only_buffer_difference: true
180 - marker: "# "
181 - type: {
182 - layout: list
183 - page_size: 10
184 - }
185 - style: {
186 - text: green
187 - selected_text: green_reverse
188 - description_text: yellow
189 - }
190 - source: { |buffer, position|
191 - $nu.scope.vars
192 - | where name =~ $buffer
193 - | sort-by name
194 - | each { |it| {value: $it.name description: $it.type} }
195 - }
196 - }
197 - {
198 - name: commands_with_description
199 - only_buffer_difference: true
200 - marker: "# "
201 - type: {
202 - layout: description
203 - columns: 4
204 - col_width: 20
205 - col_padding: 2
206 - selection_rows: 4
207 - description_rows: 10
208 - }
209 - style: {
210 - text: green
211 - selected_text: green_reverse
212 - description_text: yellow
213 - }
214 - source: { |buffer, position|
215 - $nu.scope.commands
216 - | where command =~ $buffer
217 - | each { |it| {value: $it.command description: $it.usage} }
218 - }
219 - }
220 - ]
221 - keybindings: [
222 - {
223 - name: completion_menu
224 - modifier: none
225 - keycode: tab
226 - mode: emacs # Options: emacs vi_normal vi_insert
227 - event: {
228 - until: [
229 - { send: menu name: completion_menu }
230 - { send: menunext }
231 - ]
232 - }
233 - }
234 - {
235 - name: completion_previous
236 - modifier: shift
237 - keycode: backtab
238 - mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list
239 - event: { send: menuprevious }
240 - }
241 - {
242 - name: history_menu
243 - modifier: control
244 - keycode: char_x
245 - mode: emacs
246 - event: {
247 - until: [
248 - { send: menu name: history_menu }
249 - { send: menupagenext }
250 - ]
251 - }
252 - }
253 - {
254 - name: history_previous
255 - modifier: control
256 - keycode: char_z
257 - mode: emacs
258 - event: {
259 - until: [
260 - { send: menupageprevious }
261 - { edit: undo }
262 - ]
263 - }
264 - }
265 - # Keybindings used to trigger the user defined menus
266 - {
267 - name: commands_menu
268 - modifier: control
269 - keycode: char_t
270 - mode: [emacs, vi_normal, vi_insert]
271 - event: { send: menu name: commands_menu }
272 - }
273 - {
274 - name: vars_menu
275 - modifier: control
276 - keycode: char_y
277 - mode: [emacs, vi_normal, vi_insert]
278 - event: { send: menu name: vars_menu }
279 - }
280 - {
281 - name: commands_with_description
282 - modifier: control
283 - keycode: char_u
284 - mode: [emacs, vi_normal, vi_insert]
285 - event: { send: menu name: commands_with_description }
286 - } ]
289 98 # must be done, after defining config, since zoxide mutates it
290 -use zoxide.nu *
99 +# this will fail if zoxide is not installed yet
100 +source ($nu.config-path | path dirname | path join "zoxide.nu")

nushell/env.nu

Modified
3 3 # GLOBAL VARIABLES
5 5 $env.WIN32 = ( $nu.os-info.name =~ "windows" )
6 6 $env.NURC_DIR = ( $nu.config-path | path expand | path dirname )
7 7 $env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )
8 -$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
9 -$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
8 +$env.WORKSPACE = if $env.WIN32 { "~/Workspaces" } else { "~/Workspace" | path expand }
9 +$env.NOTES = ("~/Notes" | path expand)
10 +$env.TOOLS = ("~/Tools" | path expand)
11 12 if not (which nvim | is-empty) {
12 13 $env.EDITOR = 'nvim'
18 19 if ($env | get -i TERM_PROGRAM) == WezTerm {
19 - $env.TERM = "wezterm"
20 - if not $env.WIN32 {
21 - $env.TERMCAP = ~./termcap/w/wezterm
22 - }
20 + $env.TERM = "xterm-256color"
25 23 # theme for ls and other programs, that use LS_COLORS
39 37 to_string: { |v| $v | str join (char esep) }
43 -# Directories to search for scripts when calling source or use
44 -$env.NU_LIB_DIRS = [
45 - ($nu.config-path | path dirname | path join 'modules'),
46 - ($nu.config-path | path dirname | path join 'completions')
47 -]

nushell/modules/md.nu

Added
new file mode 100644
1 +# create new directory and change into to.
2 +export def --env main [ p:path ] {
3 + mkdir $p
4 + cd $p
5 +}

nushell/modules/prompt.nu

Modified
36 +def prompt-git-branch [] {
36 39 def get_vcs_path [] {
37 40 #normalize path
38 41 let pwd = ($env.PWD | path expand)
40 43 let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd | complete } )
41 44 let svn_relative_path = if ( (not ($svn_relative_cmd | is-empty)) and ($svn_relative_cmd.exit_code == 0)) { $" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
43 - let git_status = ( do --ignore-errors { gstat } )
44 - let git_branch = if ( ( not ($git_status | is-empty)) and ($git_status.branch != "no_branch") ) { $" (char nf_git) (char nf_branch) ($git_status.branch)" }
46 + let git_branch_cmd = ( do -i { ^git rev-parse --abbrev-ref HEAD | complete } )
47 + let git_path = if (not ($git_branch_cmd | is-empty) and ($git_branch_cmd.exit_code == 0)) { $" (char nf_git) (char nf_branch) ($git_branch_cmd.stdout | str trim -r)" }
47 50 $svn_relative_path
48 - $git_branch
51 + $git_path
49 52 ] | str join
87 90 $command_status_segment
88 91 (ansi reset)
89 92 (ansi dark_gray)
90 - ( if (sys).host.hostname == "x230" { (akku) } else { $time_segment })
93 + ( if (sys host).hostname == "x230" { (akku) } else { $time_segment })
91 94 (ansi reset)
92 95 ] | str join

nushell/modules/zoxide.nu

Deleted
deleted 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 - $env.config = ($env | default {} config).config
11 - $env.config = ($env.config | default {} hooks)
12 - $env.config = ($env.config | update hooks ($env.config.hooks | default [] pre_prompt))
13 - $env.config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append { ||
14 - zoxide add -- $env.PWD
15 - }))
16 -}
18 -# =============================================================================
19 -#
20 -# When using zoxide with --no-cmd, alias these internal functions as desired.
21 -#
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) and ($arg0 == '-' or ($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
33 -}
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")'
38 -}
40 -# =============================================================================
41 -#
42 -# Commands for zoxide. Disable these using --no-cmd.
43 -#
45 -export alias z = __zoxide_z
46 -export alias zi = __zoxide_zi
48 -# =============================================================================
49 -#
50 -# Add this to your env file (find it by running `$nu.env-path` in Nushell):
51 -#
52 -# zoxide init nushell --hook prompt | save ~/.zoxide.nu
53 -#
54 -# Now, add this to the end of your config file (find it by running
55 -# `$nu.config-path` in Nushell):
56 -#
57 -# source ~/.zoxide.nu
58 -#
59 -# Note: zoxide only supports Nushell v0.63.0 and above.

tools/cargo-tools.nu

Modified
6 6 # is not installed yet
7 7 let cargo_crates = [
8 8 [ name bin crago_args];
9 - [ "inferno" "inferno-flamegraph" [] ]
10 - [ "nu" "nu" [ "--features" "extra" ] ]
11 - [ "sd" "sd" [] ]
12 - [ "ouch" "ouch" [] ]
13 - [ "fd-find" "fd" [] ]
14 - [ "choose", "choose", [] ]
15 - [ "ripgrep" "rg" [] ]
16 - [ "eva" "eva" [] ]
17 - [ "mdcat" "mdcat" [] ]
18 - [ "cargo-update" "cargo-install-update" [] ]
9 + [ "bat" "bat" [] ]
10 + [ "bottom" "btm" [] ]
19 11 [ "cargo-cache" "cargo-cache" [] ]
12 + [ "cargo-update" "cargo-install-update" [] ]
13 + [ "choose", "choose", [] ]
14 + [ "eva" "eva" [] ]
15 + [ "eva" "eva" [] ]
16 + [ "fd-find" "fd" [] ]
17 + [ "git-delta" "delta" [] ]
18 + [ "gitu" "gitu" [ "--locked" ] ]
20 19 [ "hexyl" "hexyl" [] ]
21 20 [ "hyperfine" "hyperfine" [] ]
22 - [ "tealdeer" "tldr" [] ]
23 - [ "tokei" "tokei" [] ]
24 - [ "bat" "bat" [] ]
25 - [ "pastel" "pastel" [] ]
26 - [ "zoxide" "zoxide" [] ]
27 - [ "lychee" "lychee" [] ]
28 - [ "viu" "viu" [] ]
29 - [ "vivid" "vivid" [] ]
30 - [ "bottom" "btm" [] ]
31 21 [ "just" "just" [] ]
22 + [ "lms" "lms" [] ]
23 + [ "lychee" "lychee" [ "--locked" "--no-default-features" "--features" "rustls-tls,email-check"] ]
24 + [ "mdcat" "mdcat" [] ]
32 25 [ "mdsh" "mdsh" [] ]
33 - [ "git-delta" "delta" [] ]
26 + [ "nu" "nu" [ "--features" "extra" ] ]
27 + [ "ouch" "ouch" [] ]
28 + [ "pastel" "pastel" [] ]
29 + [ "ripgrep" "rg" [] ]
30 + [ "sd" "sd" [] ]
34 31 [ "selene" "selene" [ "--no-default-features" ] ]
35 32 [ "stylua" "stylua" [ "--features" "lua52" ] ]
36 33 [ "taplo-cli" "taplo" [] ]
37 - [ "lms" "lms" [] ]
38 - [ "gitu" "gitu" [ "--locked" ] ]
39 - [ "yazi-fm" "yazi" [ "--locked" ] ]
34 + [ "tealdeer" "tldr" [] ]
35 + [ "tokei" "tokei" [] ]
36 + [ "viu" "viu" [] ]
37 + [ "vivid" "vivid" [] ]
40 38 [ "yazi-cli" "ya" [ "--locked" ] ]
39 + [ "yazi-fm" "yazi" [ "--locked" ] ]
40 + [ "zoxide" "zoxide" [] ]
43 43 # install all my favorite crate, only if they are not already in PATH.

topgrade/topgrade.linux.toml

Modified
44 44 "00 - Refresh Dotfiles" = "java ~/Workspace/dotfiles/bootstripper.java ~/Workspace/dotfiles"
46 46 # install tools from cargo, that are not already in path
47 -# TODO: this could be annoying when setting up a machine first time?
48 47 "01 - Install Cargo Tools" = "nu --env-config ~/.config/nushell/env.nu ~/Workspace/dotfiles/tools/cargo-tools.nu"

topgrade/topgrade.windows.toml

Modified
25 25 [git]
26 26 # Additional git repositories to pull
27 -repos = ["W:/*/"]
27 +repos = ["C:/Users/okr/Workspaces/*/"]
29 29 max_concurrency = 12
39 39 # Commands to run before anything
40 40 [pre_commands]
41 -"01 - Scoop Export" = "scoop export --config > 'X:/scoop_installed_apps.json' *> $null"
41 +"01 - Winget Export" = "winget export --disable-interactivity --accept-source-agreements --output 'C:/Users/okr/Tools/winget_installed_apps.json' *> $null"
43 43 [commands]
44 -"00 - Register Nu Plugins" = "nu -c 'register ~\\scoop\\apps\\nu\\current\\nu_plugin_gstat.exe'"
45 44 "10 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
46 45 "20 - Install Cargo Tools" = "nu --env-config ~/AppData/Roaming/nushell/env.nu W:/dotfiles/tools/cargo-tools.nu"
47 46 "30 - Advantage-PM Client" = "nu X:/update_apm_client.nu"

wezterm/bugabinga/workspaces.lua

Modified
4 4 local wez = require 'wezterm'
5 5 local mux = wez.mux
6 6 local win32 = wez.target_triple:find'windows'
8 8 local get_my_code_workspace = function()
9 9 if win32 then
10 - return 'W:/'
10 + return wez.home_dir .. '/Workspaces'
11 11 else
12 - return os.getenv 'HOME' .. '/Workspace'
12 + return wez.home_dir .. '/Workspace'
61 61 wez.on('gui-attached', function()
62 + -- setup_workspaces()
62 63 maximize_window()
63 64 end)
65 66 -- NOTE(oli): errors in here do not show up as configuration errors
66 67 -- check the log file in the wezterm mux server runtime directory
67 68 -- e.g. /run/user/1000/wezterm/log
68 -wez.on('mux-startup', function()
69 - setup_workspaces()
70 -end)
69 +-- NOTE: mux seems buggy and slow. not sure why or how to really repro
70 +-- wez.on('mux-startup', function()
71 +-- setup_workspaces()
72 +-- end)

wezterm/wezterm.lua

Modified
16 16 -- local font = wez.font 'IBM Plex Mono'
17 17 local font = wez.font 'Cousine'
18 18 if hostname == 'x230' then
19 - font_size = 13
19 + font_size = 11
20 20 enable_wayland = true
21 21 elseif hostname == 'NB-00718' then
22 - font_size = 15
22 + font_size = 13
23 23 elseif hostname == 'fedora' then
24 24 font_size = 13
25 25 local font_names = {}
102 102 default_prog = { 'nu', '--login' },
103 103 default_cursor_style = 'SteadyBlock',
105 - exec_domains = not win32 and exec_domains or {},
106 - unix_domains = { { name = 'mux' } },
107 - default_gui_startup_args = { 'connect', 'mux' },
105 + exec_domains = exec_domains,
106 + -- unix_domains = { { name = 'mux' } },
107 + -- default_gui_startup_args = { 'connect', 'mux' },
109 109 font = font,
110 110 font_size = font_size,