diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..f09a8e4 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("config.lazy") +require("vim-options") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..8cc108b --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,39 @@ +{ + "LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" }, + "catppuccin": { "branch": "main", "commit": "05206bbb6d500a339cd55a9486532c3871a4455e" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "eff40c4f5fdf7ae8f269b258047d1bd7cee50f02" }, + "everforest-nvim": { "branch": "main", "commit": "2c40c11b971da120796564e69aecce7e7c82a854" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "gitsigns.nvim": { "branch": "main", "commit": "58bd9e98d8e3c5a1c98af312e85247ee1afd3ed2" }, + "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3fe94b8034dd5241cb882bb73847303b58857ecf" }, + "kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.icons": { "branch": "main", "commit": "fe63fe080e76d80713557e5f0c65bc15b14b152d" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "nightfox.nvim": { "branch": "main", "commit": "d3e8b1acc095baf57af81bb5e89fe7c4359eb619" }, + "nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, + "nvim-lspconfig": { "branch": "master", "commit": "6c505d4220b521f3b0e7b645f6ce45fa914d0eed" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "9e66d5c72dabfc6417c6015ed8991f3c4b504f7d" }, + "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, + "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "rose-pine": { "branch": "main", "commit": "1e45cea06db866143930a6df96fc66bf715c866c" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" } +} diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- 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 = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..dcfb655 --- /dev/null +++ b/.config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,5 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, +} diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..f0e3b99 --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,53 @@ +return { + { + "hrsh7th/cmp-nvim-lsp", + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "neovim/nvim-lspconfig", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + }, + opts = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + return { + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + } + end, + --[[ + keys = { + { "", function() require('cmp').mapping.scroll_docs(-4) end }, + { "", function() require('cmp').mapping.scroll_docs(4) end }, + { "", function() require('cmp').mapping.complete() end }, + { "", function() require('cmp').mapping.abort() end }, + { "", function() require('cmp').mapping.confirm({ select = true }) end }, + }, + ]] + -- + }, +} diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..ec1bab1 --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,8 @@ +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + lua = { "stylua" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/everforest.lua b/.config/nvim/lua/plugins/everforest.lua new file mode 100644 index 0000000..759b2e5 --- /dev/null +++ b/.config/nvim/lua/plugins/everforest.lua @@ -0,0 +1,12 @@ +return { + "neanias/everforest-nvim", + version = false, + lazy = false, + priority = 1000, -- make sure to load this before all the other start plugins + -- Optional; default configuration will be used if setup isn't called. + config = function() + require("everforest").setup({ + -- Your config here + }) + end, +} diff --git a/.config/nvim/lua/plugins/formatter.lua b/.config/nvim/lua/plugins/formatter.lua new file mode 100644 index 0000000..3b23893 --- /dev/null +++ b/.config/nvim/lua/plugins/formatter.lua @@ -0,0 +1,2 @@ +-- return { "mhartington/formatter.nvim" } +return {} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..1633cd1 --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,11 @@ +return { + { + "tpope/vim-fugitive", + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }, +} diff --git a/.config/nvim/lua/plugins/gruvbox.lua b/.config/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..6e2599a --- /dev/null +++ b/.config/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,3 @@ +return { + "ellisonleao/gruvbox.nvim", +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..3502a46 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,6 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = { + }, +} diff --git a/.config/nvim/lua/plugins/kanagawa.lua b/.config/nvim/lua/plugins/kanagawa.lua new file mode 100644 index 0000000..87c2b23 --- /dev/null +++ b/.config/nvim/lua/plugins/kanagawa.lua @@ -0,0 +1,3 @@ +return { + "rebelot/kanagawa.nvim", +} diff --git a/.config/nvim/lua/plugins/lint.lua b/.config/nvim/lua/plugins/lint.lua new file mode 100644 index 0000000..c7d513a --- /dev/null +++ b/.config/nvim/lua/plugins/lint.lua @@ -0,0 +1,3 @@ +return { + "mfussenegger/nvim-lint", +} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..c5e6ecf --- /dev/null +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,52 @@ +return { + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, +}, + { + "williamboman/mason-lspconfig.nvim", + dependencies = { "williamboman/mason.nvim" }, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "ruby_lsp", + "standardrb", + "terraformls", + "yamlls", + }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + dependencies = { "williamboman/mason-lspconfig.nvim" }, + config = function() + local lspconfig = require("lspconfig") + + lspconfig.ruby_lsp.setup({}) + lspconfig.standardrb.setup({}) + lspconfig.bashls.setup({}) + lspconfig.yamlls.setup({}) + lspconfig.terraformls.setup({}) + lspconfig.lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + format = { + defaultConfig = { + indent_style = "tabs", + indent_size = "4", + }, + enable = true, + }, + }, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..2a1be23 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,8 @@ +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = function() + return {} + end, +} diff --git a/.config/nvim/lua/plugins/luasnip.lua b/.config/nvim/lua/plugins/luasnip.lua new file mode 100644 index 0000000..8032bdc --- /dev/null +++ b/.config/nvim/lua/plugins/luasnip.lua @@ -0,0 +1,7 @@ +return { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, +} diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..3830f77 --- /dev/null +++ b/.config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,9 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, +} diff --git a/.config/nvim/lua/plugins/nightfox.lua b/.config/nvim/lua/plugins/nightfox.lua new file mode 100644 index 0000000..1793230 --- /dev/null +++ b/.config/nvim/lua/plugins/nightfox.lua @@ -0,0 +1 @@ +return { "EdenEast/nightfox.nvim" } diff --git a/.config/nvim/lua/plugins/nord.lua b/.config/nvim/lua/plugins/nord.lua new file mode 100644 index 0000000..8d9a097 --- /dev/null +++ b/.config/nvim/lua/plugins/nord.lua @@ -0,0 +1,3 @@ +return { + "shaunsingh/nord.nvim", +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..e2f0a3d --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,7 @@ +return { + "stevearc/oil.nvim", + opts = {}, + -- Optional dependencies + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons +} diff --git a/.config/nvim/lua/plugins/rose-pine.lua b/.config/nvim/lua/plugins/rose-pine.lua new file mode 100644 index 0000000..28b2599 --- /dev/null +++ b/.config/nvim/lua/plugins/rose-pine.lua @@ -0,0 +1 @@ +return { "rose-pine/neovim", name = "rose-pine" } diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua new file mode 100644 index 0000000..f3dbea8 --- /dev/null +++ b/.config/nvim/lua/plugins/surround.lua @@ -0,0 +1,10 @@ +return { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..66c9aef --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,33 @@ +return { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { + { + "ff", + function() + require("telescope.builtin").find_files() + end, + }, + { + "fg", + function() + require("telescope.builtin").live_grep() + end, + }, + { + "fb", + function() + require("telescope.builtin").buffers() + end, + }, + { + "fh", + function() + require("telescope.builtin").help_tags() + end, + }, + }, +} diff --git a/.config/nvim/lua/plugins/tokyonight.lua b/.config/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..23f7912 --- /dev/null +++ b/.config/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,6 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..4c4660b --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = { + build = ":TSUpdate", + ensure_installed = { + "ruby", + "lua", + "hcl", + "terraform", + }, + auto_install = true, + highlight = { + enable = true, + }, + indent = { + enable = false, + }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..fc29597 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..6f5940b --- /dev/null +++ b/.config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,7 @@ +return { + "mbbill/undotree", + + keys = { + { "u", vim.cmd.UndotreeToggle }, + }, +} diff --git a/.config/nvim/lua/vim-options.lua b/.config/nvim/lua/vim-options.lua new file mode 100644 index 0000000..2b4b55b --- /dev/null +++ b/.config/nvim/lua/vim-options.lua @@ -0,0 +1,10 @@ +vim.cmd("set expandtab") +vim.cmd("set tabstop=4") +vim.cmd("set softtabstop=4") +vim.cmd("set shiftwidth=4") +vim.cmd("set smartindent") + +vim.wo.number = true +vim.cmd.colorscheme "tokyonight" + +vim.opt.termguicolors = true