From 28d1c6dd2dbb209f3ac044f5cd9bec996f0f11ad Mon Sep 17 00:00:00 2001 From: Giovanni d'Amelio Date: Mon, 6 Jan 2025 16:41:23 -0800 Subject: [PATCH] Formatting --- src/packages/_neovim_lua/keybinds.lua | 80 +++++++++++++-------------- src/packages/_neovim_lua/lsp.lua | 6 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/packages/_neovim_lua/keybinds.lua b/src/packages/_neovim_lua/keybinds.lua index d0e0008..23af191 100644 --- a/src/packages/_neovim_lua/keybinds.lua +++ b/src/packages/_neovim_lua/keybinds.lua @@ -10,58 +10,58 @@ wk.add({ -- Fuzzy Finding wk.add({ - { 'f', group = 'Find' }, - { 'f?', tb.help_tags, desc = 'Find help tags' }, - { 'fb', tb.buffers, desc = 'Find buffer' }, - { 'ff', tb.find_files, desc = 'Find file' }, - { 'fg', tb.live_grep, desc = 'Find line in file' }, + { 'f', group = 'Find' }, + { 'f?', tb.help_tags, desc = 'Find help tags' }, + { 'fb', tb.buffers, desc = 'Find buffer' }, + { 'ff', tb.find_files, desc = 'Find file' }, + { 'fg', tb.live_grep, desc = 'Find line in file' }, { 'fh', function() tb.find_files({ hidden = true }) end, desc = 'Find file (including hidden)' }, - { 'fm', tb.marks, desc = 'Find marks' }, - { 'fr', tb.oldfiles, desc = 'Find recent files' }, + { 'fm', tb.marks, desc = 'Find marks' }, + { 'fr', tb.oldfiles, desc = 'Find recent files' }, }) -- Diagnostics and Trouble.nvim wk.add({ - { 'd', group = 'Diagnostics/Trouble' }, + { 'd', group = 'Diagnostics/Trouble' }, { 'dd', 'TroubleToggle document_diagnostics', desc = 'Trouble document diagnostics' }, - { 'de', 'TroubleToggle lsp_definitions', desc = 'Trouble definitions' }, - { 'di', 'TroubleToggle lsp_implementations', desc = 'Trouble implementations' }, - { 'dn', function() vim.diagnostic.goto_next() end, desc = 'Go to next diagnostic' }, - { 'dp', function() vim.diagnostic.goto_prev() end, desc = 'Go to previous diagnostic' }, - { 'dr', 'TroubleToggle lsp_references', desc = 'Trouble references' }, - { 'dt', 'TroubleToggle', desc = 'Time for trouble' }, + { 'de', 'TroubleToggle lsp_definitions', desc = 'Trouble definitions' }, + { 'di', 'TroubleToggle lsp_implementations', desc = 'Trouble implementations' }, + { 'dn', function() vim.diagnostic.goto_next() end, desc = 'Go to next diagnostic' }, + { 'dp', function() vim.diagnostic.goto_prev() end, desc = 'Go to previous diagnostic' }, + { 'dr', 'TroubleToggle lsp_references', desc = 'Trouble references' }, + { 'dt', 'TroubleToggle', desc = 'Time for trouble' }, }) -- Testing wk.add({ - { 't', group = 'Testing' }, - { 'tf', function() neotest.run.run(vim.fn.expand('%')) end, desc = 'Run tests in file' }, - { 'tp', function() neotest.output_panel.toggle() end, desc = 'Toggle output panel' }, - { 'ts', function() neotest.summary.toggle() end, desc = 'Toggle summary' }, - { 'tt', function() neotest.run.run() end, desc = 'Run nearest test' }, + { 't', group = 'Testing' }, + { 'tf', function() neotest.run.run(vim.fn.expand('%')) end, desc = 'Run tests in file' }, + { 'tp', function() neotest.output_panel.toggle() end, desc = 'Toggle output panel' }, + { 'ts', function() neotest.summary.toggle() end, desc = 'Toggle summary' }, + { 'tt', function() neotest.run.run() end, desc = 'Run nearest test' }, { 'tw', function() neotest.watch.toggle(vim.fn.expand('%')) end, desc = 'Watch tests in file' }, - { 'ta', function() neotest.run.attach() end, desc = 'Attach to running test' }, - { 'tl', function() neotest.run.run_last() end, desc = 'Run last test' }, + { 'ta', function() neotest.run.attach() end, desc = 'Attach to running test' }, + { 'tl', function() neotest.run.run_last() end, desc = 'Run last test' }, }) -- Language Server wk.add({ - { 'K', vim.lsp.buf.hover, desc = 'Show hover docs' }, - { 'l', group = 'LSP' }, - { 'lD', vim.lsp.buf.definition, desc = 'Show definitions' }, - { 'ld', vim.lsp.buf.declaration, desc = 'Show declarations' }, - { 'li', vim.lsp.buf.implementation, desc = 'Show implementations' }, - { 'll', vim.lsp.buf.code_action, desc = 'Show code actions' }, - { 'lr', vim.lsp.buf.references, desc = 'Show references' }, + { 'K', vim.lsp.buf.hover, desc = 'Show hover docs' }, + { 'l', group = 'LSP' }, + { 'lD', vim.lsp.buf.definition, desc = 'Show definitions' }, + { 'ld', vim.lsp.buf.declaration, desc = 'Show declarations' }, + { 'li', vim.lsp.buf.implementation, desc = 'Show implementations' }, + { 'll', vim.lsp.buf.code_action, desc = 'Show code actions' }, + { 'lr', vim.lsp.buf.references, desc = 'Show references' }, { 'lt', vim.lsp.buf.type_definition, desc = 'Show type definition' }, }) -- Navigate to other files wk.add({ - { 'o', group = 'Other files' }, - { 'oc', 'OtherClear', desc = 'Clear the internal reference to other file' }, - { 'oo', 'Other', desc = 'Open the the other file' }, - { 'os', 'OtherSplit', desc = 'Open the the other file in a horizontal split' }, + { 'o', group = 'Other files' }, + { 'oc', 'OtherClear', desc = 'Clear the internal reference to other file' }, + { 'oo', 'Other', desc = 'Open the the other file' }, + { 'os', 'OtherSplit', desc = 'Open the the other file in a horizontal split' }, { 'ov', 'OtherVSplit', desc = 'Open the the other file in a vertical split' }, }) @@ -98,13 +98,13 @@ local gl = require('gitlinker') -- local gla = require('gitlinker.actions') wk.add({ - { 'g', group = 'Git' }, - { 'gg', 'Neogit', desc = 'Open Neogit UI' }, - { 'gb', function() gs.blame_line(true) end, desc = 'Blame Current Line' }, - { 'gn', function() gsa.next_hunk() end, desc = 'Go to next hunk' }, - { 'gp', function() gsa.prev_hunk() end, desc = 'Go to previous hunk' }, - { 'gr', function() gs.reset_hunk() end, desc = 'Reset hunk' }, - { 'gs', function() gs.stage_hunk() end, desc = 'Stage hunk' }, + { 'g', group = 'Git' }, + { 'gg', 'Neogit', desc = 'Open Neogit UI' }, + { 'gb', function() gs.blame_line(true) end, desc = 'Blame Current Line' }, + { 'gn', function() gsa.next_hunk() end, desc = 'Go to next hunk' }, + { 'gp', function() gsa.prev_hunk() end, desc = 'Go to previous hunk' }, + { 'gr', function() gs.reset_hunk() end, desc = 'Reset hunk' }, + { 'gs', function() gs.stage_hunk() end, desc = 'Stage hunk' }, { 'gu', function() gs.undo_stage_hunk() end, desc = 'Unstage hunk' }, { 'gy', @@ -123,7 +123,7 @@ wk.add({ wk.add({ mode = { 'v' }, - { 'g', group = 'Git' }, + { 'g', group = 'Git' }, { 'gr', function() gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, desc = 'Reset hunk' }, { 'gs', function() gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, desc = 'Stage hunk' }, { diff --git a/src/packages/_neovim_lua/lsp.lua b/src/packages/_neovim_lua/lsp.lua index e6fb017..b8c6f44 100644 --- a/src/packages/_neovim_lua/lsp.lua +++ b/src/packages/_neovim_lua/lsp.lua @@ -50,7 +50,7 @@ cmp.setup({ sources = cmp.config.sources({ { name = 'path' }, { name = 'nvim_lsp', keyword_length = 2 }, - { name = 'luasnip', keyword_length = 3 }, + { name = 'luasnip', keyword_length = 3 }, }, { { name = 'buffer', keyword_length = 4 }, }), @@ -79,7 +79,7 @@ cmp.setup.cmdline(':', { -- Set the default capabilities local lsp_defaults = lspconfig.util.default_config lsp_defaults.capabilities = - vim.tbl_deep_extend('force', lsp_defaults.capabilities, require('cmp_nvim_lsp').default_capabilities()) + vim.tbl_deep_extend('force', lsp_defaults.capabilities, require('cmp_nvim_lsp').default_capabilities()) -- Attach navic lsp_defaults.on_attach = function(client, bufnr) @@ -175,7 +175,7 @@ lspconfig.rust_analyzer.setup({ -- Setup html language server local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true -require 'lspconfig'.html.setup({ +require('lspconfig').html.setup({ capabilities = capabilities, filetypes = { 'html', 'heex', 'htmldjango', 'templ' }, })