first commit
This commit is contained in:
commit
a89179ce06
10 changed files with 215 additions and 0 deletions
8
init.lua
Normal file
8
init.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
--lazy
|
||||
require("config.lazy")
|
||||
|
||||
-- main nvim configs
|
||||
require("behavior")
|
||||
|
||||
-- treesitter
|
||||
require("lazy").setup({{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}})
|
16
lazy-lock.json
Normal file
16
lazy-lock.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"cmp-path": { "branch": "main", "commit": "edbab83da34fffbaf993491e84d0223540f42f0b" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "58a2cda2e953a99e2f87c12b7fb4602da4e0709c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "1cb30b1bafe5a63a5c6ac20dc39f83487df38855" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }
|
||||
}
|
5
lua/.luarc.json
Normal file
5
lua/.luarc.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"diagnostics.disable": [
|
||||
"undefined-global"
|
||||
]
|
||||
}
|
28
lua/behavior.lua
Normal file
28
lua/behavior.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
-- base
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- line numbers
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- spell check
|
||||
vim.opt.spell = true
|
||||
vim.opt.spelllang = { 'pt', 'en' }
|
||||
|
||||
-- tab
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.smartindent = true
|
||||
|
||||
-- search
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
-- edit history
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.updatetime = 50
|
36
lua/config/lazy.lua
Normal file
36
lua/config/lazy.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "gruvbox" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
71
lua/plugins/lsp.lua
Normal file
71
lua/plugins/lsp.lua
Normal 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
37
lua/plugins/theme.lua
Normal 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
|
||||
},
|
||||
}
|
14
lua/plugins/treesitter.lua
Normal file
14
lua/plugins/treesitter.lua
Normal 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
|
||||
}
|
BIN
spell/en.utf-8.spl
Normal file
BIN
spell/en.utf-8.spl
Normal file
Binary file not shown.
BIN
spell/pt.utf-8.spl
Normal file
BIN
spell/pt.utf-8.spl
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue