dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim: shared ignored file and buftypes
5a6fecf74ed68dbbb72e6fa3c18689a9fb4446ff
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (13)
4 4 name
= Oliver Jan Krylow 5 5 email
= oliver@bugabinga.net 13 13 colorMoved
= default 34 34 [
mergetool "meld_merge"]
35 35 cmd
= "meld \"$LOCAL\" \"$MERGED\" \"$REMOTE\" " 37 +[
mergetool "nvim_merge"]
38 + cmd
= "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\" " neovim/lua/bugabinga/lsp/init.lua
Modified 9 9 local auto
= require'std.auto' 10 10 local ui
= require'bugabinga.ui' 11 11 local table = require'std.table' 12 +local ignored
= require'std.ignored' 13 14 local lsp_client_configs
= require'bugabinga.lsp.clients' 36 37 local match
= file_type_event.match
38 - local matches_to_ignore
= {
'noice',
'notify',
'help',
'TelescopePrompt',
'TelescopeResults',
'toggleterm',
'lazy',
'oil'}
39 + local matches_to_ignore
= ignored.filetypes
39 40 if vim.iter(matches_to_ignore):find(match)
then return end 49 49 local potential_client_configs
= vim.iter(lsp_client_configs)
50 50 :map(
function(config)
89 - vim.print(
'FOUND NO LSP CLIENT FOR', buffer_path)
109 109 on_error = function(code,
...) vim.print(
'LSP ERROR', code,
...)
end,
110 110 before_init
= config.before_init,
112 - on_exit = function(code, signal, client_id) vim.print(
"LSP CLIENT EXIT", code, signal, client_id)
end,
113 - on_attach = function(client, bufnr) vim.print(
"LSP CLIENT ATTACH", client.data.client_id, bufnr)
end,
115 115 flags
= {
allow_incremental_sync =
true,
debounce_text_changes =
50,
exit_timeout =
200},
116 116 root_dir
= config.root_dir(buffer_path),
127 - vim.print(
"ATTACHING LSP CLIENT", client_id)
130 -local lsp_attach = function(
...) vim.print(
"ATTACH LSP",
...)
end 131 -local lsp_detach = function(
...) vim.print(
"DETACH LSP",
...)
end 131 +local lsp_attach = function(
...)
134 +local lsp_detach = function(
...)
neovim/lua/bugabinga/plugins/last-place.lua
Modified 1 +local ignored
= require'std.ignored' 3 5 'ethanholz/nvim-lastplace',
6 - lastplace_ignore_buftype = {
'noice',
'neotree',
'quickfix',
'nofile',
'help' },
7 - lastplace_ignore_filetype = {
'gitcommit',
'gitrebase',
'svn',
'hgcommit' },
8 + lastplace_ignore_buftype = ignored.buftypes,
9 + lastplace_ignore_filetype = ignored.filetypes,
8 10 lastplace_open_folds =
true,
neovim/lua/bugabinga/plugins/noice.lua
Modified 48 48 relative
= "cursor",
49 49 position
= {
row =
1,
col =
0 },
50 50 size
= {
min_width =
42,
width =
"auto",
height =
'auto' },
51 - border
= {
style =vim.g.border_style,
padding = {
0,
1 } },
51 + border
= {
style = vim.g.border_style,
padding = {
0,
1 } },
52 52 win_options
= {
winhighlight = {
Normal =
"Normal",
FloatBorder =
"NoiceCmdlinePopupBorder" } },
153 153 stages = { shadow_fade,
unpack(fade,
2) },
154 154 render =
'compact',
157 157 top_down =
false,
neovim/lua/bugabinga/plugins/specs.lua
Modified 1 1 local map
= require'std.keymap' 2 +local ignored
= require'std.ignored' 4 5 'edluffy/specs.nvim',
5 - keys =
'<leader><leader>',
6 + keys = {
'<leader><leader>',
'<leader><leader><leader>' },
7 8 local specs
= require'specs' 18 19 fader
= specs.exp_fader,
19 20 resizer
= specs.shrink_resizer
22 - ignore_filetypes
= {},
22 + ignore_filetypes
= ignored.filetypes_kv,
23 + ignore_buftypes
= ignored.buftypes_kv,
31 29 keys
= '<leader><leader>',
32 30 command
= specs.show_specs,
34 + name =
'Find cursor, for real!',
36 + keys =
'<leader><leader><leader>',
37 + command =
function()
38 + specs.show_specs{
width =
69,
delay_ms =
69,
inc_ms =
42}
neovim/lua/bugabinga/plugins/treesitter.lua
Modified 92 92 autotag
= {
enable =
true },
97 97 context_commentstring
= {
enable =
true,
enable_autocmd =
false },
149 149 maintainers
= {
'@IndianBoy42' },
156 - auto
'disable_error_highlight_while_typing' {
158 - description =
'Disable the @error highlight while in Insert mode',
159 - events =
'InsertEnter',
161 - command =
function()
166 - description =
'Enable the @error highlight while in Normal mode',
167 - events =
'InsertLeave',
169 - command =
function()
neovim/lua/std/icon.lua
Modifiedneovim/lua/std/ignored.lua
Addednew file mode 100644 24 +local as_kv = function(list)
26 + for _, value
in ipairs(list)
do 27 + vim.validate {
value = { value,
'string'} }
33 +local filetypes_kv
= as_kv(filetypes)
34 +local buftypes_kv
= as_kv(buftypes)
37 + filetypes = filetypes,
38 + filetypes_kv = filetypes_kv,
39 + buftypes = buftypes,
40 + buftypes_kv = buftypes_kv,
neovim/lua/std/project.lua
Modified 3 3 local join
= require'std.table'.join
4 4 local dirname
= vim.fs.dirname
5 5 local normalize
= vim.fs.normalize
6 6 local exists
= vim.loop.fs_stat
7 7 local validate
= vim.validate
8 +local table = require'std.table' 11 +local hasher
= vim.fn.sha256
12 +local markers_to_string = function(markers)
13 + return table.deep_concat(markers, {
17 + key_value_delimiter =
'',
22 +local create_hash = function(path, markers)
23 + local path_hash
= hasher(path)
24 + local markers_hash
= hasher(markers_to_string(markers))
25 + local hash
= path_hash
.. '|' .. markers_hash
28 +local cache_get = function(path, markers)
29 + local hash
= create_hash(path, markers)
30 + local hit
= cache[hash]
34 +local cache_set = function(project_root, path, markers)
35 + local hash
= create_hash(path, markers)
37 + cache[hash]
= project_root
14 41 local MAX_TRAVERSAL_COUNT
= 100 57 84 if not exists(stop)
then error( (
'the stop directory %s does not exist!' ):format(stop) )
end 86 + local cache_hit
= cache_get(path, markers)
59 92 local directory_scores
= {}
60 93 local current_distance_to_buffer
= 0 61 94 local loop_count
= 0 68 - while path
~= stop
do 101 + local current_path
= path
102 + while current_path
~= stop
do 69 103 if loop_count
> MAX_TRAVERSAL_COUNT
then error(
'searching for markers reached the max traversal count!')
end 106 + path = current_path,
74 108 distance_to_buffer_file = current_distance_to_buffer,
78 112 for _, marker
in ipairs(markers)
do 79 - local marker_path
= path
.. '/' .. marker.name
113 + local marker_path
= current_path
.. '/' .. marker.name
80 114 if exists(marker_path)
then 81 115 score.marker_count
= score.marker_count
+ marker.weight
82 116 table.
insert(score.markers, marker_path)
87 121 table.
insert(directory_scores, score)
90 - path
= dirname(path)
124 + current_path
= dirname(current_path)
92 126 current_distance_to_buffer
= current_distance_to_buffer
+ 1 93 127 loop_count
= loop_count
+ 1 108 142 project_root
= score.path
145 + if project_root
then 146 + cache_set(project_root, path, markers)
111 148 return project_root
neovim/lua/std/table/deep_concat.lua
Modified13 13 [
'options.render_value' ]
= {options.render_value,
'function',
true},
16 - local prefix
= options.prefix
or '⦃' 17 - local suffix
= options.suffix
or '⦄' 16 + local prefix
= options.prefix
or '⎨' 17 + local suffix
= options.suffix
or '⎬' 18 18 local key_value_delimiter
= options.key_value_delimiter
or ' ≔ ' 19 19 local row_delimiter
= options.row_delimiter
or ',' 20 20 local fill
= options.fill
or ' ' 9 9 let-env TERM =
if (
$env | get -i TERM_PROGRAM) == WezTerm {
"wezterm" }
else {
"xterm-256color" }
11 +let-env PATH = (
$env.PATH | prepend (
if $env.WIN32 { [] }
else { [ $
"($env.WORKSPACE)/tools", $
"($env.HOME)/.cargo/bin" ] } ))
nushell/modules/prompt.nu
Modified 87 87 $command_status_segment 90 + (
if (sys).host.hostname ==
"x230" { (akku) }
else {
$time_segment })
tools/install_wezterm_terminfo.sh
Addednew file mode 100644 2 + && curl -o $tempfile https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 + && tic -x -o ~/.terminfo $tempfile \