commit 6bc5875badf788a9f71eb436d78a3bd3aed816c4 Author: Diogo Diniz Date: Tue Aug 18 21:47:15 2026 +0100 feat: Initial nvim configs diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..15ef30d --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,23 @@ +require("config.options") +require("config.keymaps") + +-- Lazyvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { import = "plugins" } + }, +}) + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..fd39ce1 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,14 @@ +{ + "blink.cmp": { "branch": "main", "commit": "e116ff9c5c1c2ed6bcdb2e0a6e547099876a8116" }, + "blink.lib": { "branch": "main", "commit": "c8fdc12c8a2fab6cf786dd7141a283f8079f902b" }, + "crates.nvim": { "branch": "main", "commit": "694357861ec9ebf12475ddcdd04ea45a0923c32d" }, + "gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, + "nvim-lspconfig": { "branch": "master", "commit": "fbaef6156f9ad65790931ab543ab1dfec57bbec7" }, + "nvim-tree.lua": { "branch": "master", "commit": "b2aadda94b107480c48e548d6db51c6840b7b33c" }, + "nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" }, + "rustaceanvim": { "branch": "main", "commit": "58172f8275ccf66e5d771e26867a1cf908b4fc1b" }, + "vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" } +} diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..d0025c6 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +vim.keymap.set("n", "tt", function() + require("nvim-tree.api").tree.toggle() +end, { desc = "Open directory tree" }) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..e0eb3a4 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,17 @@ +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.undofile = true + +vim.g.mapleader = " " + +vim.opt.expandtab = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 0 + +vim.o.scrolloff = 20 + +vim.opt.signcolumn = 'yes' diff --git a/nvim/lua/plugins/crates.lua b/nvim/lua/plugins/crates.lua new file mode 100644 index 0000000..c8d7283 --- /dev/null +++ b/nvim/lua/plugins/crates.lua @@ -0,0 +1,6 @@ +return { + { + "saecki/crates.nvim", + ft = { "toml" }, + } +} diff --git a/nvim/lua/plugins/gruvbox.lua b/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..6a0825b --- /dev/null +++ b/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,3 @@ +return { + { "ellisonleao/gruvbox.nvim", priority = 1000 , config = function() vim.cmd([[colorscheme gruvbox]]) end, opts = ...}, +} diff --git a/nvim/lua/plugins/lsp-config.lua b/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..3ee81a1 --- /dev/null +++ b/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,3 @@ +return { + { "neovim/nvim-lspconfig" }, +} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..04bed72 --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,9 @@ +return { + { + "https://github.com/nvim-lualine/lualine.nvim", + event = "VeryLazy", + config = function() + require("lualine").setup() + end, + }, +} diff --git a/nvim/lua/plugins/nvim-autopairs.lua b/nvim/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..611e75f --- /dev/null +++ b/nvim/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,9 @@ +return { + { + "https://github.com/windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup() + end, + }, +} diff --git a/nvim/lua/plugins/nvim-tree.lua b/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..ffdf801 --- /dev/null +++ b/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,13 @@ +return { + { + "nvim-tree/nvim-tree.lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("nvim-tree").setup({ + filters = { + dotfiles = true, + }, + }) + end + }, +} diff --git a/nvim/lua/plugins/rust.lua b/nvim/lua/plugins/rust.lua new file mode 100644 index 0000000..a5bc58a --- /dev/null +++ b/nvim/lua/plugins/rust.lua @@ -0,0 +1,18 @@ +return { + { + "saghen/blink.cmp", + dependencies = { + "saghen/blink.lib", + }, + build = function() + require("blink.cmp").build():pwait() + end, + opts = { + keymap = { preset = "default" }, + } + }, + { + "mrcjkb/rustaceanvim", + ft = { "rust" }, + } +} diff --git a/nvim/lua/plugins/vim-lastplace.lua b/nvim/lua/plugins/vim-lastplace.lua new file mode 100644 index 0000000..935d4b1 --- /dev/null +++ b/nvim/lua/plugins/vim-lastplace.lua @@ -0,0 +1,6 @@ +return { + { + "https://github.com/farmergreg/vim-lastplace", + event = "BufReadPost", + }, +}