Merge branch 'master' into arch-laptop

This commit is contained in:
Michael Chalupiak
2025-07-02 22:56:20 -04:00
8 changed files with 145 additions and 69 deletions

View File

@@ -150,61 +150,75 @@ hook global BufCreate .* %{
editorconfig-load
autoconfigtab
}
#
# define-command sleuth -docstring 'Heuristically set buffer options' %{
# try %{
# evaluate-commands -draft %{
# # Search the first indent level
# execute-keys 'gg' '/' '^\h+' '<ret>'
#
# # Tab vs. Space
# # https://youtu.be/V7PLxL8jIl8
# try %{
# execute-keys '<a-k>' '\t' '<ret>'
# #set-option buffer indentwidth 0
# noexpandtab
# } catch %{
# set-option buffer indentwidth %val{selection_length}
# expandtab
# }
# }
# }
# }
#
# define-command git-status -docstring 'Show git diff' %{
# hook -group git-status global BufOpenFile .* %{
# git show-diff
# }
#
# hook -group git-status global BufWritePost .* %{
# git show-diff
# }
# }
#
# define-command disable-git-status -docstring 'Disable git diff gutter' %{
# remove-hooks global git-status
# }
#
# define-command sleuth-enable -docstring 'Enable sleuth' %{
# # Run sleuth when opening and saving files.
# hook -group sleuth global BufOpenFile .* %{
# sleuth
# }
#
# hook -group sleuth global BufWritePost .* %{
# sleuth
# }
# }
#
# define-command sleuth-disable -docstring 'Disable sleuth' %{
# remove-hooks global sleuth
# }
#
# ## LSP ##
lsp-enable
lsp-auto-hover-enable
lsp-inlay-diagnostics-enable global
define-command sleuth -docstring 'Heuristically set buffer options' %{
try %{
evaluate-commands -draft %{
# Search the first indent level
execute-keys 'gg' '/' '^\h+' '<ret>'
# Tab vs. Space
# https://youtu.be/V7PLxL8jIl8
try %{
execute-keys '<a-k>' '\t' '<ret>'
#set-option buffer indentwidth 0
noexpandtab
} catch %{
set-option buffer indentwidth %val{selection_length}
expandtab
}
}
}
}
define-command git-status -docstring 'Show git diff' %{
hook -group git-status global BufOpenFile .* %{
git show-diff
}
hook -group git-status global BufWritePost .* %{
git show-diff
}
}
define-command disable-git-status -docstring 'Disable git diff gutter' %{
remove-hooks global git-status
}
define-command sleuth-enable -docstring 'Enable sleuth' %{
# Run sleuth when opening and saving files.
hook -group sleuth global BufOpenFile .* %{
sleuth
}
hook -group sleuth global BufWritePost .* %{
sleuth
}
}
define-command sleuth-disable -docstring 'Disable sleuth' %{
remove-hooks global sleuth
}
## LSP ##
# lsp-enable
# lsp-inlay-diagnostics-enable global
hook global WinSetOption filetype=(c|zig|python|ruby|lua|java|html|css|swift) %{
# set-option window lsp_auto_highlight_references true
set-option window lsp_hover_anchor true
lsp-auto-hover-enable
lsp-auto-hover-insert-mode-enable
lsp-enable-window
}
hook global WinSetOption filetype=(rust) %{
# set-option window lsp_auto_highlight_references true
set-option window lsp_hover_anchor true
lsp-auto-hover-enable
# lsp-auto-hover-insert-mode-enable
lsp-enable-window
}
hook global WinSetOption filetype=(c|zig|rust|python|ruby|lua|java|html|css) %{
hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens