Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
giodamelio committed Jan 7, 2025
1 parent 8fb3565 commit 28d1c6d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
80 changes: 40 additions & 40 deletions src/packages/_neovim_lua/keybinds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,58 @@ wk.add({

-- Fuzzy Finding
wk.add({
{ '<leader>f', group = 'Find' },
{ '<leader>f?', tb.help_tags, desc = 'Find help tags' },
{ '<leader>fb', tb.buffers, desc = 'Find buffer' },
{ '<leader>ff', tb.find_files, desc = 'Find file' },
{ '<leader>fg', tb.live_grep, desc = 'Find line in file' },
{ '<leader>f', group = 'Find' },
{ '<leader>f?', tb.help_tags, desc = 'Find help tags' },
{ '<leader>fb', tb.buffers, desc = 'Find buffer' },
{ '<leader>ff', tb.find_files, desc = 'Find file' },
{ '<leader>fg', tb.live_grep, desc = 'Find line in file' },
{ '<leader>fh', function() tb.find_files({ hidden = true }) end, desc = 'Find file (including hidden)' },
{ '<leader>fm', tb.marks, desc = 'Find marks' },
{ '<leader>fr', tb.oldfiles, desc = 'Find recent files' },
{ '<leader>fm', tb.marks, desc = 'Find marks' },
{ '<leader>fr', tb.oldfiles, desc = 'Find recent files' },
})

-- Diagnostics and Trouble.nvim
wk.add({
{ '<leader>d', group = 'Diagnostics/Trouble' },
{ '<leader>d', group = 'Diagnostics/Trouble' },
{ '<leader>dd', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Trouble document diagnostics' },
{ '<leader>de', '<cmd>TroubleToggle lsp_definitions<cr>', desc = 'Trouble definitions' },
{ '<leader>di', '<cmd>TroubleToggle lsp_implementations<cr>', desc = 'Trouble implementations' },
{ '<leader>dn', function() vim.diagnostic.goto_next() end, desc = 'Go to next diagnostic' },
{ '<leader>dp', function() vim.diagnostic.goto_prev() end, desc = 'Go to previous diagnostic' },
{ '<leader>dr', '<cmd>TroubleToggle lsp_references<cr>', desc = 'Trouble references' },
{ '<leader>dt', '<cmd>TroubleToggle<cr>', desc = 'Time for trouble' },
{ '<leader>de', '<cmd>TroubleToggle lsp_definitions<cr>', desc = 'Trouble definitions' },
{ '<leader>di', '<cmd>TroubleToggle lsp_implementations<cr>', desc = 'Trouble implementations' },
{ '<leader>dn', function() vim.diagnostic.goto_next() end, desc = 'Go to next diagnostic' },
{ '<leader>dp', function() vim.diagnostic.goto_prev() end, desc = 'Go to previous diagnostic' },
{ '<leader>dr', '<cmd>TroubleToggle lsp_references<cr>', desc = 'Trouble references' },
{ '<leader>dt', '<cmd>TroubleToggle<cr>', desc = 'Time for trouble' },
})

-- Testing
wk.add({
{ '<leader>t', group = 'Testing' },
{ '<leader>tf', function() neotest.run.run(vim.fn.expand('%')) end, desc = 'Run tests in file' },
{ '<leader>tp', function() neotest.output_panel.toggle() end, desc = 'Toggle output panel' },
{ '<leader>ts', function() neotest.summary.toggle() end, desc = 'Toggle summary' },
{ '<leader>tt', function() neotest.run.run() end, desc = 'Run nearest test' },
{ '<leader>t', group = 'Testing' },
{ '<leader>tf', function() neotest.run.run(vim.fn.expand('%')) end, desc = 'Run tests in file' },
{ '<leader>tp', function() neotest.output_panel.toggle() end, desc = 'Toggle output panel' },
{ '<leader>ts', function() neotest.summary.toggle() end, desc = 'Toggle summary' },
{ '<leader>tt', function() neotest.run.run() end, desc = 'Run nearest test' },
{ '<leader>tw', function() neotest.watch.toggle(vim.fn.expand('%')) end, desc = 'Watch tests in file' },
{ '<leader>ta', function() neotest.run.attach() end, desc = 'Attach to running test' },
{ '<leader>tl', function() neotest.run.run_last() end, desc = 'Run last test' },
{ '<leader>ta', function() neotest.run.attach() end, desc = 'Attach to running test' },
{ '<leader>tl', function() neotest.run.run_last() end, desc = 'Run last test' },
})

-- Language Server
wk.add({
{ 'K', vim.lsp.buf.hover, desc = 'Show hover docs' },
{ '<leader>l', group = 'LSP' },
{ '<leader>lD', vim.lsp.buf.definition, desc = 'Show definitions' },
{ '<leader>ld', vim.lsp.buf.declaration, desc = 'Show declarations' },
{ '<leader>li', vim.lsp.buf.implementation, desc = 'Show implementations' },
{ '<leader>ll', vim.lsp.buf.code_action, desc = 'Show code actions' },
{ '<leader>lr', vim.lsp.buf.references, desc = 'Show references' },
{ 'K', vim.lsp.buf.hover, desc = 'Show hover docs' },
{ '<leader>l', group = 'LSP' },
{ '<leader>lD', vim.lsp.buf.definition, desc = 'Show definitions' },
{ '<leader>ld', vim.lsp.buf.declaration, desc = 'Show declarations' },
{ '<leader>li', vim.lsp.buf.implementation, desc = 'Show implementations' },
{ '<leader>ll', vim.lsp.buf.code_action, desc = 'Show code actions' },
{ '<leader>lr', vim.lsp.buf.references, desc = 'Show references' },
{ '<leader>lt', vim.lsp.buf.type_definition, desc = 'Show type definition' },
})

-- Navigate to other files
wk.add({
{ '<leader>o', group = 'Other files' },
{ '<leader>oc', '<cmd>OtherClear<cr>', desc = 'Clear the internal reference to other file' },
{ '<leader>oo', '<cmd>Other<cr>', desc = 'Open the the other file' },
{ '<leader>os', '<cmd>OtherSplit<cr>', desc = 'Open the the other file in a horizontal split' },
{ '<leader>o', group = 'Other files' },
{ '<leader>oc', '<cmd>OtherClear<cr>', desc = 'Clear the internal reference to other file' },
{ '<leader>oo', '<cmd>Other<cr>', desc = 'Open the the other file' },
{ '<leader>os', '<cmd>OtherSplit<cr>', desc = 'Open the the other file in a horizontal split' },
{ '<leader>ov', '<cmd>OtherVSplit<cr>', desc = 'Open the the other file in a vertical split' },
})

Expand Down Expand Up @@ -98,13 +98,13 @@ local gl = require('gitlinker')
-- local gla = require('gitlinker.actions')

wk.add({
{ '<leader>g', group = 'Git' },
{ '<leader>gg', '<cmd>Neogit<cr>', desc = 'Open Neogit UI' },
{ '<leader>gb', function() gs.blame_line(true) end, desc = 'Blame Current Line' },
{ '<leader>gn', function() gsa.next_hunk() end, desc = 'Go to next hunk' },
{ '<leader>gp', function() gsa.prev_hunk() end, desc = 'Go to previous hunk' },
{ '<leader>gr', function() gs.reset_hunk() end, desc = 'Reset hunk' },
{ '<leader>gs', function() gs.stage_hunk() end, desc = 'Stage hunk' },
{ '<leader>g', group = 'Git' },
{ '<leader>gg', '<cmd>Neogit<cr>', desc = 'Open Neogit UI' },
{ '<leader>gb', function() gs.blame_line(true) end, desc = 'Blame Current Line' },
{ '<leader>gn', function() gsa.next_hunk() end, desc = 'Go to next hunk' },
{ '<leader>gp', function() gsa.prev_hunk() end, desc = 'Go to previous hunk' },
{ '<leader>gr', function() gs.reset_hunk() end, desc = 'Reset hunk' },
{ '<leader>gs', function() gs.stage_hunk() end, desc = 'Stage hunk' },
{ '<leader>gu', function() gs.undo_stage_hunk() end, desc = 'Unstage hunk' },
{
'<leader>gy',
Expand All @@ -123,7 +123,7 @@ wk.add({

wk.add({
mode = { 'v' },
{ '<leader>g', group = 'Git' },
{ '<leader>g', group = 'Git' },
{ '<leader>gr', function() gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, desc = 'Reset hunk' },
{ '<leader>gs', function() gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, desc = 'Stage hunk' },
{
Expand Down
6 changes: 3 additions & 3 deletions src/packages/_neovim_lua/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
}),
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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' },
})

0 comments on commit 28d1c6d

Please sign in to comment.