瀏覽代碼

refactor autocommands

christianchiarulli 4 年之前
父節點
當前提交
9e7ad60747

+ 1 - 5
init.lua

@@ -4,7 +4,6 @@ require('settings')
 require('plugins')
 require('colorscheme')
 require('lv-utils')
-require('lv-autocommands')
 require('keymappings')
 require('lv-galaxyline')
 require('lv-telescope')
@@ -35,10 +34,7 @@ if O.lang.lua.active then require('lsp.lua-ls') end
 if O.lang.php.active then require('lsp.php-ls') end
 if O.lang.python.active then require('lsp.python-ls') end
 if O.lang.ruby.active then require('lsp.ruby-ls') end
-if O.lang.rust.active then
-    require('lsp.rust-ls')
-    require('lv-rust-tools')
-end
+if O.lang.rust.active then require('lsp.rust-ls') end
 if O.lang.svelte.active then require('lsp.svelte-ls') end
 if O.lang.terraform.active then require('lsp.terraform-ls') end
 if O.lang.tailwindcss.active then require('lsp.tailwindcss-ls') end

+ 54 - 18
lua/default-config.lua

@@ -200,27 +200,63 @@ O = {
     dashboard = {
 
         custom_header = {
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
-'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
+            '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
 
         },
         footer = {'chrisatmachine.com'}
     }
 }
 
+-- TODO find a new home for these autocommands
+require('lv-utils').define_augroups({
+    _general_settings = {
+        {
+            'TextYankPost', '*',
+            'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'
+        }, {
+            'BufWinEnter', '*',
+            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
+        },
+        {
+            'BufRead', '*',
+            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
+        }, {
+            'BufNewFile', '*',
+            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
+        }, {'VimLeavePre', '*', 'set title set titleold='},
+        {'FileType', 'qf', 'set nobuflisted'}
+    },
+    -- _solidity = {
+    --     {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
+    --     {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
+    -- },
+    -- _gemini = {
+    --     {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'},
+    --     {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'}
+    -- },
+    _markdown = {
+        {'FileType', 'markdown', 'setlocal wrap'},
+        {'FileType', 'markdown', 'setlocal spell'}
+    },
+    _buffer_bindings = {
+        {'FileType', 'floaterm', 'nnoremap <silent> <buffer> q :q<CR>'}
+    }
+})
+

+ 17 - 2
lua/lsp/go-ls.lua

@@ -1,7 +1,22 @@
-require'lspconfig'.gopls.setup{
+require'lspconfig'.gopls.setup {
     cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
     settings = {gopls = {analyses = {unusedparams = true}, staticcheck = true}},
-    root_dir = require'lspconfig'.util.root_pattern(".git","go.mod"),
+    root_dir = require'lspconfig'.util.root_pattern(".git", "go.mod"),
     init_options = {usePlaceholders = true, completeUnimported = true},
     on_attach = require'lsp'.common_on_attach
 }
+
+if O.lang.go.autoformat then
+    require('lv-utils').define_augroups({
+        _go_format = {
+            'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
+        },
+        _go = {
+            -- Go generally requires Tabs instead of spaces.
+            {'FileType', 'go', 'setlocal tabstop=4'},
+            {'FileType', 'go', 'setlocal shiftwidth=4'},
+            {'FileType', 'go', 'setlocal softtabstop=4'},
+            {'FileType', 'go', 'setlocal noexpandtab'}
+        }
+    })
+end

+ 7 - 0
lua/lsp/init.lua

@@ -111,6 +111,13 @@ function lsp_config.tsserver_on_attach(client, bufnr)
     client.resolved_capabilities.document_formatting = false
 end
 
+
+require('lv-utils').define_augroups({
+    _general_lsp = {
+        {'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'},
+    }
+})
+
 -- Use a loop to conveniently both setup defined servers
 -- and map buffer local keybindings when the language server attaches
 -- local servers = {"pyright", "tsserver"}

+ 9 - 0
lua/lsp/java-ls.lua

@@ -39,3 +39,12 @@ require'lspconfig'.jdtls.setup {
 --     root_dir = require('jdtls.setup').find_root({'build.gradle', 'pom.xml', '.git'}),
 --     init_options = {bundles = bundles}
 -- })
+
+-- TODO setup autoformat stuff later
+    -- _java = {
+    --     -- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
+    --     {
+    --         'FileType', 'java',
+    --         'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'
+    --     }
+    -- }

+ 32 - 5
lua/lsp/js-ts-ls.lua

@@ -7,17 +7,27 @@
 -- require'completion'.on_attach(client)
 -- require'illuminate'.on_attach(client)
 -- end
-
 require'lspconfig'.tsserver.setup {
-    cmd = {DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", "--stdio"},
-    filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
+    cmd = {
+        DATA_PATH ..
+            "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
+        "--stdio"
+    },
+    filetypes = {
+        "javascript", "javascriptreact", "javascript.jsx", "typescript",
+        "typescriptreact", "typescript.tsx"
+    },
     on_attach = require'lsp'.tsserver_on_attach,
     -- This makes sure tsserver is not used for formatting (I prefer prettier)
     -- on_attach = require'lsp'.common_on_attach,
-    root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
+    root_dir = require('lspconfig/util').root_pattern("package.json",
+                                                      "tsconfig.json",
+                                                      "jsconfig.json", ".git"),
     settings = {documentFormatting = false},
     handlers = {
-        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
+        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic
+                                                               .on_publish_diagnostics,
+                                                           {
             virtual_text = O.lang.tsserver.diagnostics.virtual_text,
             signs = O.lang.tsserver.diagnostics.signs,
             underline = O.lang.tsserver.diagnostics.underline,
@@ -26,3 +36,20 @@ require'lspconfig'.tsserver.setup {
         })
     }
 }
+
+if O.lang.tsserver.autoformat then
+    require('lv-utils').define_augroups({
+        _javascript_autoformat = {
+            'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+        },
+        _javascriptreact_autoformat = {
+            'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+        },
+        _typescript_autoformat = {
+            'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+        },
+        _typescriptreact_autoformat = {
+            'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+        }
+    })
+end

+ 11 - 1
lua/lsp/json-ls.lua

@@ -1,7 +1,8 @@
 -- npm install -g vscode-json-languageserver
 require'lspconfig'.jsonls.setup {
     cmd = {
-        "node", DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
+        "node", DATA_PATH ..
+            "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
         "--stdio"
     },
     on_attach = require'lsp'.common_on_attach,
@@ -14,3 +15,12 @@ require'lspconfig'.jsonls.setup {
         }
     }
 }
+
+if O.lang.json.autoformat then
+    require('lv-utils').define_augroups({
+        _json_format = {
+            'BufWritePre', '*.json',
+            'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+        }
+    })
+end

+ 15 - 1
lua/lsp/lua-ls.lua

@@ -19,9 +19,23 @@ require'lspconfig'.sumneko_lua.setup {
             },
             workspace = {
                 -- Make the server aware of Neovim runtime files
-                library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true},
+                library = {
+                    [vim.fn.expand('$VIMRUNTIME/lua')] = true,
+                    [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true
+                },
                 maxPreload = 10000
             }
         }
     }
 }
+if O.lang.lua.autoformat then
+    require('lv-utils').define_augroups({
+        _lua_autoformat = {
+            {
+                'BufWritePre', '*.lua',
+                'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+            }
+        }
+    })
+end
+

+ 25 - 9
lua/lsp/python-ls.lua

@@ -1,22 +1,38 @@
 -- npm i -g pyright
 require'lspconfig'.pyright.setup {
-    cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
+    cmd = {
+        DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
+        "--stdio"
+    },
     on_attach = require'lsp'.common_on_attach,
     handlers = {
-        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
+        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic
+                                                               .on_publish_diagnostics,
+                                                           {
             virtual_text = O.lang.python.diagnostics.virtual_text,
             signs = O.lang.python.diagnostics.signs,
             underline = O.lang.python.diagnostics.underline,
             update_in_insert = true
         })
     },
-	 settings = {
-      python = {
-        analysis = {
-		  typeCheckingMode = O.lang.python.analysis.type_checking,
-		  autoSearchPaths = O.lang.python.analysis.auto_search_paths,
-          useLibraryCodeForTypes = O.lang.python.analysis.use_library_code_types
+    settings = {
+        python = {
+            analysis = {
+                typeCheckingMode = O.lang.python.analysis.type_checking,
+                autoSearchPaths = O.lang.python.analysis.auto_search_paths,
+                useLibraryCodeForTypes = O.lang.python.analysis
+                    .use_library_code_types
+            }
         }
-      }
     }
 }
+if O.lang.python.autoformat then
+    require('lv-utils').define_augroups({
+        _python_autoformat = {
+            {
+                'BufWritePre', '*.py',
+                'lua vim.lsp.buf.formatting_sync(nil, 1000)'
+            }
+        }
+    })
+end

+ 13 - 3
lua/lsp/ruby-ls.lua

@@ -1,9 +1,11 @@
 -- If you are using rvm, make sure to change below configuration
 require'lspconfig'.solargraph.setup {
-    cmd = { DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio" },
+    cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio"},
     on_attach = require'lsp'.common_on_attach,
     handlers = {
-        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
+        ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic
+                                                               .on_publish_diagnostics,
+                                                           {
             virtual_text = O.lang.ruby.diagnostics.virtual_text,
             signs = O.lang.ruby.diagnostics.signs,
             underline = O.lang.ruby.diagnostics.underline,
@@ -11,5 +13,13 @@ require'lspconfig'.solargraph.setup {
 
         })
     },
-    filetypes = O.lang.ruby.filetypes,
+    filetypes = O.lang.ruby.filetypes
 }
+
+if O.lang.ruby.autoformat then
+    require('lv-utils').define_augroups({
+        _ruby_format = {
+            'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
+        }
+    })
+end

+ 86 - 5
lua/lsp/rust-ls.lua

@@ -1,6 +1,87 @@
--- the rust-tools plugin will configure this automatically
---require'lspconfig'.rust_analyzer.setup{
---    cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
---    on_attach = require'lsp'.common_on_attach
---}
+local opts = {
+    tools = { -- rust-tools options
+        -- automatically set inlay hints (type hints)
+        -- There is an issue due to which the hints are not applied on the first
+        -- opened file. For now, write to the file to trigger a reapplication of
+        -- the hints or just run :RustSetInlayHints.
+        -- default: true
+        autoSetHints = true,
+
+        -- whether to show hover actions inside the hover window
+        -- this overrides the default hover handler
+        -- default: true
+        hover_with_actions = true,
+
+        runnables = {
+            -- whether to use telescope for selection menu or not
+            -- default: true
+            use_telescope = true
+
+            -- rest of the opts are forwarded to telescope
+        },
+
+        inlay_hints = {
+            -- wheter to show parameter hints with the inlay hints or not
+            -- default: true
+            show_parameter_hints = true,
+
+            -- prefix for parameter hints
+            -- default: "<-"
+            parameter_hints_prefix = "<-",
+
+            -- prefix for all the other hints (type, chaining)
+            -- default: "=>"
+            other_hints_prefix = "=>",
+
+            -- whether to align to the lenght of the longest line in the file
+            max_len_align = false,
+
+            -- padding from the left if max_len_align is true
+            max_len_align_padding = 1,
+
+            -- whether to align to the extreme right or not
+            right_align = false,
+
+            -- padding from the right if right_align is true
+            right_align_padding = 7
+        },
+
+        hover_actions = {
+            -- the border that is used for the hover window
+            -- see vim.api.nvim_open_win()
+            border = {
+                {"╭", "FloatBorder"}, {"─", "FloatBorder"},
+                {"╮", "FloatBorder"}, {"│", "FloatBorder"},
+                {"╯", "FloatBorder"}, {"─", "FloatBorder"},
+                {"╰", "FloatBorder"}, {"│", "FloatBorder"}
+            }
+        }
+    },
+
+    -- all the opts to send to nvim-lspconfig
+    -- these override the defaults set by rust-tools.nvim
+    -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
+    server = {
+        cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
+        on_attach = require'lsp'.common_on_attach
+    } -- rust-analyser options
+}
+
+require('rust-tools').setup(opts)
+
+-- TODO add this later
+vim.api.nvim_exec([[
+    autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR>
+    autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR>
+    autocmd Filetype rust nnoremap <leader>le <Cmd>RustRunnables<CR>
+    autocmd Filetype rust nnoremap <leader>lh <Cmd>RustHoverActions<CR>
+    ]], true)
+
+if O.lang.rust.autoformat then
+    require('lv-utils').define_augroups({
+        _rust_format = {
+            'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
+        }
+    })
+end
 

+ 0 - 138
lua/lv-autocommands/init.lua

@@ -1,138 +0,0 @@
--- TODO when autocommands are better in lua, scope these to plugins and langs
-local utils = require('lv-utils')
-
-local auto_formatters = {}
-
-if O.lang.python.active then
-    local python_autoformat = {
-        'BufWritePre', '*.py', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    if O.lang.python.autoformat then
-        table.insert(auto_formatters, python_autoformat)
-    end
-end
-
-if O.lang.tsserver.active then
-    local javascript_autoformat = {
-        'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    local javascriptreact_autoformat = {
-        'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    local typescript_autoformat = {
-        'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    local typescriptreact_autoformat = {
-        'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    if O.lang.tsserver.autoformat then
-        table.insert(auto_formatters, javascript_autoformat)
-        table.insert(auto_formatters, javascriptreact_autoformat)
-        table.insert(auto_formatters, typescript_autoformat)
-        table.insert(auto_formatters, typescriptreact_autoformat)
-    end
-end
-
-if O.lang.lua.active then
-    local lua_format = {
-        'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    if O.lang.lua.autoformat then table.insert(auto_formatters, lua_format) end
-end
-
-if O.lang.json.active then
-    local json_format = {
-        'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
-    }
-    if O.lang.json.autoformat then table.insert(auto_formatters, json_format) end
-end
-
-if O.lang.ruby.active then
-    local ruby_format = {
-        'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
-    }
-    if O.lang.ruby.autoformat then table.insert(auto_formatters, ruby_format) end
-end
-
-if O.lang.go.active then
-    local go_format = {
-        'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
-    }
-    if O.lang.go.autoformat then table.insert(auto_formatters, go_format) end
-end
-
-if O.lang.rust.active then
-    local rust_format = {
-        'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
-    }
-    if O.lang.rust.autoformat then table.insert(auto_formatters, rust_format) end
-end
-
-utils.define_augroups({
-    _general_settings = {
-        {
-            'TextYankPost', '*',
-            'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'
-        }, {
-            'BufWinEnter', '*',
-            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
-        },
-        {
-            'BufRead', '*',
-            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
-        }, {
-            'BufNewFile', '*',
-            'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
-        }, {'VimLeavePre', '*', 'set title set titleold='},
-        {'FileType', 'qf', 'set nobuflisted'},
-        -- {'BufWinEnter', 'lv-config.lua', 'PackerCompile'},
-        -- {'BufWinLeave', 'lv-config.lua', 'PackerCompile'},
-        -- {'BufWritePost', 'lv-config.lua', 'PackerCompile'}
-
-        -- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
-        -- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
-    },
-    _java = {
-        -- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
-        {
-            'FileType', 'java',
-            'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'
-        }
-    },
-
-    _go = {
-        -- Go generally requires Tabs instead of spaces.
-        {'FileType', 'go', 'setlocal tabstop=4'},
-        {'FileType', 'go', 'setlocal shiftwidth=4'},
-        {'FileType', 'go', 'setlocal softtabstop=4'},
-        {'FileType', 'go', 'setlocal noexpandtab'}
-    },
-    _dashboard = {
-        -- seems to be nobuflisted that makes my stuff disapear will do more testing
-        {
-            'FileType', 'dashboard',
-            'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell  nolist  nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
-        }, {
-            'FileType', 'dashboard',
-            'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'
-        }
-    },
-    _markdown = {
-        {'FileType', 'markdown', 'setlocal wrap'},
-        {'FileType', 'markdown', 'setlocal spell'}
-    },
-    -- _solidity = {
-    --     {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
-    --     {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
-    -- },
-    -- _gemini = {
-    --     {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'},
-    --     {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'}
-    -- },
-    _buffer_bindings = {
-        {'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'},
-        {'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'},
-        {'FileType', 'floaterm', 'nnoremap <silent> <buffer> q :q<CR>'}
-    },
-    _auto_formatters = auto_formatters
-})

+ 13 - 26
lua/lv-dashboard/init.lua

@@ -1,24 +1,6 @@
 local M = {}
 
 M.config = function()
-    -- vim.g.dashboard_custom_header = {
-    --     '███╗   ██╗██╗   ██╗ ██████╗ ██████╗ ██████╗ ███████╗',
-    --     '████╗  ██║██║   ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝',
-    --     '██╔██╗ ██║██║   ██║██║     ██║   ██║██║  ██║█████╗',
-    --     '██║╚██╗██║╚██╗ ██╔╝██║     ██║   ██║██║  ██║██╔══╝',
-    --     '██║ ╚████║ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗',
-    --     '╚═╝  ╚═══╝  ╚═══╝   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝'
-    -- }
-    -- vim.g.dashboard_custom_header = {
-    --
-    -- '      _..._                                                                           ',
-    -- '    .\'     `.   ██      ██    ██ ███    ██  █████  ██████  ██    ██ ██ ███    ███ ',
-    -- '   :         :  ██      ██    ██ ████   ██ ██   ██ ██   ██ ██    ██ ██ ████  ████ ',
-    -- '   :         :  ██      ██    ██ ██ ██  ██ ███████ ██████  ██    ██ ██ ██ ████ ██ ',
-    -- '   `.       .\'  ██      ██    ██ ██  ██ ██ ██   ██ ██   ██  ██  ██  ██ ██  ██  ██ ',
-    -- '     `-...-\'    ███████  ██████  ██   ████ ██   ██ ██   ██   ████   ██ ██      ██ ',
-    --
-    -- }
     vim.g.dashboard_disable_at_vimenter = 0
 
     vim.g.dashboard_custom_header = O.dashboard.custom_header
@@ -55,17 +37,22 @@ M.config = function()
 
     -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
 
-    -- vim.g.dashboard_custom_shortcut = {
-    --     a = 'f',
-    --     find_word = 'SPC f a',
-    --     last_session = 'SPC s l',
-    --     new_file = 'SPC c n',
-    --     book_marks = 'SPC f b'
-    -- }
-    -- find_history = 'SPC f h',
 
     -- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
     vim.g.dashboard_custom_footer = O.dashboard.footer
 end
 
+require('lv-utils').define_augroups({
+    _dashboard = {
+        -- seems to be nobuflisted that makes my stuff disapear will do more testing
+        {
+            'FileType', 'dashboard',
+            'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell  nolist  nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
+        }, {
+            'FileType', 'dashboard',
+            'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'
+        }, {'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'}
+    }
+})
+
 return M

+ 0 - 85
lua/lv-rust-tools/init.lua

@@ -1,85 +0,0 @@
-local opts = {
-    tools = { -- rust-tools options
-        -- automatically set inlay hints (type hints)
-        -- There is an issue due to which the hints are not applied on the first
-        -- opened file. For now, write to the file to trigger a reapplication of
-        -- the hints or just run :RustSetInlayHints.
-        -- default: true
-        autoSetHints = true,
-
-        -- whether to show hover actions inside the hover window
-        -- this overrides the default hover handler
-        -- default: true
-        hover_with_actions = true,
-
-        runnables = {
-            -- whether to use telescope for selection menu or not
-            -- default: true
-            use_telescope = true
-
-            -- rest of the opts are forwarded to telescope
-        },
-
-        inlay_hints = {
-            -- wheter to show parameter hints with the inlay hints or not
-            -- default: true
-            show_parameter_hints = true,
-
-            -- prefix for parameter hints
-            -- default: "<-"
-            parameter_hints_prefix = "<-",
-
-            -- prefix for all the other hints (type, chaining)
-            -- default: "=>"
-            other_hints_prefix  = "=>",
-
-            -- whether to align to the lenght of the longest line in the file
-            max_len_align = false,
-
-            -- padding from the left if max_len_align is true
-            max_len_align_padding = 1,
-
-            -- whether to align to the extreme right or not
-            right_align = false,
-
-            -- padding from the right if right_align is true
-            right_align_padding = 7,
-        },
-
-        hover_actions = {
-            -- the border that is used for the hover window
-            -- see vim.api.nvim_open_win()
-            border = {
-                {"╭", "FloatBorder"},
-                {"─", "FloatBorder"},
-                {"╮", "FloatBorder"},
-                {"│", "FloatBorder"},
-                {"╯", "FloatBorder"},
-                {"─", "FloatBorder"},
-                {"╰", "FloatBorder"},
-                {"│", "FloatBorder"}
-            },
-        }
-    },
-
-    -- all the opts to send to nvim-lspconfig
-    -- these override the defaults set by rust-tools.nvim
-    -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
-    server = {
-        cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
-        on_attach = require'lsp'.common_on_attach
-    }, -- rust-analyser options
-}
-
-
-require('rust-tools').setup(opts)
-
-vim.api.nvim_exec(
-    [[
-    autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR>
-    autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR>
-    autocmd Filetype rust nnoremap <leader>le <Cmd>RustRunnables<CR>
-    autocmd Filetype rust nnoremap <leader>lh <Cmd>RustHoverActions<CR>
-    ]], true)
-
-