aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua
diff options
context:
space:
mode:
authorGravatar Matheus Ribeiro <matheusribeiro@touchtec.com.br> 2026-02-25 15:15:28 +0000
committerGravatar Matheus Ribeiro <matheusribeiro@touchtec.com.br> 2026-02-25 15:15:58 +0000
commit61651e4db4c3d4b1da14f0734d917022ff77e991 (patch)
tree037936bf9e8d6d1096e15d74483a76589c9ddc15 /nvim/lua
parenta3879aaae0926a925e652c0719de879ce4211a64 (diff)
chega de nixvim, vamos no old-school
Diffstat (limited to 'nvim/lua')
-rw-r--r--nvim/lua/config/autocmd.lua6
-rw-r--r--nvim/lua/config/keymap.lua7
-rw-r--r--nvim/lua/config/lazy.lua31
-rw-r--r--nvim/lua/config/lsp.lua7
-rw-r--r--nvim/lua/config/options.lua20
-rw-r--r--nvim/lua/plugins/blink-cmp.lua46
-rw-r--r--nvim/lua/plugins/colorscheme.lua7
-rw-r--r--nvim/lua/plugins/lsp-format.lua16
-rw-r--r--nvim/lua/plugins/mini-pairs.lua1
-rw-r--r--nvim/lua/plugins/mini-statusline.lua1
-rw-r--r--nvim/lua/plugins/nix-develop.lua3
-rw-r--r--nvim/lua/plugins/nvim-lspconfig.lua3
-rw-r--r--nvim/lua/plugins/nvim-neoclip.lua8
-rw-r--r--nvim/lua/plugins/nvim-treesitter.lua20
-rw-r--r--nvim/lua/plugins/oil-nvim.lua13
-rw-r--r--nvim/lua/plugins/telescope.lua25
-rw-r--r--nvim/lua/plugins/web-devicons.lua3
-rw-r--r--nvim/lua/plugins/which-key.lua4
18 files changed, 221 insertions, 0 deletions
diff --git a/nvim/lua/config/autocmd.lua b/nvim/lua/config/autocmd.lua
new file mode 100644
index 0000000..762e93a
--- /dev/null
+++ b/nvim/lua/config/autocmd.lua
@@ -0,0 +1,6 @@
+vim.api.nvim_create_autocmd('LspAttach', {
+ callback = function(args)
+ local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
+ require("lsp-format").on_attach(client, args.buf)
+ end,
+})
diff --git a/nvim/lua/config/keymap.lua b/nvim/lua/config/keymap.lua
new file mode 100644
index 0000000..c6f4762
--- /dev/null
+++ b/nvim/lua/config/keymap.lua
@@ -0,0 +1,7 @@
+-- global keymaps
+vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
+vim.keymap.set("n", "<Esc>", "<Cmd>noh<CR>", { silent = true, remap = true })
+vim.keymap.set("n", "<Leader>x", "<Cmd>x<CR>", { silent = true, remap = true })
+vim.keymap.set("n", "<Leader>q", "<Cmd>q<CR>", { silent = true, remap = true })
+vim.keymap.set("n", "<Leader>w", "<Cmd>update<CR>", { silent = true, remap = true })
+vim.keymap.set("n", "<Leader>L", "<Cmd>Lazy<CR>", { silent = true, remap = true })
diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua
new file mode 100644
index 0000000..d640deb
--- /dev/null
+++ b/nvim/lua/config/lazy.lua
@@ -0,0 +1,31 @@
+-- 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)
+
+require("config.options")
+
+-- 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 = { "modus_vivendi" } },
+ -- automatically check for plugin updates
+ checker = { enabled = true },
+})
diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua
new file mode 100644
index 0000000..36ebfa9
--- /dev/null
+++ b/nvim/lua/config/lsp.lua
@@ -0,0 +1,7 @@
+vim.lsp.enable({"rust_analyzer", "nil_ls", "denols"})
+
+vim.lsp.config("*", {
+ onAttach = function(client, _)
+ client.server_capabilities.semanticTokensProvider = nil
+ end,
+})
diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua
new file mode 100644
index 0000000..39e1a48
--- /dev/null
+++ b/nvim/lua/config/options.lua
@@ -0,0 +1,20 @@
+-- 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 = " "
+
+vim.opt.number = true
+vim.opt.relativenumber = true
+vim.opt.clipboard = "unnamedplus"
+vim.opt.syntax = "on"
+vim.opt.autoindent = true
+vim.opt.cursorline = true
+vim.opt.expandtab = true
+vim.opt.tabstop = 4
+vim.opt.shiftwidth = 4
+vim.opt.mouse = "a"
+vim.opt.signcolumn = "yes";
+vim.opt.ignorecase = true;
+vim.opt.smartcase = true;
+vim.opt.autochdir = true;
diff --git a/nvim/lua/plugins/blink-cmp.lua b/nvim/lua/plugins/blink-cmp.lua
new file mode 100644
index 0000000..c4caf79
--- /dev/null
+++ b/nvim/lua/plugins/blink-cmp.lua
@@ -0,0 +1,46 @@
+return {
+ 'saghen/blink.cmp',
+ -- use a release tag to download pre-built binaries
+ version = '1.*',
+
+ ---@module 'blink.cmp'
+ ---@type blink.cmp.Config
+ opts = {
+ -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
+ -- 'super-tab' for mappings similar to vscode (tab to accept)
+ -- 'enter' for enter to accept
+ -- 'none' for no mappings
+ --
+ -- All presets have the following mappings:
+ -- C-space: Open menu or open docs if already open
+ -- C-n/C-p or Up/Down: Select next/previous item
+ -- C-e: Hide menu
+ -- C-k: Toggle signature help (if signature.enabled = true)
+ --
+ -- See :h blink-cmp-config-keymap for defining your own keymap
+ keymap = { preset = 'default' },
+
+ appearance = {
+ -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
+ -- Adjusts spacing to ensure icons are aligned
+ nerd_font_variant = 'mono'
+ },
+
+ -- (Default) Only show the documentation popup when manually triggered
+ completion = { documentation = { auto_show = false } },
+
+ -- Default list of enabled providers defined so that you can extend it
+ -- elsewhere in your config, without redefining it, due to `opts_extend`
+ sources = {
+ default = { 'lsp', 'path', 'snippets', 'buffer' },
+ },
+
+ -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
+ -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
+ -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
+ --
+ -- See the fuzzy documentation for more information
+ fuzzy = { implementation = "prefer_rust_with_warning" }
+ },
+ opts_extend = { "sources.default" }
+}
diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua
new file mode 100644
index 0000000..18105b8
--- /dev/null
+++ b/nvim/lua/plugins/colorscheme.lua
@@ -0,0 +1,7 @@
+return {
+ "miikanissi/modus-themes.nvim",
+ priority = 1000,
+ opts = {
+ style = "modus_vivendi", -- só quero o tema escuro
+ },
+}
diff --git a/nvim/lua/plugins/lsp-format.lua b/nvim/lua/plugins/lsp-format.lua
new file mode 100644
index 0000000..22565dc
--- /dev/null
+++ b/nvim/lua/plugins/lsp-format.lua
@@ -0,0 +1,16 @@
+return {
+ "lukas-reineke/lsp-format.nvim",
+ opts = {
+ yaml = {
+ exclude = { "none-ls" },
+ },
+ },
+}
+-- lsp-format = {
+-- enable = true;
+-- settings = {
+-- yaml = {
+-- exclude = [ "none-ls" ];
+-- };
+-- };
+-- };
diff --git a/nvim/lua/plugins/mini-pairs.lua b/nvim/lua/plugins/mini-pairs.lua
new file mode 100644
index 0000000..f20cec9
--- /dev/null
+++ b/nvim/lua/plugins/mini-pairs.lua
@@ -0,0 +1 @@
+return { 'nvim-mini/mini.pairs', version = '*', lazy = false}
diff --git a/nvim/lua/plugins/mini-statusline.lua b/nvim/lua/plugins/mini-statusline.lua
new file mode 100644
index 0000000..4f16584
--- /dev/null
+++ b/nvim/lua/plugins/mini-statusline.lua
@@ -0,0 +1 @@
+return { 'nvim-mini/mini.statusline', version = '*' }
diff --git a/nvim/lua/plugins/nix-develop.lua b/nvim/lua/plugins/nix-develop.lua
new file mode 100644
index 0000000..3a1c657
--- /dev/null
+++ b/nvim/lua/plugins/nix-develop.lua
@@ -0,0 +1,3 @@
+return {
+ "figsoda/nix-develop.nvim"
+}
diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua
new file mode 100644
index 0000000..7687988
--- /dev/null
+++ b/nvim/lua/plugins/nvim-lspconfig.lua
@@ -0,0 +1,3 @@
+return {
+ "neovim/nvim-lspconfig",
+}
diff --git a/nvim/lua/plugins/nvim-neoclip.lua b/nvim/lua/plugins/nvim-neoclip.lua
new file mode 100644
index 0000000..a260c0c
--- /dev/null
+++ b/nvim/lua/plugins/nvim-neoclip.lua
@@ -0,0 +1,8 @@
+return {
+ "AckslD/nvim-neoclip.lua",
+ dependencies = {
+ -- you'll need at least one of these
+ -- {'nvim-telescope/telescope.nvim'},
+ -- {'ibhagwan/fzf-lua'},
+ },
+}
diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua
new file mode 100644
index 0000000..eb0d2fe
--- /dev/null
+++ b/nvim/lua/plugins/nvim-treesitter.lua
@@ -0,0 +1,20 @@
+return {
+ 'nvim-treesitter/nvim-treesitter',
+ lazy = false,
+ build = ':TSUpdate',
+ opts = {
+ ensure_installed = {
+ "zig",
+ "rust",
+ "java",
+ "nix",
+ "yaml",
+ "typescript",
+ "javascript",
+ "lua",
+ },
+ incremental_selection = {
+ enable = true,
+ },
+ },
+}
diff --git a/nvim/lua/plugins/oil-nvim.lua b/nvim/lua/plugins/oil-nvim.lua
new file mode 100644
index 0000000..af948a3
--- /dev/null
+++ b/nvim/lua/plugins/oil-nvim.lua
@@ -0,0 +1,13 @@
+return {
+ 'stevearc/oil.nvim',
+ ---@module 'oil'
+ ---@type oil.SetupOpts
+ opts = {
+ vim.keymap.set("n", "<F2>", "<Cmd>Oil<CR>", { desc = "Open parent directory" }),
+ },
+ -- Optional dependencies
+ dependencies = { { "nvim-mini/mini.icons", opts = {} } },
+ -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
+ -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
+ lazy = false,
+}
diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua
new file mode 100644
index 0000000..7741010
--- /dev/null
+++ b/nvim/lua/plugins/telescope.lua
@@ -0,0 +1,25 @@
+return {
+ 'nvim-telescope/telescope.nvim', version = '*',
+ dependencies = {
+ 'nvim-lua/plenary.nvim',
+ -- optional but recommended
+ { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
+ },
+ keys = {
+ {
+ "<leader>tb", "<Cmd>Telescope buffers<CR>", desc = "Manage buffers"
+ },
+ {
+ "<leader>tf", "<Cmd>Telescope find_files<CR>", desc = "Find files"
+ },
+ {
+ "<leader>ts", "<Cmd>Telescope lsp_document_symbols<CR>", desc = "Find LSP symbols in document"
+ },
+ {
+ "<leader>tg", "<Cmd>Telescope live_grep<CR>", desc = "Find arbitrary strings in files"
+ },
+ {
+ "<leader>td", "<Cmd>Telescope diagnostics<CR>", desc = "Find diagnostics"
+ },
+ }
+}
diff --git a/nvim/lua/plugins/web-devicons.lua b/nvim/lua/plugins/web-devicons.lua
new file mode 100644
index 0000000..39a5fd6
--- /dev/null
+++ b/nvim/lua/plugins/web-devicons.lua
@@ -0,0 +1,3 @@
+return {
+ "nvim-tree/nvim-web-devicons"
+}
diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua
new file mode 100644
index 0000000..db77db1
--- /dev/null
+++ b/nvim/lua/plugins/which-key.lua
@@ -0,0 +1,4 @@
+return {
+ "folke/which-key.nvim",
+ lazy = true,
+}