repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

6f527e0543bc88768c986d268bfac923bcc574f0

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

unsigned

Browse filesCompare with HEAD

Changed files (21)

+1053 / −974 text lines

Diff layout

EJ-PC-00363.symlinks

Modified

+47 / −44 text lines

1git/gitconfig
2~/.gitconfig
3
4git/gitconfig.EJ-PC-00363
5~/.gitconfig.include
6
7topgrade/topgrade.windows.toml
8~/AppData/Roaming/topgrade.toml
9
10nushell
11~/AppData/Roaming/nushell
13bottom
14~/AppData/Roaming/bottom
16stackoverflow/so
17~/AppData/Roaming/Sam Tay/so
19subversion/config.win32
20~/AppData/Roaming/Subversion/config
22subversion/diff.bat
23~/AppData/Roaming/Subversion/diff.bat
25subversion/diff3.bat
26~/AppData/Roaming/Subversion/diff3.bat
28subversion/merge.bat
29~/AppData/Roaming/Subversion/merge.bat
31cargo/config.toml
32~/scoop/persist/rustup/.cargo/config.toml
34indexa/config.windows.toml
35~/AppData/Roaming/indexa/config.toml
37wezterm
38~/.config/wezterm
40helix/config.toml
41~/AppData/Roaming/helix/config.toml
43helix/themes
44~/AppData/Roaming/helix/themes
1git/gitconfig
2~/.gitconfig
3
4git/gitconfig.EJ-PC-00363
5~/.gitconfig.include
6
7topgrade/topgrade.windows.toml
8~/AppData/Roaming/topgrade.toml
9
10nushell
11~/AppData/Roaming/nushell
12
13bottom
14~/AppData/Roaming/bottom
15
16stackoverflow/so
17~/AppData/Roaming/Sam Tay/so
18
19subversion/config.win32
20~/AppData/Roaming/Subversion/config
21
22subversion/diff.bat
23~/AppData/Roaming/Subversion/diff.bat
24
25subversion/diff3.bat
26~/AppData/Roaming/Subversion/diff3.bat
27
28subversion/merge.bat
29~/AppData/Roaming/Subversion/merge.bat
30
31cargo/config.toml
32~/scoop/persist/rustup/.cargo/config.toml
33
34indexa/config.windows.toml
35~/AppData/Roaming/indexa/config.toml
36
37wezterm
38~/.config/wezterm
39
40helix/config.toml
41~/AppData/Roaming/helix/config.toml
42
43helix/themes
44~/AppData/Roaming/helix/themes
45
46alacritty/alacritty.yml
47~/AppData/Roaming/alacritty/alacritty.yml

NB-00718.symlinks

Added
new file mode 100644

+53 / −0 text lines

1git/gitconfig
2~/.gitconfig
3
4git/gitconfig.PC-00625
5~/.gitconfig.include
6
7topgrade/topgrade.windows.toml
8~/AppData/Roaming/topgrade.toml
9
10nushell
11~/AppData/Roaming/nushell
13bottom
14~/AppData/Roaming/bottom
16stackoverflow/so
17~/AppData/Roaming/Sam Tay/so
19subversion/config.win32
20~/AppData/Roaming/Subversion/config
22subversion/diff.bat
23~/AppData/Roaming/Subversion/diff.bat
25subversion/diff3.bat
26~/AppData/Roaming/Subversion/diff3.bat
28subversion/merge.bat
29~/AppData/Roaming/Subversion/merge.bat
31cargo/config.toml
32~/scoop/persist/rustup/.cargo/config.toml
34indexa/config.windows.toml
35~/AppData/Roaming/indexa/config.toml
37wezterm
38~/.config/wezterm
40helix/config.toml
41~/AppData/Roaming/helix/config.toml
43helix/languages.toml
44~/AppData/Roaming/helix/languages.toml
46helix/themes
47~/AppData/Roaming/helix/themes
49neovim
50~/AppData/Local/nvim
52bat/config
53~/AppData/Roaming/bat/config

git/gitconfig

Modified

+5 / −4 text lines

6363 # try to automatically correct mispelled git commands
6464 autocorrect = 7
66# In order to have host-specific configuration, I include additional settings here.
67# On each host a different file might be symlinked into '.gitconfig.include'.
68[include]
69 path = .gitconfig.include
7066[credential "https://github.com"]
7167 helper =
7268 helper = !/usr/bin/gh auth git-credential
7369[credential "https://gist.github.com"]
7470 helper =
7571 helper = !/usr/bin/gh auth git-credential
73# In order to have host-specific configuration, I include additional settings here.
74# On each host a different file might be symlinked into '.gitconfig.include'.
75[include]
76 path = .gitconfig.include

git/gitconfig.PC-00625

Modified

+0 / −15 text lines

22 name = Oliver Krylow
33 email = o.krylow@isp-insoft.de
5[credential]
6 helper = manager-core
7
8[credential "helperselector"]
9 selected = manager-core
11[core]
12 editor = code --wait
13 fsmonitor=true
15[diff]
16 tool = code-difftool
18[difftool "code-difftool"]
19 cmd = code --wait --diff $LOCAL $REMOTENo final newline

neovim/README.md

Modified

+56 / −0 text lines

1<<<<<<< HEAD
2# bugabinga neovim config
3
4neovim configuration is scripting.
5scripting with lua + neovim api is programming.
6
7## project structure
8
9init.lua
10: main entry point
11\
12lua/std
13: standard lib. can only depend on itself and neovim apis.
14\
15lua/bugabinga
16: config modules. in aggregation, defines all of the config. can depend on itself, std and plugins.
17\
18lua/bugabinga/plugins
19: third party plugins and their config glue integrating it into the config.
20\
21colors/nugu
22: color theme
23\
24ftplugin
25: file type specific config
26
27----------
28
29# todo
30
31* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
32* think about mini.colors
33* setup spell checking for code (english + german)
34* use gen.ai to generate docs
35* learn marks and refac mark.lua
36* use ltex-ls for markdown, code comments and commit messages
37* setup DAP
38* add nu-check to nvim-lint
39* autocomplete in cmdline does not work no more
40* make telescope highlights more like NormalFloat
41* create facade over vim.api.nvim_create_user_command
42* fix autocomplete in cmdline
43* steal User Commands from: https://github.com/nanotee/nvim-lsp-basics/blob/main/doc/lsp-basics.txt
44* test https://github.com/aznhe21/actions-preview.nvim
45* test https://github.com/amrbashir/nvim-docs-view
46* test https://github.com/piersolenski/wtf.nvim
47* test https://github.com/jghauser/auto-pandoc.nvim
48* check out https://github.com/roobert/surround-ui.nvim
49* https://github.com/LhKipp/nvim-nu
50* test https://github.com/uga-rosa/ccc.nvim
51* test https://github.com/chrisgrieser/nvim-recorder
52* use https://github.com/chrisgrieser/nvim-origami
53* check out https://github.com/shellRaining/hlchunk.nvim
54
55=======
156# bugabinga neovim config
358neovim configuration is scripting.
4095* create facade over vim.api.nvim_create_user_command
4196* fix autocomplete in cmdline
4297* prompts from Mini*-Plugins tend to show up via notify. hard to read. how to change them all?
98>>>>>>> c8829e56f199ffbb1d10d332d9f25728f89ce8aa

neovim/lazy-lock.json

Modified

+38 / −35 text lines

11{
22 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
3 "LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
3 "LuaSnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" },
44 "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" },
55 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
66 "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
1010 "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
1111 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
1212 "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
13 "diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
14 "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
13 "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
14 "dressing.nvim": { "branch": "master", "commit": "8b7ae53d7f04f33be3439a441db8071c96092d19" },
1515 "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
16 "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
17 "gen.nvim": { "branch": "main", "commit": "de6952db44082b8931a237d6af7fa729a06f6b25" },
18 "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" },
16 "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" },
17 "gen.nvim": { "branch": "main", "commit": "aa951166745dd3cb5a7bf8297ce2bd20d3bb4e00" },
18 "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
1919 "glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
20 "heirline.nvim": { "branch": "master", "commit": "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" },
20 "heirline.nvim": { "branch": "master", "commit": "170e1b1fd7c11db00e46d802165fb277db601ae7" },
2121 "hlargs.nvim": { "branch": "main", "commit": "6218a401824c5733ac50b264991b62d064e85ab2" },
22 "indent-blankline.nvim": { "branch": "master", "commit": "64fdadb3ada61c4297452f7662789b01ee82ffcb" },
23 "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" },
22 "indent-blankline.nvim": { "branch": "master", "commit": "9a1fe189a5b6a63e89717424c4995e09feae36d7" },
23 "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
2424 "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
25 "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" },
26 "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
27 "mini.align": { "branch": "main", "commit": "e3a0c114d3fea0479f8e8ee3e273c7ca4ba6ea8d" },
28 "mini.bracketed": { "branch": "main", "commit": "d99f8f6c93e2a4cff1ebc27072d74ba400c8d241" },
29 "mini.colors": { "branch": "main", "commit": "a84b460fd5012a6af878d6beb96e912181f25c30" },
30 "mini.starter": { "branch": "main", "commit": "c74bdde61385360b02ca9fd7731ebce8903d78d7" },
25 "lush.nvim": { "branch": "main", "commit": "f76741886b356586f9dfe8e312fbd1ab0fd1084f" },
26 "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
27 "mini.align": { "branch": "main", "commit": "c5ab28809c630b65ffe069b564ce1d473bbcb332" },
28 "mini.bracketed": { "branch": "main", "commit": "944e81e192cf054bb879cb64231e9b1cfb3c8145" },
29 "mini.colors": { "branch": "main", "commit": "7d5caf65180a4fd2f0780ca5d925610c206e0e4a" },
30 "mini.starter": { "branch": "main", "commit": "0ee58ac8975a929e90c8b104987fabfd13015e25" },
3131 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
32 "neodev.nvim": { "branch": "main", "commit": "7b46fd0f81c9c9ef5d5898879e86ae271152c79f" },
32 "neodev.nvim": { "branch": "main", "commit": "7d4e7ecede7f43b5d62b2a8bb82ffec34f1265d4" },
3333 "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
3434 "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
3535 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
36 "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
36 "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
3737 "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
38 "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
38 "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
3939 "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
40 "nvim-genghis": { "branch": "main", "commit": "ba59d6fd8440c9b8928acd22b845d18fe9a8b848" },
40 "nvim-genghis": { "branch": "main", "commit": "884d98393d434e8e284bb7b32a9144b3dc6823e1" },
4141 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
42 "nvim-jdtls": { "branch": "master", "commit": "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8" },
4243 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
43 "nvim-neoclip.lua": { "branch": "main", "commit": "4e406ae0f759262518731538f2585abb9d269bac" },
44 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
4445 "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
45 "nvim-surround": { "branch": "main", "commit": "4f0e1f470595af067eca9b872778d83c7f52f134" },
46 "nvim-treesitter": { "branch": "master", "commit": "bf0a96568a54618138ac42c84758945cdafef86b" },
47 "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" },
46 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
47 "nvim-surround": { "branch": "main", "commit": "633a0ab03159569a66b65671b0ffb1a6aed6cf18" },
48 "nvim-treesitter": { "branch": "master", "commit": "c203884c80ef31b6a3993398734fbe008addcb27" },
49 "nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" },
50 "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" },
4851 "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
49 "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
50 "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" },
51 "oil.nvim": { "branch": "stevearc-trash", "commit": "9487fdfeb5b50ebcd46e644fbdc9d15ac9b9f55d" },
52 "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
53 "nvim-web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" },
54 "oil.nvim": { "branch": "master", "commit": "2c80182d75f92e1263e50c262f2799b1af5a6bb7" },
5255 "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" },
5356 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
54 "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
55 "schemastore.nvim": { "branch": "main", "commit": "976e7e3e9c400b99f1cb337b2ce804a9652571ec" },
57 "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
58 "schemastore.nvim": { "branch": "main", "commit": "46891f2f5b3b4380a1d021dd3940a08f5de582f8" },
5659 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
57 "substitute.nvim": { "branch": "main", "commit": "cf35db50188f3d7de624ae391c9bb9f2e9de5610" },
60 "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },
5861 "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
59 "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" },
60 "telescope-ui-select.nvim": { "branch": "master", "commit": "b0015e6e4b46a64192c64b68dec9a9ac5a4e5690" },
62 "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" },
63 "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
6164 "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" },
62 "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
65 "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
6366 "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
64 "toggleterm.nvim": { "branch": "main", "commit": "c80844fd52ba76f48fabf83e2b9f9b93273f418d" },
65 "treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" },
67 "toggleterm.nvim": { "branch": "main", "commit": "6b334b9d1266b0f58ab1b6965c1e5b7eb5c34523" },
68 "treesj": { "branch": "main", "commit": "1d6e89f4790aa04eaae38fa9460a3ee191961c96" },
6669 "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" },
67 "virt-column.nvim": { "branch": "master", "commit": "9c82009c53e5f9d43b6c0f5e8cb69c53663b786a" },
70 "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
6871 "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
6972 "zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
7073}No final newline

neovim/lua/bugabinga/lsp/clients/java.lua

Modified

+9 / −1 text lines

100100 local jdk21 = {
101101 name = 'JavaSE-21',
102102 }
103 local jdk21 = {
104 name = "JavaSE-21",
105 }
104107 if host == 'pop-os' then
105108 jdk11.path = '/usr/lib/jvm/java-11-openjdk-amd64'
106109 jdk17.path = '/usr/lib/jvm/java-17-openjdk-amd64'
107110 jdk19.path = '/usr/lib/jvm/java-19-openjdk-amd64'
108111 jdk21.path = '/home/oli/.jdks/openjdk-21'
112 elseif host == 'NB-00718' then
113 jdk11.path = '~/scoop/apps/openjdk11/current'
114 jdk17.path = '~/scoop/apps/openjdk17/current'
115 jdk19.path = '~/scoop/apps/openjdk19/current'
116 jdk21.path = '~/scoop/apps/openjdk21/current'
109117 else
110118 vim.notify 'missing jdk paths in java settings for lsp'
111119 end
155163local jdtls_lsp_start = function ( config, opts )
156164 -- vim.print('jdtls lsp start', config, opts)
157 require 'jdtls'.start_or_attach( config, opts )
165 require 'jdtls'.start_or_attach( config, {}, opts )
158166end
160168local get_extended_capabilites = function ()

neovim/lua/bugabinga/options/keymaps.lua

Modified

+10 / −8 text lines

101101 command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,
104local host = vim.uv.os_gethostname()
105local browser = host == 'PC-00625' and 'chrome' or 'firefox'
104106local function open_link_under_cursor()
105107 ---@diagnostic disable-next-line: missing-parameter
106108 local file_under_cursor = vim.fn.expand '<cfile>'
167169map.normal {
168 description = 'Goto matching bracket',
169 category = 'navigation',
170 keys = 'mm',
171 command = '%',
170 description = 'Goto matching bracket',
171 category = 'navigation',
172 keys = 'mm',
173 command = '%',
174176map.normal {
175 description = 'Redo undone operation',
176 category = 'history',
177 keys = 'U',
178 command = vim.cmd.redo,
177 description = 'Redo undone operation',
178 category = 'history',
179 keys = 'U',
180 command = vim.cmd.redo,
181183map.normal {

neovim/lua/bugabinga/options/ui.lua

Modified

+1 / −1 text lines

112112-- pop up menu height
113113vim.opt.pumheight = 10
115-- no transparent popups and floating windows
115-- transparent popups and floating windows
116116vim.opt.pumblend = 0
117117vim.opt.winblend = 0

neovim/lua/bugabinga/plugins/autopairs.lua

Modified

+1 / −0 text lines

1010 local autopairs = require 'nvim-autopairs'
1111 autopairs.setup {
1212 disable_filetype = ignored.filetypes,
13 check_ts = true,
1314 }
1415 local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
1516 local cmp = require 'cmp'

neovim/lua/bugabinga/plugins/cmp.lua

Modified

+1 / −1 text lines

1010 'hrsh7th/cmp-nvim-lsp-document-symbol',
1111 'hrsh7th/cmp-nvim-lsp-signature-help',
1212 'hrsh7th/cmp-emoji',
13 { 'L3MON4D3/LuaSnip', version = '2.*', build = 'make install_jsregexp' },
13 { 'L3MON4D3/LuaSnip', version = '2.*' },
1414 'saadparwaiz1/cmp_luasnip',
1515 'rafamadriz/friendly-snippets',
1616 'onsails/lspkind.nvim',

neovim/lua/bugabinga/plugins/heirline.lua

Modified

+573 / −672 text lines

1---@diagnostic disable: param-type-mismatch
21local icon = require 'std.icon'
32local auto = require 'std.auto'
4local ignored = require 'std.ignored'
5
6local NEW_FILE = '~new~'
84return {
9 {
10 'rebelot/heirline.nvim',
11 event = 'BufEnter',
12 dependencies = {
13 'nvim-tree/nvim-web-devicons',
14 'lewis6991/gitsigns.nvim',
15 },
16 config = function ()
17 local heirline = require 'heirline'
18 local conditions = require 'heirline.conditions'
19 local utils = require 'heirline.utils'
21 local nugu = require 'bugabinga.nugu.palette'
22 heirline.load_colors( nugu )
24 auto 'reload_heirline_colors' {
25 description = 'Reload dark/light nugu colors for Heirline',
26 events = 'ColorScheme',
27 command = function () utils.on_colorscheme( nugu ) end,
28 }
30 local vi_mode = {
31 init = function ( self )
32 self.mode = vim.fn.mode( 1 ) -- :h mode()
33 end,
35 static = {
36 mode_names = {
37 n = icon.normal,
38 no = icon.normal .. '?',
39 nov = icon.normal .. '?',
40 noV = icon.normal .. '?',
41 ['no\22'] = icon.normal .. '?',
42 niI = icon.normal .. 'i',
43 niR = icon.normal .. 'r',
44 niV = icon.normal .. 'v',
45 nt = icon.normal .. 't',
46 v = icon.visual,
47 vs = icon.visual .. 's',
48 V = icon.visual .. '_',
49 Vs = icon.visual .. 's',
50 ['\22'] = '^' .. icon.visual,
51 ['\22s'] = '^' .. icon.visual,
52 s = icon.select,
53 S = icon.select .. '_',
54 ['\19'] = '^' .. icon.select,
55 i = icon.insert,
56 ic = icon.insert .. 'c',
57 ix = icon.insert .. 'x',
58 R = icon.replace,
59 Rc = icon.replace .. 'c',
60 Rx = icon.replace .. 'x',
61 Rv = icon.replace .. 'v',
62 Rvc = icon.replace .. 'v',
63 Rvx = icon.replace .. 'v',
64 c = icon.command,
65 cv = icon.command .. 'x',
66 r = icon.pending,
67 rm = icon.pending .. 'm',
68 ['r?'] = icon.pending .. '?',
69 ['!'] = icon.exclaim,
70 t = icon.terminal,
71 },
72 mode_colors = {
73 n = 'ui_normal',
74 i = 'ui_accent',
75 v = 'ui_important_global',
76 V = 'ui_important_global',
77 ['\22'] = 'ui_important_global',
78 c = 'ui_important_global',
79 s = 'ui_important_global',
80 S = 'ui_important_global',
81 ['\19'] = 'ui_important_global',
82 R = 'ui_important_global',
83 r = 'ui_important_global',
84 ['!'] = 'ui_important_global',
85 t = 'ui_important_global',
86 }
87 },
89 provider = function ( self )
90 local mode_name = self.mode_names[self.mode]
91 return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) '
92 end,
94 hl = function ( self )
95 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
96 return { fg = self.mode_colors[mode], bold = true }
97 end,
99 update = {
100 'ModeChanged',
101 pattern = '*:*',
102 callback = vim.schedule_wrap( function () vim.cmd.redrawstatus() end ),
103 },
104 }
106 local file_icon = {
107 init = function ( self )
108 local filename = self.filename
109 local extension = vim.fn.fnamemodify( filename, ':e' )
110 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true } )
111 end,
112 provider = function ( self )
113 return self.icon and (self.icon .. ' ')
114 end,
115 hl = 'DefaultIcon',
116 }
118 local file_name = {
119 init = function ( self )
120 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
121 if self.lfilename == '' then self.lfilename = NEW_FILE end
122 end,
124 flexible = 2,
126 {
127 provider = function ( self )
128 return self.lfilename
129 end,
130 },
131 {
132 provider = function ( self )
133 return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
134 end,
135 },
136 }
138 local file_flags = {
139 {
140 condition = function ()
141 return vim.bo.modified
142 end,
143 provider = string.format( ' %s ', icon.modified ),
144 hl = 'Comment',
145 },
146 {
147 condition = function ()
148 return not vim.bo.modifiable or vim.bo.readonly
149 end,
150 provider = string.format( ' %s ', icon.lock ),
151 hl = 'ErrorMsg',
152 },
153 }
155 local file_name_block = {
156 init = function ( self )
157 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
158 end,
160 file_icon,
161 { provider = ' ' },
162 file_name,
163 file_flags,
164 { provider = '%<' } -- this means that the statusline is cut here when there's not enough space
165 }
167 local file_type = {
168 provider = function ()
169 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
170 end,
171 }
173 local file_encoding = {
174 provider = function ()
175 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
176 return enc ~= 'utf-8' and enc:upper()
177 end,
178 }
180 local file_format = {
181 static = {
182 dos = icon.newline .. icon.carriage_return,
183 unix = icon.newline,
184 mac = icon.carriage_return,
185 },
186 provider = function ( self )
187 local fileformat = vim.bo.fileformat
188 return self[fileformat]
189 end
190 }
192 local file_size = {
193 provider = function ()
194 -- stackoverflow, compute human readable file size
195 -- i want to see vim opening a 1EiB file 󰱯
196 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E' }
197 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
198 fsize = (fsize < 0 and 0) or fsize
199 if fsize < 1024 then
200 return fsize .. suffix[1]
201 end
202 local i = math.floor( (math.log( fsize ) / math.log( 1024 )) )
203 return string.format( '%.2g%s', fsize / math.pow( 1024, i ), suffix[i + 1] )
204 end,
205 }
207 local file_last_modified = {
208 provider = function ()
209 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
210 if ftime > 0 then
211 local timeago = require 'std.timeago'
212 return timeago.format( ftime )
213 end
214 end,
215 }
217 local lsp_active = {
218 condition = conditions.lsp_attached,
219 update = { 'LspAttach', 'LspDetach', 'BufEnter' },
221 provider = function ()
222 local names = {}
223 for _, client in pairs( vim.lsp.get_clients { bufnr = 0 } ) do
224 table.insert( names, client.name )
225 end
226 return icon.lsp .. ' ' .. table.concat( names, ' ' )
227 end,
228 }
230 local diagnostic_enabled = {
231 init = function ( self )
232 self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on
233 end,
234 provider = function ( self )
235 return icon.diagnostic .. ' ' .. self.icon
236 end,
237 }
239 local diagnostic = {
240 condition = conditions.has_diagnostics,
242 static = {
243 error_icon = icon.error,
244 warn_icon = icon.warn,
245 info_icon = icon.info,
246 hint_icon = icon.hint,
247 },
249 init = function ( self )
250 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR } )
251 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN } )
252 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT } )
253 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO } )
254 end,
256 update = { 'DiagnosticChanged', 'BufEnter' },
258 {
259 provider = function ( self )
260 -- 0 is just another output, we can decide to print it or not!
261 return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ')
262 end,
263 hl = 'DiagnosticError',
264 },
265 {
266 provider = function ( self )
267 return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ')
268 end,
269 hl = 'DiagnosticWarn',
270 },
271 {
272 provider = function ( self )
273 return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ')
274 end,
275 hl = 'DiagnosticInfo',
276 },
277 {
278 provider = function ( self )
279 return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints)
280 end,
281 hl = 'DiagnosticHint',
282 },
283 }
285 local is_svn_repo = function ()
286 local svn_dir = vim.fs.find( '.svn', {
287 upward = true,
288 stop = vim.uv.os_homedir(),
289 path = vim.fs.dirname( vim.api.nvim_buf_get_name( 0 ) ),
290 type = 'directory',
291 } )
293 return not vim.tbl_isempty( svn_dir )
294 end
296 local svn_get_relative_url = function ()
297 -- FIXME: replace with vim.system
298 local job = require 'plenary.job'
299 local relative_url = { '[ERR]' }
301 job:new {
302 command = 'svn',
303 args = { 'info', '--show-item', 'relative-url', '--no-newline' },
304 on_exit = function ( current_job, exit_code )
305 if exit_code == 0 then relative_url = current_job:result() end
306 end,
307 }:sync()
309 return relative_url[1]
310 end
312 local svn = {
313 condition = is_svn_repo,
315 update = 'BufEnter',
317 init = function ( self )
318 self.relative_url = svn_get_relative_url()
319 end,
321 {
322 provider = function ( self )
323 return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url
324 end,
325 },
327 }
329 local git = {
330 condition = conditions.is_git_repo,
332 init = function ( self )
333 self.status_dict = vim.b.gitsigns_status_dict
334 end,
336 {
337 provider = function ( self )
338 return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.head .. ' '
339 end,
340 },
341 {
342 provider = function ( self )
343 local count = self.status_dict.added or 0
344 return count > 0 and (icon.diff_add .. ' ' .. count .. ' ')
345 end,
346 hl = 'DiffAdd',
347 },
348 {
349 provider = function ( self )
350 local count = self.status_dict.removed or 0
351 return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ')
352 end,
353 hl = 'DiffDelete',
354 },
355 {
356 provider = function ( self )
357 local count = self.status_dict.changed or 0
358 return count > 0 and (icon.diff_change .. ' ' .. count .. ' ')
359 end,
360 hl = 'DiffChange',
361 },
362 }
364 local work_dir = {
365 init = function ( self )
366 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
367 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
368 end,
370 flexible = 1,
372 {
373 provider = function ( self )
374 return self.icon .. self.cwd
375 end,
376 },
377 {
378 provider = function ( self )
379 local cwd = vim.fn.pathshorten( self.cwd )
380 return self.icon .. cwd
381 end,
382 },
383 {
384 provider = '',
385 }
386 }
388 local help_file_name = {
389 condition = function ()
390 return vim.bo.filetype == 'help'
391 end,
392 provider = function ()
393 local filename = vim.api.nvim_buf_get_name( 0 )
394 return vim.fn.fnamemodify( filename, ':t' )
395 end,
396 hl = 'Question',
397 }
399 local terminal_name = {
400 provider = function ()
401 local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
402 local basename = vim.fs.basename( name )
403 return icon.terminal .. ' ' .. (basename or 'noname')
404 end,
405 hl = 'Bold',
406 }
408 local togglers = {
409 provider = function ()
410 local togglers = require 'bugabinga.options.togglers'
411 return tostring( togglers )
412 end,
413 }
415 local macro_recording = {
416 condition = function ()
417 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
418 end,
419 provider = icon.macro .. ' ',
420 hl = 'PreProc',
421 utils.surround( { '░▒▓ ', ' ▓▒░' }, nil, {
422 provider = function ()
423 return vim.fn.reg_recording()
424 end,
425 hl = 'Bold',
426 } ),
427 update = {
428 'RecordingEnter',
429 'RecordingLeave',
430 }
431 }
433 local lazy = {
434 condition = function ()
435 local ok, lazy_status = pcall( require, 'lazy.status' )
436 return ok and lazy_status.has_updates()
437 end,
438 update = { 'User', pattern = 'LazyUpdate' },
439 provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end,
440 on_click = {
441 callback = function () require 'lazy'.update() end,
442 name = 'update_plugins',
443 },
444 }
446 local align = { provider = '%=' }
447 local space = { provider = ' ' }
449 local default_statusline = {
450 vi_mode, macro_recording, align,
451 work_dir, space, git, svn, align,
452 diagnostic_enabled, space, diagnostic, space, lsp_active, align,
453 togglers, align,
454 lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
455 }
457 local special_statusline = {
458 condition = function ()
459 return conditions.buffer_matches {
460 buftype = ignored.buftypes,
461 filetype = ignored.filetypes,
462 }
463 end,
465 file_type,
466 space,
467 help_file_name,
468 align
469 }
471 local terminal_statusline = {
473 condition = function ()
474 return conditions.buffer_matches { buftype = { 'terminal' } }
475 end,
477 { condition = conditions.is_active, vi_mode, space },
478 file_type,
479 space,
480 terminal_name,
481 align,
482 }
484 local inactive_statusline = {
485 condition = conditions.is_not_active,
486 file_type,
487 space,
488 file_name,
489 align,
490 }
492 local statuslines = {
493 hl = function ()
494 if conditions.is_active() then
495 return 'StatusLine'
496 else
497 return 'StatusLineNC'
498 end
499 end,
501 fallthrough = false,
503 special_statusline,
504 terminal_statusline,
505 inactive_statusline,
506 default_statusline,
507 }
509 local winbars = {
510 hl = function ()
511 if conditions.is_active() then
512 return 'Winbar'
513 else
514 return 'WinbarNC'
515 end
516 end,
518 fallthrough = false,
520 {
521 condition = function ()
522 return conditions.buffer_matches { buftype = { 'terminal' } }
523 end,
525 file_type,
526 space,
527 terminal_name,
528 },
530 file_name_block,
531 }
533 local tabline_buffer_number = {
534 provider = function ( self )
535 return '(' .. tostring( self.bufnr ) .. ')'
536 end,
537 hl = function ( self )
538 if self.is_active then
539 return { fg = utils.get_highlight 'TabLineSel'.fg }
540 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
541 return { fg = 'ui_normal' }
542 else
543 return { fg = utils.get_highlight 'TabLine'.fg }
544 end
545 end,
546 }
548 local tabline_file_name = {
549 provider = function ( self )
550 local name = self.file_name
551 return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) )
552 end,
553 hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true } end,
554 }
556 local tabline_file_flags = {
557 {
558 condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr } ) end,
559 provider = icon.modified .. ' ',
560 },
561 {
562 condition = function ( self )
563 return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr } ) or
564 vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr } )
565 end,
566 provider = function ( self )
567 if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr } ) == 'terminal' then
568 return icon.terminal
569 else
570 return icon.lock
571 end
572 end,
573 },
574 hl = 'Bold',
575 }
577 local tabline_file_name_block = {
578 init = function ( self )
579 self.file_name = vim.api.nvim_buf_get_name( self.bufnr )
580 end,
582 hl = function ( self )
583 if self.is_active then
584 return 'TabLineSel'
585 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
586 return { fg = 'ui_normal' }
587 else
588 return 'TabLine'
589 end
590 end,
592 on_click = {
593 callback = function ( _, minwid, _, button )
594 if button == 'm' then --m = middle click
595 vim.schedule( function ()
596 vim.api.nvim_buf_delete( minwid, { force = false } )
597 vim.cmd.redrawtabline()
598 end )
599 else
600 vim.api.nvim_win_set_buf( 0, minwid )
601 end
602 end,
603 minwid = function ( self ) return self.bufnr end,
604 name = 'heirline_tabline_buffer_callback',
605 },
607 file_icon,
608 { provider = ' ' },
609 tabline_file_name,
610 tabline_buffer_number,
611 tabline_file_flags,
612 }
614 local tabline_buffer_block = utils.surround(
615 {
616 ' ' .. icon.slant_left,
617 icon.slant_right .. ' ',
618 },
619 function ( self )
620 if self.is_active then
621 return utils.get_highlight 'TabLineSel'.bg
622 else
623 return utils.get_highlight 'TabLine'.bg
624 end
625 end,
626 { tabline_file_name_block }
627 )
629 local buffer_line = utils.make_buflist(
630 tabline_buffer_block,
631 { provider = icon.arrow_left .. ' ', hl = 'TabLineFill' },
632 { provider = ' ' .. icon.arrow_right, hl = 'TabLineFill' }
633 )
635 local tabpage = {
636 provider = function ( self )
637 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
638 end,
639 hl = function ( self )
640 if not self.is_active then
641 return 'TabLine'
642 else
643 return 'TabLineSel'
644 end
645 end,
646 }
648 local tab_pages = {
649 { provider = '%=' },
650 utils.make_tablist( tabpage ),
651 }
653 local tabline = { buffer_line, tab_pages }
655 -- local statuscolumn = {}
657 heirline.setup {
658 statusline = statuslines,
659 winbar = winbars,
660 tabline = tabline,
661 -- statuscolumn = statuscolumn,
663 opts = {
664 colors = nugu,
665 disable_winbar_cb = function ( args )
666 return conditions.buffer_matches(
667 {
668 buftype = ignored.buftypes,
669 filetype = ignored.filetypes,
670 },
671 args.buf )
672 end,
673 },
674 }
675 end,
676 },
5 {
6 'rebelot/heirline.nvim',
7 event = 'BufEnter',
8 dependencies = {
9 'nvim-tree/nvim-web-devicons',
10 'lewis6991/gitsigns.nvim',
11 },
12 config = function ()
13 local heirline = require 'heirline'
14 local conditions = require 'heirline.conditions'
15 local utils = require 'heirline.utils'
17 local nugu = require 'bugabinga.nugu.palette'
18 heirline.load_colors( nugu )
20 auto 'ReloadHeirlineColors' {
21 description = 'Reload dark/light nugu colors for Heirline',
22 events = 'ColorScheme',
23 command = function () utils.on_colorscheme( nugu ) end,
24 }
26 local vi_mode = {
27 init = function ( self )
28 self.mode = vim.fn.mode( 1 ) -- :h mode()
29 end,
31 static = {
32 mode_names = {
33 n = icon.normal,
34 no = icon.normal .. '?',
35 nov = icon.normal .. '?',
36 noV = icon.normal .. '?',
37 ['no\22'] = icon.normal .. '?',
38 niI = icon.normal .. 'i',
39 niR = icon.normal .. 'r',
40 niV = icon.normal .. 'v',
41 nt = icon.normal .. 't',
42 v = icon.visual,
43 vs = icon.visual .. 's',
44 V = icon.visual .. '_',
45 Vs = icon.visual .. 's',
46 ['\22'] = '^' .. icon.visual,
47 ['\22s'] = '^' .. icon.visual,
48 s = icon.select,
49 S = icon.select .. '_',
50 ['\19'] = '^' .. icon.select,
51 i = icon.insert,
52 ic = icon.insert .. 'c',
53 ix = icon.insert .. 'x',
54 R = icon.replace,
55 Rc = icon.replace .. 'c',
56 Rx = icon.replace .. 'x',
57 Rv = icon.replace .. 'v',
58 Rvc = icon.replace .. 'v',
59 Rvx = icon.replace .. 'v',
60 c = icon.command,
61 cv = icon.command .. 'x',
62 r = icon.pending,
63 rm = icon.pending .. 'm',
64 ['r?'] = icon.pending .. '?',
65 ['!'] = icon.exclaim,
66 t = icon.terminal,
67 },
68 mode_colors = {
69 n = 'ui_normal',
70 i = 'ui_accent',
71 v = 'ui_important_global',
72 V = 'ui_important_global',
73 ['\22'] = 'ui_important_global',
74 c = 'ui_important_global',
75 s = 'ui_important_global',
76 S = 'ui_important_global',
77 ['\19'] = 'ui_important_global',
78 R = 'ui_important_global',
79 r = 'ui_important_global',
80 ['!'] = 'ui_important_global',
81 t = 'ui_important_global',
82 }
83 },
85 provider = function ( self )
86 local mode_name = self.mode_names[self.mode]
87 return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) '
88 end,
90 hl = function ( self )
91 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
92 return { fg = self.mode_colors[mode], bold = true }
93 end,
95 update = {
96 'ModeChanged',
97 pattern = '*:*',
98 callback = vim.schedule_wrap( function () vim.cmd.redrawstatus() end ),
99 },
100 }
102 local file_icon = {
103 init = function ( self )
104 local filename = self.filename
105 local extension = vim.fn.fnamemodify( filename, ':e' )
106 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true } )
107 end,
108 provider = function ( self )
109 return self.icon and (self.icon .. ' ')
110 end,
111 hl = 'DefaultIcon',
112 }
114 local file_name = {
115 init = function ( self )
116 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
117 if self.lfilename == '' then self.lfilename = '~new~' end
118 end,
120 flexible = 2,
122 {
123 provider = function ( self )
124 return self.lfilename
125 end,
126 },
127 {
128 provider = function ( self )
129 return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
130 end,
131 },
132 }
134 local file_flags = {
135 {
136 condition = function ()
137 return vim.bo.modified
138 end,
139 provider = string.format( ' %s ', icon.modified ),
140 hl = 'Comment',
141 },
142 {
143 condition = function ()
144 return not vim.bo.modifiable or vim.bo.readonly
145 end,
146 provider = string.format( ' %s ', icon.lock ),
147 hl = 'ErrorMsg',
148 },
149 }
151 local file_name_block = {
152 init = function ( self )
153 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
154 end,
156 file_name,
157 file_flags,
158 { provider = ' ' },
159 file_icon,
160 { provider = '%<' } -- this means that the statusline is cut here when there's not enough space
161 }
163 local file_type = {
164 provider = function ()
165 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
166 end,
167 }
169 local file_encoding = {
170 provider = function ()
171 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
172 return enc ~= 'utf-8' and enc:upper()
173 end,
174 }
176 local file_format = {
177 static = {
178 dos = icon.newline .. icon.carriage_return,
179 unix = icon.newline,
180 mac = icon.carriage_return,
181 },
182 provider = function ( self )
183 local fileformat = vim.bo.fileformat
184 return self[fileformat]
185 end
186 }
188 local file_size = {
189 provider = function ()
190 -- stackoverflow, compute human readable file size
191 -- i want to see vim opening a 1EiB file 󰱯
192 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E' }
193 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
194 fsize = (fsize < 0 and 0) or fsize
195 if fsize < 1024 then
196 return fsize .. suffix[1]
197 end
198 local i = math.floor( (math.log( fsize ) / math.log( 1024 )) )
199 return string.format( '%.2g%s', fsize / math.pow( 1024, i ), suffix[i + 1] )
200 end,
201 }
203 local file_last_modified = {
204 provider = function ()
205 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
206 if ftime > 0 then
207 local timeago = require 'std.timeago'
208 return timeago.format( ftime )
209 end
210 end,
211 }
213 local lsp_active = {
214 condition = conditions.lsp_attached,
215 update = { 'LspAttach', 'LspDetach', 'BufEnter' },
217 provider = function ()
218 local names = {}
219 for _, client in pairs( vim.lsp.get_clients { bufnr = 0 } ) do
220 table.insert( names, client.name )
221 end
222 return icon.lsp .. ' ' .. table.concat( names, ' ' )
223 end,
224 }
226 local diagnostic_enabled = {
227 init = function ( self )
228 self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on
229 end,
230 provider = function ( self )
231 return icon.diagnostic .. ' ' .. self.icon
232 end,
233 }
235 local diagnostic = {
236 condition = conditions.has_diagnostics,
238 static = {
239 error_icon = icon.error,
240 warn_icon = icon.warn,
241 info_icon = icon.info,
242 hint_icon = icon.hint,
243 },
245 init = function ( self )
246 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR } )
247 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN } )
248 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT } )
249 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO } )
250 end,
252 update = { 'DiagnosticChanged', 'BufEnter' },
254 {
255 provider = function ( self )
256 -- 0 is just another output, we can decide to print it or not!
257 return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ')
258 end,
259 hl = 'DiagnosticError',
260 },
261 {
262 provider = function ( self )
263 return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ')
264 end,
265 hl = 'DiagnosticWarn',
266 },
267 {
268 provider = function ( self )
269 return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ')
270 end,
271 hl = 'DiagnosticInfo',
272 },
273 {
274 provider = function ( self )
275 return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints)
276 end,
277 hl = 'DiagnosticHint',
278 },
279 }
281 local is_svn_repo = function ()
282 local svn_dir = vim.fs.find( '.svn', {
283 upward = true,
284 stop = vim.uv.os_homedir(),
285 path = vim.fs.dirname( vim.api.nvim_buf_get_name( 0 ) ),
286 type = 'directory',
287 } )
289 return not vim.tbl_isempty( svn_dir )
290 end
292 local svn_get_relative_url = function ()
293 local job = require 'plenary.job'
294 local relative_url = '[unversioned]'
296 job:new {
297 command = 'svn',
298 args = { 'info', '--show-item', 'relative-url', '--no-newline' },
299 on_exit = function ( current_job, exit_code )
300 if exit_code == 0 then relative_url = current_job:result() end
301 end,
302 }:sync()
304 return type(relative_url) == 'table' and relative_url[1] or relative_url
305 end
307 local svn = {
308 condition = is_svn_repo,
310 update = 'BufEnter',
312 init = function ( self )
313 self.relative_url = svn_get_relative_url()
314 end,
316 {
317 provider = function ( self )
318 return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url
319 end,
320 },
322 }
324 local git = {
325 condition = conditions.is_git_repo,
327 init = function ( self )
328 self.status_dict = vim.b.gitsigns_status_dict
329 end,
331 {
332 provider = function ( self )
333 return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.head .. ' '
334 end,
335 },
336 {
337 provider = function ( self )
338 local count = self.status_dict.added or 0
339 return count > 0 and (icon.diff_add .. ' ' .. count .. ' ')
340 end,
341 hl = 'DiffAdd',
342 },
343 {
344 provider = function ( self )
345 local count = self.status_dict.removed or 0
346 return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ')
347 end,
348 hl = 'DiffDelete',
349 },
350 {
351 provider = function ( self )
352 local count = self.status_dict.changed or 0
353 return count > 0 and (icon.diff_change .. ' ' .. count .. ' ')
354 end,
355 hl = 'DiffChange',
356 },
357 }
359 local work_dir = {
360 init = function ( self )
361 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
362 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
363 end,
365 flexible = 1,
367 {
368 -- evaluates to the full-length path
369 provider = function ( self )
370 return self.icon .. self.cwd
371 end,
372 },
373 {
374 -- evaluates to the shortened path
375 provider = function ( self )
376 local cwd = vim.fn.pathshorten( self.cwd )
377 return self.icon .. cwd
378 end,
379 },
380 {
381 -- evaluates to "", hiding the component
382 provider = '',
383 }
384 }
386 local help_file_name = {
387 condition = function ()
388 return vim.bo.filetype == 'help'
389 end,
390 provider = function ()
391 local filename = vim.api.nvim_buf_get_name( 0 )
392 return vim.fn.fnamemodify( filename, ':t' )
393 end,
394 hl = 'Question',
395 }
397 local terminal_name = {
398 -- we could add a condition to check that buftype == 'terminal'
399 -- or we could do that later (see #conditional-statuslines below)
400 provider = function ()
401 local tname, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
402 tname = vim.fs.basename( tname )
403 return icon.terminal .. ' ' .. tname
404 end,
405 hl = 'Bold',
406 }
408 local togglers = {
409 provider = function ()
410 local togglers = require 'bugabinga.options.togglers'
411 return tostring( togglers )
412 end,
413 }
415 local macro_recording = {
416 condition = function ()
417 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
418 end,
419 provider = icon.macro .. ' ',
420 hl = 'PreProc',
421 utils.surround( { '░▒▓ ', ' ▓▒░' }, nil, {
422 provider = function ()
423 return vim.fn.reg_recording()
424 end,
425 hl = 'Bold',
426 } ),
427 update = {
428 'RecordingEnter',
429 'RecordingLeave',
430 }
431 }
433 local lazy = {
434 condition = function ()
435 local ok, lazy_status = pcall( require, 'lazy.status' )
436 return ok and lazy_status.has_updates()
437 end,
438 update = { 'User', pattern = 'LazyUpdate' },
439 provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end,
440 on_click = {
441 callback = function () require 'lazy'.update() end,
442 name = 'update_plugins',
443 },
444 hl = 'LazyProgressTodo',
445 }
447 local align = { provider = '%=' }
448 local space = { provider = ' ' }
450 local default_statusline = {
451 vi_mode, macro_recording, align,
452 work_dir, space, git, svn, align,
453 diagnostic_enabled, space, diagnostic, space, lsp_active, align,
454 togglers, align,
455 lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
456 }
458 local special_statusline = {
459 condition = function ()
460 return conditions.buffer_matches {
461 buftype = { 'nofile', 'prompt', 'help', 'quickfix', 'noice', 'Trouble' },
462 filetype = { '^git.*', 'fugitive' },
463 }
464 end,
466 file_type,
467 space,
468 help_file_name,
469 align
470 }
472 local terminal_statusline = {
474 condition = function ()
475 return conditions.buffer_matches { buftype = { 'terminal' } }
476 end,
478 { condition = conditions.is_active, vi_mode, space },
479 file_type,
480 space,
481 terminal_name,
482 align,
483 }
485 local inactive_statusline = {
486 condition = conditions.is_not_active,
487 file_type,
488 space,
489 file_name,
490 align,
491 }
493 local statuslines = {
494 hl = function ()
495 if conditions.is_active() then
496 return 'StatusLine'
497 else
498 return 'StatusLineNC'
499 end
500 end,
502 fallthrough = false,
504 special_statusline,
505 terminal_statusline,
506 inactive_statusline,
507 default_statusline,
508 }
510 local winbars = {
511 hl = function ()
512 if conditions.is_active() then
513 return 'Winbar'
514 else
515 return 'WinbarNC'
516 end
517 end,
519 fallthrough = false,
521 {
522 condition = function ()
523 return conditions.buffer_matches { buftype = { 'terminal' } }
524 end,
526 file_type,
527 space,
528 terminal_name,
529 },
531 file_name_block,
532 }
534 local tabpage = {
535 provider = function ( self )
536 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
537 end,
538 hl = function ( self )
539 if not self.is_active then
540 return 'TabLine'
541 else
542 return 'TabLineSel'
543 end
544 end,
545 }
547 local tab_pages = {
548 -- only show this component if there's 2 or more tabpages
549 condition = function ()
550 return #vim.api.nvim_list_tabpages() >= 2
551 end,
552 { provider = '%=' },
553 utils.make_tablist( tabpage ),
554 }
556 local tabline = { tab_pages }
558 -- local statuscolumn = {}
560 heirline.setup {
561 statusline = statuslines,
562 winbar = winbars,
563 tabline = tabline,
564 -- statuscolumn = statuscolumn,
566 opts = {
567 colors = nugu,
568 disable_winbar_cb = function ( args )
569 return conditions.buffer_matches( {
570 buftype = { 'nofile', 'prompt', 'help', 'quickfix' },
571 filetype = { '^git.*', 'noice', 'Trouble' },
572 }, args.buf )
573 end,
574 },
575 }
576 end,
577 },

neovim/lua/bugabinga/plugins/mason.lua

Modified

+2 / −1 text lines

11return {
2 "williamboman/mason.nvim",
2 'williamboman/mason.nvim',
33 cmd = { 'Mason', 'MasonUpdate', 'MasonInstall', 'MasonUninstall', 'MasonUninstallAll', 'MasonLog' },
44 opts = {
5 ensure_installed = { 'jdtls', 'taplo', 'marksman', 'lua-language-server', 'lemminx' },
56 ui = {
67 border = vim.g.border_style,
78 width = 0.69,

neovim/lua/bugabinga/plugins/nvim-jdtls.lua

Modified

+1 / −1 text lines

11return {
2 'bugabinga/nvim-jdtls',
2 'mfussenegger/nvim-jdtls',
33}

neovim/lua/bugabinga/plugins/oil.lua

Modified

+0 / −1 text lines

33return {
44 'stevearc/oil.nvim',
5 branch = 'stevearc-trash',
65 keys = '-',
76 cmd = { 'Oil' },
87 dependencies = { 'nvim-tree/nvim-web-devicons' },

neovim/lua/bugabinga/plugins/treesitter.lua

Modified

+66 / −3 text lines

1818 {
1919 name_of_executable = 'tar'
2020 }
21 {
22 name_of_executable = 'curl'
23 }
2225return {
2326 'nvim-treesitter/nvim-treesitter',
3134 'windwp/nvim-ts-autotag',
3235 'nvim-treesitter/playground',
3336 'nvim-treesitter/nvim-treesitter-textobjects',
37 'RRethy/nvim-treesitter-endwise',
3438 },
3539 config = function ()
3640 local install = require 'nvim-treesitter.install'
3741 local configs = require 'nvim-treesitter.configs'
3842 local parsers = require 'nvim-treesitter.parsers'
43 -- nvim-treesitter assumes that windows users use either cmd or powershell.
44 -- my win32 + nushell combination does not work well.
45 -- override some internal functions of nvim-treesitter for nushell support.
46 local shell = require 'nvim-treesitter.shell_command_selectors'
47 shell.make_directory_change_for_command = function ( dir, command )
48 return string.format( 'cd %s; %s', dir, command )
49 end
50 shell.select_mv_cmd = function ( from, to, cwd )
51 return {
52 cmd = 'mv',
53 opts = {
54 args = { '--force', from, to },
55 cwd = cwd,
56 }
57 }
58 end
59 shell.select_install_rm_cmd = function ( cache_folder, project_name )
60 local project = vim.fs.joinpath( cache_folder, project_name )
61 return {
62 cmd = 'rm',
63 opts = {
64 args = {
65 '--recursive',
66 '--force',
67 '--permanent',
68 project,
69 }
70 },
71 err = 'Could not delete project ' .. project,
72 }
73 end
74 shell.select_rm_file_cmd = function ( file, info_msg )
75 return {
76 cmd = 'rm',
77 opts = {
78 args = { '--force', '--permanent', file }
79 },
80 info = info_msg,
81 err = 'Could not delete file ' .. file,
82 }
83 end
84 shell.select_mkdir_cmd = function ( directory, cwd, info_msg )
85 return {
86 cmd = 'mkdir',
87 opts = {
88 args = { directory },
89 cwd = cwd,
90 },
91 info = info_msg,
92 err = 'Could not create directory ' .. directory,
93 }
94 end
4096 install.prefer_git = false
41 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
97 install.compilers = { 'zig' }
4399 ---@diagnostic disable-next-line: missing-fields
44100 configs.setup {
66122 'vim',
67123 'vimdoc',
68124 'query',
125 'xml',
69126 'zig',
70127 },
74131 auto_install = true,
76 autotag = { enable = true },
133 autotag = {
134 enable = true,
135 filetypes = {
136 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', 'rescript', 'css', 'lua', 'xml', 'php', 'markdown'
137 },
138 },
140 endwise = { enable = true },
78142 context_commentstring = { enable = true, enable_autocmd = false },
218282 }
219283 end,

nushell/env.nu

Modified

+1 / −1 text lines

1515# theme for ls and other programs, that use LS_COLORS
16$env.LS_COLORS = (try { vivid generate ayu | into string } catch {""})
16$env.LS_COLORS = (try { vivid generate alabaster_dark | into string } catch {""})
1818# Specifies how environment variables are:
1919# - converted from a string to a value on Nushell startup (from_string)

nushell/modules/aliases.nu

Modified

+49 / −48 text lines

1# Semantic aliases
2export alias show = bat
3export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
4export alias web = firefox
5export alias edit = nvim
6# TODO ewrite bak command
7export alias backup = bak
8
9# https://gist.github.com/mullnerz/9fff80593d6b442d5c1b
10export alias archive = wget -mpck --html-extension --user-agent="" -e robots=off --wait 1 -P .
12def-env workspace [] {
13 fd --type directory --max-depth 1 . $env.WORKSPACE | sk --ansi --preview 'test -f {}README.md&& mdcat {}README.md' --preview-window 'right:66%' | cd $in
14}
15export alias w = workspace
17export def-env lk [] {
18 cd (walk --icons)
19}
21def open-editor-with-content-search [ initial_query:string = ''] {
22 sk --ansi --interactive --cmd-query $initial_query --delimiter ':' --nth 1 --cmd "rg --color=always --line-number {}" --preview 'bat --color=always {1}' --color light | parse '{file}:{number}:{line}' | each { nvim -c $in.number -c $"?\\V($in.line | str trim )" $in.file }
23}
24export alias nc = open-editor-with-content-search
26def open-editor-with-file-search [ initial_query:string = ''] {
27 sk --ansi --interactive --cmd-query $initial_query --delimiter ':' --nth 1 --cmd "fd --type file --color=always {}" --preview 'bat --color=always {1}' --color light | str trim | each { nvim $in }
28}
29export alias nf = open-editor-with-file-search
31def fuzzy-kill [ query:string ] {
32 let pid = (^ps -ef | sed 1d | fzf -m --query $query | awk '{print $2}')
33 if not ($pid | is-empty) {
34 kill ($pid | into int )
35 }
36}
37export alias fkill = fuzzy-kill
39# TODO: HOST SPECIFIC ALIASES
40# I do not see a way right now the have different aliases per host with nu.
42# CUSTOM LITTLE JAVA COMMANDS
43export alias aes = java ($env.DOTFILES + /tools/ + aes.java)
44export alias download = java ($env.DOTFILES + /tools/ + download.java)
45export alias download_jar = java ($env.DOTFILES + /tools/ + download_jar.java)
47# systemd
48export alias userctl = systemctl --user
1# Semantic aliases
2export alias show = bat
3export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
4export alias web = firefox
5export alias edit = nvim
6# TODO ewrite bak command
7export alias backup = bak
8
9# https://gist.github.com/mullnerz/9fff80593d6b442d5c1b
10export alias archive = wget -mpck --html-extension --user-agent="" -e robots=off --wait 1 -P .
11
12def-env workspace [] {
13 fd --type directory --max-depth 1 . $env.WORKSPACE | fzf --ansi --preview 'mdcat {}README.md' --preview-window 'up:69%,border-bottom' | cd $in
14}
15export alias w = workspace
16
17export def-env lk [] {
18 cd (walk --icons)
19}
20
21def open-editor-with-content-search [ initial_query:string = ''] {
22 rg --color=always --line-number --no-heading --smart-case $initial_query | fzf --ansi --delimiter : --preview 'bat --color=always {1} --highlight-line {2}' --color "hl:-1:underline,hl+:-1:underline:reverse" --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' | parse '{file}:{number}:{line}' | each { nvim -c $in.number -c $"?\\V($in.line | str trim )" $in.file }
23
24}
25export alias nc = open-editor-with-content-search
26
27def open-editor-with-file-search [ initial_query:string = ''] {
28 fd --type file --color=always ign | fzf --ansi --preview 'bat --color=always {1}' --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' | str trim | each { nvim $in }
29}
30export alias nf = open-editor-with-file-search
31
32def fuzzy-kill [ query:string ] {
33 let pid = (^ps -ef | sed 1d | fzf -m --query $query | awk '{print $2}')
34 if not ($pid | is-empty) {
35 kill ($pid | into int )
36 }
37}
38export alias fkill = fuzzy-kill
39
40# TODO: HOST SPECIFIC ALIASES
41# I do not see a way right now the have different aliases per host with nu.
42
43# CUSTOM LITTLE JAVA COMMANDS
44export alias aes = java ($env.DOTFILES + /tools/ + aes.java)
45export alias download = java ($env.DOTFILES + /tools/ + download.java)
46export alias download_jar = java ($env.DOTFILES + /tools/ + download_jar.java)
47
48# systemd
49export alias userctl = systemctl --user

tools/cargo-tools.nu

Modified

+1 / −1 text lines

4141 [ "gib" "gib" [] ]
4242 [ "silicon" "silicon" [] ]
4343 [ "bottom" "btm" [] ]
44 [ "sic" "sic" [] ]
44 # [ "sic" "sic" [] ] some issue with ssl on win32?
4545 [ "just" "just" [] ]
4646 [ "mdsh" "mdsh" [] ]
4747 [ "git-delta" "delta" [] ]

topgrade/topgrade.windows.toml

Modified

+48 / −47 text lines

1# Disable specific steps - same options as the command line flag
2disable = ["wsl", "vim"]
3
4assume_yes = true
5
6# Run specific steps - same options as the command line flag
7#only = ["system", "emacs"]
8
9# Do not ask to retry failed steps (default: false)
10no_retry = true
12# Do not set the terminal title
13set_title = true
15# Display the time in step titles
16display_time = true
18# Cleanup temporary or old files
19cleanup = true
21[composer]
22self_update = true
24[git]
25# Additional git repositories to pull
26repos = ["W:/*/"]
28max_concurrency = 12
30pull_predefined = false
32# Arguments to pass Git when pulling Repositories
33# arguments = "--ff --rebase"
35[windows]
36enable_winget = true
38# Commands to run before anything
39[pre_commands]
40"01 - Scoop Export" = "scoop export --config > 'X:/scoop_installed_apps.json' *> $null"
42[commands]
43"00 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
44"01 - Install Cargo Tools" = "nu --env-config ~/AppData/Roaming/nushell/env.nu W:/dotfiles/tools/cargo-tools.nu"
45"02 - Advantage-PM Client" = "nu X:/update_apm_client.nu"
46"03 - MeMate" = "nu X:/update_memate.nu"
47"04 - TLDR" = "tldr --update"
1[misc]
2# Disable specific steps - same options as the command line flag
3disable = ["wsl", "vim"]
4
5assume_yes = true
6
7# Run specific steps - same options as the command line flag
8#only = ["system", "emacs"]
9
10# Do not ask to retry failed steps (default: false)
11no_retry = true
12
13# Do not set the terminal title
14set_title = true
15
16# Display the time in step titles
17display_time = true
18
19# Cleanup temporary or old files
20cleanup = true
21
22[composer]
23self_update = true
24
25[git]
26# Additional git repositories to pull
27repos = ["W:/*/"]
28
29max_concurrency = 12
30
31pull_predefined = false
32
33# Arguments to pass Git when pulling Repositories
34# arguments = "--ff --rebase"
35
36[windows]
37enable_winget = true
38
39# Commands to run before anything
40[pre_commands]
41"01 - Scoop Export" = "scoop export --config > 'X:/scoop_installed_apps.json' *> $null"
42
43[commands]
44"00 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
45"01 - Install Cargo Tools" = "nu --env-config ~/AppData/Roaming/nushell/env.nu W:/dotfiles/tools/cargo-tools.nu"
46"02 - Advantage-PM Client" = "nu X:/update_apm_client.nu"
47"03 - MeMate" = "nu X:/update_memate.nu"
48"04 - TLDR" = "tldr --update"

wezterm/wezterm.lua

Modified

+91 / −90 text lines

1local wez = require 'wezterm'
2local nugu = require 'bugabinga.nugu'
3
4local key_binds = require 'bugabinga.key_binds'
5local dark_mode = require 'bugabinga.dark_mode'
6-- local workspaces = require 'bugabinga.workspaces'
7require 'bugabinga.status'
8require 'bugabinga.neovim_zen_mode'
9
10local hostname = wez.hostname()
11local enable_wayland = false
12local window_decorations = 'RESIZE'
13local font_size = 11.0
14local font = wez.font'BlexMono Nerd Font'
15local italic_font_family = 'VictorMono Nerd Font'
16if hostname == 'x230' then
17 font_size = 13
18 enable_wayland = true
19elseif hostname == 'pop-os' then
20 font_size = 15
21elseif hostname == 'PC-00625' then
22 font_size = 15
23end
25local font_rules = {
26 {
27 intensity = 'Half',
28 italic = true,
29 font = wez.font { family = italic_font_family, weight = 'DemiBold', style = 'Italic' },
30 },
31 {
32 intensity = 'Normal',
33 italic = true,
34 font = wez.font { family = italic_font_family, weight = 'Regular', style = 'Italic' },
35 },
36 {
37 intensity = 'Bold',
38 italic = true,
39 font = wez.font { family = italic_font_family, weight = 'Bold', style = 'Italic' },
40 },
41}
43return {
44 -- logs key presses
45 -- debug_key_events = true,
47 font = font,
48 font_rules = font_rules,
49 font_size = font_size,
50 freetype_load_target = 'Light',
51 freetype_render_target = 'HorizontalLcd',
52 underline_position = "-2pt",
53 warn_about_missing_glyphs = false,
54 color_scheme = dark_mode,
55 color_schemes = nugu,
56 default_cwd = wez.home_dir,
57 default_prog = { 'nu' },
58 default_cursor_style = 'SteadyBlock',
59 cursor_blink_rate = 0,
60 -- cursor_thickness = '1cell',
61 window_decorations = window_decorations,
62 enable_tab_bar = true,
63 -- if this is hidden, we cannot see the right status area
64 hide_tab_bar_if_only_one_tab = false,
65 use_fancy_tab_bar = false;
66 check_for_updates = false,
67 show_update_window = false,
68 audible_bell = 'Disabled',
69 visual_bell = {
70 fade_in_duration_ms = 69,
71 fade_out_duration_ms = 69,
72 target = 'CursorColor',
73 },
74 inactive_pane_hsb = {
75 saturation = 0.42,
76 brightness = 0.69,
77 },
78 tab_max_width = 42,
79 enable_wayland = enable_wayland,
80 window_padding = {
81 left = 2,
82 right = 2,
83 top = 2,
84 bottom = 0,
85 },
86 disable_default_key_bindings = true,
87 leader = key_binds.leader,
88 keys = key_binds.keys,
89 key_tables = key_binds.key_tables,
90}
1local wez = require 'wezterm'
2local nugu = require 'bugabinga.nugu'
3
4local key_binds = require 'bugabinga.key_binds'
5local dark_mode = require 'bugabinga.dark_mode'
6-- local workspaces = require 'bugabinga.workspaces'
7require 'bugabinga.status'
8require 'bugabinga.neovim_zen_mode'
9
10local hostname = wez.hostname()
11local enable_wayland = false
12local window_decorations = 'RESIZE'
13local font_size = 11.0
14local font = wez.font'BlexMono Nerd Font'
15local italic_font_family = 'VictorMono Nerd Font'
16if hostname == 'x230' then
17 font_size = 13
18 enable_wayland = true
19elseif hostname == 'pop-os' then
20 font_size = 15
21elseif hostname == 'PC-00625' then
22 font_size = 15
23end
24
25local font_rules = {
26 {
27 intensity = 'Half',
28 italic = true,
29 font = wez.font { family = italic_font_family, weight = 'DemiBold', style = 'Italic' },
30 },
31 {
32 intensity = 'Normal',
33 italic = true,
34 font = wez.font { family = italic_font_family, weight = 'Regular', style = 'Italic' },
35 },
36 {
37 intensity = 'Bold',
38 italic = true,
39 font = wez.font { family = italic_font_family, weight = 'Bold', style = 'Italic' },
40 },
41}
42
43return {
44 -- logs key presses
45 -- debug_key_events = true,
46
47 font = font,
48 font_rules = font_rules,
49 font_size = font_size,
50 freetype_load_target = 'Light',
51 freetype_render_target = 'HorizontalLcd',
52 underline_position = "-2pt",
53 warn_about_missing_glyphs = false,
54 color_scheme = dark_mode,
55 color_schemes = nugu,
56 default_cwd = wez.home_dir,
57 default_prog = { 'nu' },
58 default_cursor_style = 'SteadyBlock',
59 cursor_blink_rate = 0,
60 -- cursor_thickness = '1cell',
61 window_decorations = window_decorations,
62 win32_system_backdrop = "Mica",
63 enable_tab_bar = true,
64 -- if this is hidden, we cannot see the right status area
65 hide_tab_bar_if_only_one_tab = false,
66 use_fancy_tab_bar = false;
67 check_for_updates = false,
68 show_update_window = false,
69 audible_bell = 'Disabled',
70 visual_bell = {
71 fade_in_duration_ms = 69,
72 fade_out_duration_ms = 69,
73 target = 'CursorColor',
74 },
75 inactive_pane_hsb = {
76 saturation = 0.42,
77 brightness = 0.69,
78 },
79 tab_max_width = 42,
80 enable_wayland = enable_wayland,
81 window_padding = {
82 left = 2,
83 right = 2,
84 top = 2,
85 bottom = 0,
86 },
87 disable_default_key_bindings = true,
88 leader = key_binds.leader,
89 keys = key_binds.keys,
90 key_tables = key_binds.key_tables,
91}