first commit

This commit is contained in:
bacalhau 2025-07-02 15:42:50 +01:00
commit a89179ce06
10 changed files with 215 additions and 0 deletions

71
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,71 @@
return {
{
"mason-org/mason-lspconfig.nvim",
config = function()
ensure_installed = { "lua-language-server", "gopls", "jdtls" }
end
},
{
"mason-org/mason.nvim",
config = function()
require("mason").setup()
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, {})
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
local servers = { "lua_ls", "gopls", "jdtls" }
for _, server in ipairs(servers) do
lspconfig[server].setup({})
end
end
},
{ "mfussenegger/nvim-jdtls" },
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets",
}
},
{
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp', -- Autocompletar com LSP
'hrsh7th/cmp-buffer', -- Autocompletar com o buffer
'hrsh7th/cmp-path', -- Autocompletar com caminhos de arquivo
'saadparwaiz1/cmp_luasnip', -- Autocompletar com LuaSnip
'L3MON4D3/LuaSnip', -- O plugin de snippets
},
config = function()
local cmp = require('cmp')
local luasnip = require('luasnip')
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- Expande o snippet com LuaSnip
end,
},
mapping = {
['<Tab>'] = cmp.mapping.select_next_item(), -- Seleciona o próximo item
['<S-Tab>'] = cmp.mapping.select_prev_item(), -- Seleciona o item anterior
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Confirma a seleção
},
sources = {
{ name = 'nvim_lsp' }, -- LSP
{ name = 'buffer' }, -- Buffer
{ name = 'path' }, -- Caminhos
{ name = 'luasnip' }, -- LuaSnip
},
})
end
}
}

37
lua/plugins/theme.lua Normal file
View file

@ -0,0 +1,37 @@
return {
-- theming
{
"ellisonleao/gruvbox.nvim",
lazy = false,
priority = 1000,
config = function()
require("gruvbox").setup({
terminal_colors = true, -- add neovim terminal colors
undercurl = true,
underline = true,
bold = true,
italic = {
strings = false,
emphasis = false,
comments = false,
operators = false,
folds = false,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "hard", -- can be "hard", "soft" or empty string
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = false,
})
vim.cmd([[colorscheme gruvbox]])
end
},
}

View file

@ -0,0 +1,14 @@
return{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "html", "go", "java", "css" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
}