diff options
| author | 2026-02-25 15:15:28 +0000 | |
|---|---|---|
| committer | 2026-02-25 15:15:58 +0000 | |
| commit | 61651e4db4c3d4b1da14f0734d917022ff77e991 (patch) | |
| tree | 037936bf9e8d6d1096e15d74483a76589c9ddc15 /nvim | |
| parent | a3879aaae0926a925e652c0719de879ce4211a64 (diff) | |
chega de nixvim, vamos no old-school
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/init.lua | 39 | ||||
| -rw-r--r-- | nvim/lazy-lock.json | 19 | ||||
| -rw-r--r-- | nvim/lua/config/autocmd.lua | 6 | ||||
| -rw-r--r-- | nvim/lua/config/keymap.lua | 7 | ||||
| -rw-r--r-- | nvim/lua/config/lazy.lua | 31 | ||||
| -rw-r--r-- | nvim/lua/config/lsp.lua | 7 | ||||
| -rw-r--r-- | nvim/lua/config/options.lua | 20 | ||||
| -rw-r--r-- | nvim/lua/plugins/blink-cmp.lua | 46 | ||||
| -rw-r--r-- | nvim/lua/plugins/colorscheme.lua | 7 | ||||
| -rw-r--r-- | nvim/lua/plugins/lsp-format.lua | 16 | ||||
| -rw-r--r-- | nvim/lua/plugins/mini-pairs.lua | 1 | ||||
| -rw-r--r-- | nvim/lua/plugins/mini-statusline.lua | 1 | ||||
| -rw-r--r-- | nvim/lua/plugins/nix-develop.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/plugins/nvim-lspconfig.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/plugins/nvim-neoclip.lua | 8 | ||||
| -rw-r--r-- | nvim/lua/plugins/nvim-treesitter.lua | 20 | ||||
| -rw-r--r-- | nvim/lua/plugins/oil-nvim.lua | 13 | ||||
| -rw-r--r-- | nvim/lua/plugins/telescope.lua | 25 | ||||
| -rw-r--r-- | nvim/lua/plugins/web-devicons.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/plugins/which-key.lua | 4 |
20 files changed, 279 insertions, 0 deletions
diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..931af56 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,39 @@ +require("config.lazy") +require("config.keymap") +require("config.lsp") +require("mini.pairs").setup() +require("mini.statusline").setup() +require("lsp-format").setup() +require("neoclip").setup() +require("which-key").setup() +require("nvim-web-devicons").setup() + +vim.cmd("colorscheme modus_vivendi") + +-- plugins = { +-- gitsigns.enable = true; +-- none-ls = { +-- enable = true; +-- sources.formatting.prettier = { +-- enable = true; +-- disableTsServerFormatter = true; +-- }; +-- }; +-- render-markdown.enable = true; +-- nui.enable = true; +-- dap.enable = true; +-- comment.enable = true; +-- overseer.enable = true; +-- oil.enable = true; +-- oil-git-status.enable = true; +-- flash.enable = true; +-- quicker.enable = true; +-- mini-ai.enable = true; +-- mini-pairs.enable = true; +-- mini-surround.enable = true; +-- mini-bracketed.enable = true; +-- mini-tabline.enable = true; +-- mini-align.enable = true; +-- mini-statusline.enable = true; +-- todo-comments.enable = true; +-- }; diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..eb78156 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,19 @@ +{ + "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lsp-format.nvim": { "branch": "master", "commit": "42d1d3e407c846d95f84ea3767e72ed6e08f7495" }, + "mini.icons": { "branch": "main", "commit": "5b9076dae1bfbe47ba4a14bc8b967cde0ab5d77e" }, + "mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" }, + "mini.statusline": { "branch": "main", "commit": "14919901649d20d020e659c63c03baa75cd94f33" }, + "modus-themes.nvim": { "branch": "master", "commit": "c57c2c56c9f0af04f3b609d11caa840880074784" }, + "nix-develop.nvim": { "branch": "main", "commit": "bfba63d6c129d8b5073fe9eb965c9acee04becb0" }, + "nvim-lspconfig": { "branch": "master", "commit": "ab5139c99df944479e5a26495a37840fcbb1d512" }, + "nvim-neoclip.lua": { "branch": "main", "commit": "831a97c7697736411a05ff8b91e8798ea4c2d6fb" }, + "nvim-treesitter": { "branch": "main", "commit": "d660b7c002f3922b6bb3da47206645488a698426" }, + "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, + "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} 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, +} |
