diff --git a/dot-config/nvim/init.lua b/dot-config/nvim/init.lua new file mode 100644 index 0000000..c648f63 --- /dev/null +++ b/dot-config/nvim/init.lua @@ -0,0 +1,2 @@ +require("config.vim-options") +require("config.lazy") diff --git a/dot-config/nvim/lua/config/lazy.lua b/dot-config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..a86c234 --- /dev/null +++ b/dot-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/dot-config/nvim/lua/config/vim-options.lua b/dot-config/nvim/lua/config/vim-options.lua new file mode 100644 index 0000000..278126c --- /dev/null +++ b/dot-config/nvim/lua/config/vim-options.lua @@ -0,0 +1,8 @@ +vim.cmd.set("expandtab") +vim.cmd.set("tabstop=2") +vim.cmd.set("softtabstop=2") +vim.cmd.set("shiftwidth=2") + +vim.opt.swapfile = false +vim.wo.number = true +vim.keymap.set("i", "jj", "", { noremap = false }) diff --git a/dot-config/nvim/lua/plugins/catpuccin.lua b/dot-config/nvim/lua/plugins/catpuccin.lua new file mode 100644 index 0000000..67fd571 --- /dev/null +++ b/dot-config/nvim/lua/plugins/catpuccin.lua @@ -0,0 +1,9 @@ +return { + "catppuccin/nvim", + lazy = false, + name = "catppuccin", + priority = 1000, + config = function() + vim.cmd.colorscheme("catppuccin-mocha") + end, +} diff --git a/dot-config/nvim/lua/plugins/lualine.lua b/dot-config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..0b69776 --- /dev/null +++ b/dot-config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,10 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require("lualine").setup({ + options = { + theme = "catppuccin", + }, + }) + end, +} diff --git a/dot-config/nvim/lua/plugins/mason.lua b/dot-config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..fa146cc --- /dev/null +++ b/dot-config/nvim/lua/plugins/mason.lua @@ -0,0 +1,26 @@ +return { + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls" }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + config = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({}) + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) + end, + }, +} diff --git a/dot-config/nvim/lua/plugins/neo-tree.lua b/dot-config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..d61fbb4 --- /dev/null +++ b/dot-config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,12 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "", ":Neotree filesystem reveal left toggle", {}) + end, +} diff --git a/dot-config/nvim/lua/plugins/none-ls.lua b/dot-config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..1d0146e --- /dev/null +++ b/dot-config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,13 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + }, + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end, +} diff --git a/dot-config/nvim/lua/plugins/telescope.lua b/dot-config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..84997e1 --- /dev/null +++ b/dot-config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,25 @@ +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + vim.keymap.set("n", "", builtin.find_files, {}) + vim.keymap.set("n", "fg", builtin.live_grep, {}) + end, + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + require("telescope").load_extension("ui-select") + end, + }, +} diff --git a/dot-config/nvim/lua/plugins/treesitter.lua b/dot-config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..5129e93 --- /dev/null +++ b/dot-config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,17 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + auto_install = true, + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + }) + end, +}